提交 f1470432 作者: imClumsyPanda

fix bug in chatglm_llm.py

上级 5c34dd94
......@@ -41,10 +41,12 @@ class LocalDocQA:
llm_model: str = LLM_MODEL,
llm_device=LLM_DEVICE,
top_k=VECTOR_SEARCH_TOP_K,
use_ptuning_v2: bool = USE_PTUNING_V2
):
self.llm = ChatGLM()
self.llm.load_model(model_name_or_path=llm_model_dict[llm_model],
llm_device=llm_device)
llm_device=llm_device,
use_ptuning_v2=use_ptuning_v2)
self.llm.history_len = llm_history_len
self.embeddings = HuggingFaceEmbeddings(model_name=embedding_model_dict[embedding_model], )
......
......@@ -127,14 +127,6 @@ class ChatGLM(LLM):
device_map = auto_configure_device_map(num_gpus)
self.model = dispatch_model(model, device_map=device_map)
self.model = (
AutoModel.from_pretrained(
model_name_or_path,
config=model_config,
trust_remote_code=True)
.half()
.cuda()
)
else:
self.model = (
AutoModel.from_pretrained(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论