Update app.py
Browse files
app.py
CHANGED
@@ -77,9 +77,10 @@ def stream_chat(message: str, history: list, temperature: float, max_new_tokens:
|
|
77 |
|
78 |
thread = Thread(target=model.generate, kwargs=generate_kwargs)
|
79 |
thread.start()
|
80 |
-
buffer = ""
|
81 |
-
for
|
82 |
-
|
|
|
83 |
yield buffer
|
84 |
|
85 |
chatbot = gr.Chatbot(height=600, placeholder = PLACEHOLDER)
|
|
|
77 |
|
78 |
thread = Thread(target=model.generate, kwargs=generate_kwargs)
|
79 |
thread.start()
|
80 |
+
buffer = ""
|
81 |
+
for new_token in streamer:
|
82 |
+
if new_token and '<|user|>' not in new_token:
|
83 |
+
buffer += new_token
|
84 |
yield buffer
|
85 |
|
86 |
chatbot = gr.Chatbot(height=600, placeholder = PLACEHOLDER)
|