Skip to content

Commit

Permalink
fix client
Browse files Browse the repository at this point in the history
  • Loading branch information
AllentDan committed Mar 15, 2024
1 parent f356a09 commit f798649
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lmdeploy/serve/openai/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def chat(self,
temperature=temperature,
repetition_penalty=repetition_penalty,
ignore_eos=ignore_eos):
if outputs['finish_reason'] == 'length':
if outputs['finish_reason'] == 'length' and outputs['tokens'] == 0:
print('WARNING: exceed session max length.'
' Please end the session.')
yield outputs['text'], outputs['tokens'], outputs['finish_reason']
Expand Down

0 comments on commit f798649

Please sign in to comment.