Update app.py
Browse files
app.py
CHANGED
@@ -108,7 +108,7 @@ def get_word_probabilities(text):
|
|
108 |
word_colors.append(color)
|
109 |
|
110 |
word_probs = [float(p) for p in word_probs]
|
111 |
-
return word_probs,
|
112 |
|
113 |
# def get_word_classifications(text):
|
114 |
# text = " ".join(text.split(" ")[:2048])
|
@@ -170,7 +170,7 @@ def setup_hf_dataset():
|
|
170 |
|
171 |
# Main inference + logging function
|
172 |
def infer_and_log(text_input):
|
173 |
-
|
174 |
timestamp = datetime.datetime.now().isoformat()
|
175 |
submission_id = str(uuid.uuid4())
|
176 |
|
@@ -199,8 +199,7 @@ def infer_and_log(text_input):
|
|
199 |
except Exception as e:
|
200 |
print(f"Error uploading log: {e}")
|
201 |
|
202 |
-
return
|
203 |
-
|
204 |
|
205 |
def clear_fields():
|
206 |
return "", ""
|
|
|
108 |
word_colors.append(color)
|
109 |
|
110 |
word_probs = [float(p) for p in word_probs]
|
111 |
+
return word_probs, word_colors
|
112 |
|
113 |
# def get_word_classifications(text):
|
114 |
# text = " ".join(text.split(" ")[:2048])
|
|
|
170 |
|
171 |
# Main inference + logging function
|
172 |
def infer_and_log(text_input):
|
173 |
+
word_probs, word_colors = get_word_probabilities(text_input)
|
174 |
timestamp = datetime.datetime.now().isoformat()
|
175 |
submission_id = str(uuid.uuid4())
|
176 |
|
|
|
199 |
except Exception as e:
|
200 |
print(f"Error uploading log: {e}")
|
201 |
|
202 |
+
return word_colors
|
|
|
203 |
|
204 |
def clear_fields():
|
205 |
return "", ""
|