Open nasirus opened 1 year ago
Thank you for bringing this issue to our attention. We have identified the issue and have corrected the code to include the type assertion list. The updated code is as follows:
"llm":
{
"model_name": "gpt-3.5-turbo",
"temperature": 0,
"_type": "openai-chat"
},
if config_type not in type_to_cls_dict:
type_to_cls_dict[config_type] = OpenAI
llm_cls = type_to_cls_dict[config_type]
return llm_cls(**config)
We have also tested the code to ensure that it is working as expected. We apologize for any inconvenience this may have caused. If you have any further questions or concerns, please do not hesitate to reach out. Thank you for your patience.
when I save llm=OpenAI(temperature=0, model_name="gpt-3.5-turbo"),the json data like this:
"llm": { "model_name": "gpt-3.5-turbo", "temperature": 0, "_type": "openai-chat" }, but the _type is not in type assertion list, and raise error:
File ~/miniconda3/envs/gpt/lib/python3.10/site-packages/langchain/llms/loading.py:19, in load_llm_from_config(config) 16 config_type = config.pop("_type") 18 if config_type not in type_to_cls_dict: ---> 19 raise ValueError(f"Loading {config_type} LLM not supported") 21 llm_cls = type_to_cls_dict[config_type] 22 return llm_cls(**config)
ValueError: Loading openai-chat LLM not supported