Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -129,18 +129,20 @@ def respond(
|
|
129 |
result = ""
|
130 |
appended = False
|
131 |
for chunk in completion:
|
132 |
-
|
133 |
-
if
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
|
|
|
|
|
|
138 |
)
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
yield history[-2:]
|
144 |
|
145 |
"""
|
146 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
|
|
129 |
result = ""
|
130 |
appended = False
|
131 |
for chunk in completion:
|
132 |
+
print(chunk)
|
133 |
+
if chunk.choices[0].delta.content:
|
134 |
+
result += chunk.choices[0].delta.content
|
135 |
+
if not appended:
|
136 |
+
history.append(
|
137 |
+
ChatMessage(
|
138 |
+
role="assistant",
|
139 |
+
content="",
|
140 |
+
)
|
141 |
)
|
142 |
+
appended = True
|
143 |
+
|
144 |
+
history[-1].content = result
|
145 |
+
yield history[-2:]
|
|
|
146 |
|
147 |
"""
|
148 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|