mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
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)
This commit is contained in:
@ -56,6 +56,7 @@ class Base(ABC):
|
|||||||
stream=True,
|
stream=True,
|
||||||
**gen_conf)
|
**gen_conf)
|
||||||
for resp in response:
|
for resp in response:
|
||||||
|
if len(resp.choices) == 0:continue
|
||||||
if not resp.choices[0].delta.content:continue
|
if not resp.choices[0].delta.content:continue
|
||||||
ans += resp.choices[0].delta.content
|
ans += resp.choices[0].delta.content
|
||||||
total_tokens += 1
|
total_tokens += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user