Update app.py

This commit is contained in:
Ahmed Nassar 2025-03-17 12:03:02 +00:00 committed by system
parent 4c5160df09
commit 0511dd38cc
No known key found for this signature in database
GPG Key ID: 6A528E38E0733467
1 changed files with 4 additions and 3 deletions

7
app.py
View File

@ -114,9 +114,10 @@ def model_inference(
doctag_output = ""
for new_text in streamer:
if new_text != "<end_of_utterance>":
buffer += html.escape(new_text)
doctag_output += new_text
if "<end_of_utterance>" in new_text:
continue # Skip it entirely
buffer += html.escape(new_text)
doctag_output += new_text
yield buffer
if any(tag in doctag_output for tag in ["<doctag>", "<otsl>", "<code>", "<formula>", "<chart>"]):