perf: 优化控制台输出

This commit is contained in:
RockChinQ
2024-02-16 14:11:22 +08:00
parent ae358dd6d0
commit 06c8773975
5 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ class ModelManager:
for model in self.model_list:
if model.name == name:
return model
raise ValueError(f"Model {name} not found")
raise ValueError(f"不支持模型: {name} , 请检查配置文件")
async def initialize(self):
openai_chat_completion = chatcmpl.OpenAIChatCompletion(self.ap)
@@ -17,7 +17,7 @@ class Tiktoken(tokenizer.LLMTokenizer):
try:
encoding = tiktoken.encoding_for_model(model.name)
except KeyError:
print("Warning: model not found. Using cl100k_base encoding.")
# print("Warning: model not found. Using cl100k_base encoding.")
encoding = tiktoken.get_encoding("cl100k_base")
num_tokens = 0