Spaces:
Sleeping
Sleeping
error handling
Browse files
app.py
CHANGED
|
@@ -120,11 +120,13 @@ def respond(
|
|
| 120 |
temperature=temperature,
|
| 121 |
top_p=top_p,
|
| 122 |
):
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
|
|
|
|
|
|
| 128 |
|
| 129 |
"""
|
| 130 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
|
|
|
| 120 |
temperature=temperature,
|
| 121 |
top_p=top_p,
|
| 122 |
):
|
| 123 |
+
if message.choices:
|
| 124 |
+
token = message.choices[0].delta.content
|
| 125 |
+
if token:
|
| 126 |
+
response += token
|
| 127 |
+
yield response
|
| 128 |
+
else:
|
| 129 |
+
yield "Please clear the history and try again."
|
| 130 |
|
| 131 |
"""
|
| 132 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|