Skip to content

Commit

Permalink
Merge pull request #2339 from 6vision/master
Browse files Browse the repository at this point in the history
Optimize Gemini model character statistics
  • Loading branch information
6vision authored Oct 14, 2024
2 parents 883f0d4 + f4a5f00 commit fcc4d02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bot/chatgpt/chat_gpt_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def calc_tokens(self):
def num_tokens_from_messages(messages, model):
"""Returns the number of tokens used by a list of messages."""

if model in ["wenxin", "xunfei", const.GEMINI]:
if model in ["wenxin", "xunfei"] or model.startswith(const.GEMINI):
return num_tokens_by_character(messages)

import tiktoken
Expand Down

0 comments on commit fcc4d02

Please sign in to comment.