X-D-Lab / LangChain-ChatGLM-Webui

基于LangChain和ChatGLM-6B等系列LLM的针对本地知识库的自动问答
Apache License 2.0
3.14k stars 474 forks source link

关于“模型未成功重新加载,请点击重新加载模型”的问题 #82

Closed tanglu86 closed 1 year ago

tanglu86 commented 1 year ago

1、config.py配置如下 ` init model config

init_llm = "ChatGLM-6B-int8"

init_llm = "ChatGLM-6B" #使用的6B模型 init_embedding_model = "text2vec-base"

embedding_model_dict = { "text2vec-base": "/data/LangChain/model/text2vec-base-chinese",
}

llm_model_dict = { "chatglm": { "ChatGLM-6B": "/data/LangChain/model/chatglm-6b", #路径已修改 }, `

2、模型路径确认是正确的 1

3、web报错 2

menkeyi commented 1 year ago

这个项目需要安装cuda环境,不能只安装Python的cuda包 sudo apt install nvidia-cuda-toolkit

可以测试下自己的模型是否能跑成功 from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("/data/share/menky/LangChain-ChatGLM-Webui/chatglm-6b-int8", trust_remote_code=True) model = AutoModel.from_pretrained("/data/share/menky/LangChain-ChatGLM-Webui/chatglm-6b-int8", trust_remote_code=True).half().cuda() response, history = model.chat(tokenizer, "你好", history=[]) print(response) response, history = model.chat(tokenizer, "晚上睡不着应该怎么办", history=history) print(response)