tanvisharma commited on
Commit
c2ef115
Β·
verified Β·
1 Parent(s): 08accca

Fix list index out of range on stream end

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -148,7 +148,8 @@ def stream_answer(query, results, history):
148
  stream=True,
149
  )
150
  for chunk in stream:
151
- yield chunk.choices[0].delta.content or ""
 
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 ───────────────────────────────────────────────────────────────────