minemaster01 commited on
Commit
136a2a9
·
verified ·
1 Parent(s): b80be12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
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
- # tokens = text_input.split()
126
- # Replace \n with <br> in the input text for HTML rendering
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():