Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,10 +37,15 @@ def fn(
|
|
| 37 |
stream = True
|
| 38 |
)
|
| 39 |
|
| 40 |
-
response = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
for chunk in stream:
|
| 42 |
-
|
| 43 |
-
|
| 44 |
|
| 45 |
app = gr.ChatInterface(
|
| 46 |
fn = fn,
|
|
|
|
| 37 |
stream = True
|
| 38 |
)
|
| 39 |
|
| 40 |
+
#response = ""
|
| 41 |
+
#for chunk in stream:
|
| 42 |
+
# response += chunk.choices[0].delta.content
|
| 43 |
+
#return response
|
| 44 |
+
|
| 45 |
+
chunks = []
|
| 46 |
for chunk in stream:
|
| 47 |
+
chunks.append(chunk.choices[0].delta.content or "")
|
| 48 |
+
yield "".join(chunks)
|
| 49 |
|
| 50 |
app = gr.ChatInterface(
|
| 51 |
fn = fn,
|