asnassar commited on
Commit
0511dd3
·
verified ·
1 Parent(s): 4c5160d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -114,9 +114,10 @@ def model_inference(
114
  doctag_output = ""
115
 
116
  for new_text in streamer:
117
- if new_text != "<end_of_utterance>":
118
- buffer += html.escape(new_text)
119
- doctag_output += new_text
 
120
  yield buffer
121
 
122
  if any(tag in doctag_output for tag in ["<doctag>", "<otsl>", "<code>", "<formula>", "<chart>"]):
 
114
  doctag_output = ""
115
 
116
  for new_text in streamer:
117
+ if "<end_of_utterance>" in new_text:
118
+ continue # Skip it entirely
119
+ buffer += html.escape(new_text)
120
+ doctag_output += new_text
121
  yield buffer
122
 
123
  if any(tag in doctag_output for tag in ["<doctag>", "<otsl>", "<code>", "<formula>", "<chart>"]):