Skip to content

Commit

Permalink
Merge branch 'main' into mind-search
Browse files Browse the repository at this point in the history
  • Loading branch information
Harold-lkk authored Jul 29, 2024
2 parents 691e14d + 139a810 commit 98a94c8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lagent/llms/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ def streaming(raw_response):
assert isinstance(messages, list)
gen_params = gen_params.copy()


# Hold out 100 tokens due to potential errors in tiktoken calculation
max_tokens = min(gen_params.pop('max_new_tokens'), 4096)
if max_tokens <= 0:
Expand Down

0 comments on commit 98a94c8

Please sign in to comment.