Skip to content

Commit

Permalink
Merge branch 'master' of github.com:zhayujie/chatgpt-on-wechat
Browse files Browse the repository at this point in the history
  • Loading branch information
Saboteur7 committed Oct 19, 2024
2 parents 70e007d + fcc4d02 commit 0773174
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 0773174

Please sign in to comment.