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
1 changed files with 1 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ class Base(ABC):
|
|||
stream=True,
|
||||
**gen_conf)
|
||||
for resp in response:
|
||||
if len(resp.choices) == 0:continue
|
||||
if not resp.choices[0].delta.content:continue
|
||||
ans += resp.choices[0].delta.content
|
||||
total_tokens += 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue