Closed tanglu86 closed 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)
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、模型路径确认是正确的
3、web报错