yuanjie-ai / ChatLLM

轻松玩转LLM兼容openai&langchain,支持文心一言、讯飞星火、腾讯混元、智谱ChatGLM等
https://yuanjie-ai.github.io/ChatLLM/
MIT License
430 stars 53 forks source link

Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! #7

Closed liyanallen closed 1 year ago

liyanallen commented 1 year ago

执行ChatPDF部分代码时,报错,

from chatllm.applications.chatpdf import ChatPDF

qa = ChatPDF(encode_model='nghuyong/ernie-3.0-nano-zh')
qa.load_llm4chat(model_name_or_path="THUDM/chatglm-6b")
qa.create_index('财报.pdf')  # 构建知识库

list(qa(query='东北证券主营业务'))

Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument mat2 in method wrapper_CUDA_mm)

yuanjie-ai commented 1 year ago

版本是啥,建议更新到最新版本 pip install "chatllm[pdf]" -U

liyanallen commented 1 year ago

版本是啥,建议更新到最新版本 pip install "chatllm[pdf]" -U

pip install "chatllm[pdf]" -U,更新后,运行提示【No module named 'chatllm'】,重新安装 ,【pip install -U chatllm】, 仍在执行【from chatllm.applications.chatpdf import ChatPDF】时报【No module named 'chatllm'】

备注:环境是ubuntu20

liyanallen commented 1 year ago

解决了,谢谢您,thank you very much