Spaces:
Sleeping
Sleeping
error handling
Browse files
app.py
CHANGED
@@ -65,11 +65,13 @@ def respond(
|
|
65 |
temperature=temperature,
|
66 |
top_p=top_p,
|
67 |
):
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
73 |
|
74 |
"""
|
75 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
|
|
65 |
temperature=temperature,
|
66 |
top_p=top_p,
|
67 |
):
|
68 |
+
if message.choices:
|
69 |
+
token = message.choices[0].delta.content
|
70 |
+
if token:
|
71 |
+
response += token
|
72 |
+
yield response
|
73 |
+
else:
|
74 |
+
yield "Please clear the history and try again."
|
75 |
|
76 |
"""
|
77 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|