Skip to content

Commit 21453ff

Browse files
authored
fixed: The choices may be empty. (#876)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
1 parent be13429 commit 21453ff

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

rag/llm/chat_model.py

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def chat_streamly(self, system, history, gen_conf):
5656
stream=True,
5757
**gen_conf)
5858
for resp in response:
59+
if len(resp.choices) == 0:continue
5960
if not resp.choices[0].delta.content:continue
6061
ans += resp.choices[0].delta.content
6162
total_tokens += 1

0 commit comments

Comments
 (0)