mirror of
https://github.com/hwchase17/langchain
synced 2024-11-04 06:00:26 +00:00
Fix for versioned OpenAI instruct models (#10788)
Versioned OpenAI instruct models may end with numbers, e.g. `gpt-3.5-turbo-instruct-0914`. Fixes https://github.com/langchain-ai/langchainjs/issues/2669 in Python
This commit is contained in:
parent
73afd72e1d
commit
61cecf8b1b
@ -198,7 +198,7 @@ class BaseOpenAI(BaseLLM):
|
|||||||
model_name = data.get("model_name", "")
|
model_name = data.get("model_name", "")
|
||||||
if (
|
if (
|
||||||
model_name.startswith("gpt-3.5-turbo") or model_name.startswith("gpt-4")
|
model_name.startswith("gpt-3.5-turbo") or model_name.startswith("gpt-4")
|
||||||
) and not model_name.endswith("-instruct"):
|
) and "-instruct" not in model_name:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"You are trying to use a chat model. This way of initializing it is "
|
"You are trying to use a chat model. This way of initializing it is "
|
||||||
"no longer supported. Instead, please use: "
|
"no longer supported. Instead, please use: "
|
||||||
|
Loading…
Reference in New Issue
Block a user