Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -63,10 +63,11 @@ def stream_chat(message: str, history: list, temperature: float, max_length: int
|
|
63 |
with torch.no_grad():
|
64 |
thread = Thread(target=model.generate, kwargs=gen_kwargs)
|
65 |
thread.start()
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
70 |
|
71 |
|
72 |
|
|
|
63 |
with torch.no_grad():
|
64 |
thread = Thread(target=model.generate, kwargs=gen_kwargs)
|
65 |
thread.start()
|
66 |
+
buffer = ""
|
67 |
+
for new_text in streamer:
|
68 |
+
buffer += new_text
|
69 |
+
print(buffer)
|
70 |
+
yield buffer
|
71 |
|
72 |
|
73 |
|