Skip to content

Commit

Permalink
fix error when use farui-plus model (#7316)
Browse files Browse the repository at this point in the history
Co-authored-by: 雪风 <xuefeng@shifaedu.cn>
  • Loading branch information
oiuv and 雪风 authored Aug 15, 2024
1 parent d1a6702 commit 6fdbc7d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/core/model_runtime/model_providers/tongyi/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ def get_num_tokens(self, model: str, credentials: dict, prompt_messages: list[Pr
"""
if model in ['qwen-turbo-chat', 'qwen-plus-chat']:
model = model.replace('-chat', '')
if model == 'farui-plus':
model = 'qwen-farui-plus'

if model in self.tokenizers:
tokenizer = self.tokenizers[model]
Expand Down

0 comments on commit 6fdbc7d

Please sign in to comment.