Update app.py
Browse files
app.py
CHANGED
@@ -122,12 +122,8 @@ def infer_and_log(text_input):
|
|
122 |
print(f"Uploaded log {submission_id}")
|
123 |
except Exception as e:
|
124 |
print(f"Error uploading log: {e}")
|
125 |
-
|
126 |
-
|
127 |
-
tokens = text_input.replace("\n", " \n ").split()
|
128 |
-
|
129 |
-
formatted_output = " ".join(f'<span style="color:{color}">{token}</span>' if token != "\n" else "<br>" for token, color in zip(tokens, word_colors))
|
130 |
-
# formatted_output = " ".join(f'<span style= "color:{color}">{token}</span>' for token, color in zip(tokens, word_colors))
|
131 |
return formatted_output, word_probs
|
132 |
|
133 |
def clear_fields():
|
|
|
122 |
print(f"Uploaded log {submission_id}")
|
123 |
except Exception as e:
|
124 |
print(f"Error uploading log: {e}")
|
125 |
+
tokens = text_input.split()
|
126 |
+
formatted_output = " ".join(f'<span style= "color:{color}">{token}</span>' for token, color in zip(tokens, word_colors))
|
|
|
|
|
|
|
|
|
127 |
return formatted_output, word_probs
|
128 |
|
129 |
def clear_fields():
|