mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-16 11:15:53 +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:
parent
be13429d05
commit
21453ffff0
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user