提交 ab73f6ad 作者: glide-the

适配远程LLM调用

上级 24324563
......@@ -70,21 +70,19 @@ llm_model_dict = {
"provides": "LLamaLLM"
},
"fast-chat-chatglm-6b": {
"name": "FastChatOpenAI",
"name": "chatglm-6b",
"pretrained_model_name": "FastChatOpenAI",
"local_model_path": None,
"provides": "FastChatOpenAILLM",
"api_base_url": "http://localhost:8000/v1",
"model_name": "chatglm-6b"
"api_base_url": "http://localhost:8000/v1"
},
"fast-chat-vicuna-13b-hf": {
"name": "FastChatOpenAI",
"name": "vicuna-13b-hf",
"pretrained_model_name": "vicuna-13b-hf",
"local_model_path": None,
"provides": "FastChatOpenAILLM",
"api_base_url": "http://localhost:8000/v1",
"model_name": "vicuna-13b-hf"
"api_base_url": "http://localhost:8000/v1"
},
}
......
......@@ -34,7 +34,7 @@ def loaderLLM(llm_model: str = None, no_remote_model: bool = False, use_ptuning_
loaderCheckPoint.model_path = llm_model_info["local_model_path"]
if 'FastChatOpenAILLM' in llm_model_info["local_model_path"]:
if 'FastChatOpenAILLM' in llm_model_info["provides"]:
loaderCheckPoint.unload_model()
else:
loaderCheckPoint.reload_model()
......@@ -43,5 +43,5 @@ def loaderLLM(llm_model: str = None, no_remote_model: bool = False, use_ptuning_
modelInsLLM = provides_class(checkPoint=loaderCheckPoint)
if 'FastChatOpenAILLM' in llm_model_info["provides"]:
modelInsLLM.set_api_base_url(llm_model_info['api_base_url'])
modelInsLLM.call_model_name(llm_model_info['model_name'])
modelInsLLM.call_model_name(llm_model_info['name'])
return modelInsLLM
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论