Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,9 +26,13 @@ def respond(message, history, system_message, max_tokens, temperature, top_p):
|
|
26 |
temperature=temperature,
|
27 |
top_p=top_p,
|
28 |
):
|
29 |
-
if chunk
|
|
|
|
|
30 |
response += chunk.token.text
|
31 |
-
|
|
|
|
|
32 |
|
33 |
# If the response is empty, yield a default message
|
34 |
if not response:
|
|
|
26 |
temperature=temperature,
|
27 |
top_p=top_p,
|
28 |
):
|
29 |
+
if isinstance(chunk, str):
|
30 |
+
response += chunk
|
31 |
+
elif hasattr(chunk, 'token'):
|
32 |
response += chunk.token.text
|
33 |
+
elif hasattr(chunk, 'generated_text'):
|
34 |
+
response += chunk.generated_text
|
35 |
+
yield history + [(message, response)]
|
36 |
|
37 |
# If the response is empty, yield a default message
|
38 |
if not response:
|