openai[patch]: rm tiktoken model warning (#16964)

This commit is contained in:
Bagatur
2024-02-03 16:36:57 -08:00
committed by GitHub
parent 0826d87ecd
commit 35446c814e
5 changed files with 30 additions and 20 deletions

View File

@@ -496,9 +496,7 @@ class BaseOpenAI(BaseLLM):
try:
enc = tiktoken.encoding_for_model(model_name)
except KeyError:
logger.warning("Warning: model not found. Using cl100k_base encoding.")
model = "cl100k_base"
enc = tiktoken.get_encoding(model)
enc = tiktoken.get_encoding("cl100k_base")
return enc.encode(
text,