Spaces:
Sleeping
Sleeping
Fix list index out of range on stream end
Browse files
app.py
CHANGED
|
@@ -148,7 +148,8 @@ def stream_answer(query, results, history):
|
|
| 148 |
stream=True,
|
| 149 |
)
|
| 150 |
for chunk in stream:
|
| 151 |
-
|
|
|
|
| 152 |
|
| 153 |
|
| 154 |
# ββ Sidebar βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 148 |
stream=True,
|
| 149 |
)
|
| 150 |
for chunk in stream:
|
| 151 |
+
if chunk.choices:
|
| 152 |
+
yield chunk.choices[0].delta.content or ""
|
| 153 |
|
| 154 |
|
| 155 |
# ββ Sidebar βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|