LangChain-ChatGLM-Webui
LangChain-ChatGLM-Webui copied to clipboard
基于LangChain和ChatGLM-6B等系列LLM的针对本地知识库的自动问答
- 环境: GPU多卡,程序启动的时候,指定使用显存占用最少的显卡 ```python # 指定显存占用最少的显卡 os.system('nvidia-smi -q -d Memory |grep -A4 GPU|grep Free >tmp') memory_gpu = [int(x.split()[2]) for x in open('tmp', 'r').readlines()] DEVICE_ID = np.argmax(memory_gpu) torch.cuda.set_device(int(DEVICE_ID)) ``` - 程序启动后,默认加载ChatGLM-6B-int4,且可以成功加载,此时显示device=3...
Could not create share link. Please check your internet connection or our status page: https://status.gradio.app Traceback (most recent call last): File "C:\Users\qyy\.conda\envs\chatglm1\Lib\site-packages\gradio\routes.py", line 394, in run_predict output = await app.get_blocks().process_api(...
可以正常加载chatglm-6B-int8并且正常问答,但是加载BELLE-7b和Vicuna-7b模型后,进行提问,页面出现ERROR,同时后台报错如下信息: TypeError: The current model class (LlamaModel) is not compatible with `.generate()`, as it doesn't have a language model head. Please use one of the following classes instead: {'LlamaForCausalLM'} 代码断点定位在KnowledgeBasedChatLLM类的get_knowledge_based_answer函数的这一句上...
  
一直提示模型加载不成功,点击发送,日志会报这个异常 Traceback (most recent call last): File "/Users/zego/LLMSDemo/LangChain-ChatGLM-Webui/venv/lib/python3.9/site-packages/gradio/routes.py", line 412, in run_predict output = await app.get_blocks().process_api( File "/Users/zego/LLMSDemo/LangChain-ChatGLM-Webui/venv/lib/python3.9/site-packages/gradio/blocks.py", line 1299, in process_api result = await self.call_function( File "/Users/zego/LLMSDemo/LangChain-ChatGLM-Webui/venv/lib/python3.9/site-packages/gradio/blocks.py", line 1021,...
把模型路径改成chatglm,试图以chatglm方式加载模型,但是存在以下问题 1. 通义千问使用AutoModelForCausalLM而不是AutoModel 2. 通义千问的`model.chat()`函数不支持 max_length 和 temperature 参数 3. `AutoModelForCausalLM().from_pretrained().half()` 中 half() 函数无法使用,需要删除
您好,可以支持一下codeshell模型吗?该模型的地址为:https://github.com/WisdomShell/codeshell 谢谢!