NCZkevin / chatglm-web

用 FastAPI 和 Vue3 搭建的 ChatGLM 网页 (前端样式仿照chatgpt-web, 支持chatglm流式输出、前端调整参数、上下文选择、保存图片、知识库问答等功能)
http://chatglm.nczkevin.com
MIT License
437 stars 75 forks source link

求助,这是什么问题 #14

Open luowei729 opened 1 year ago

luowei729 commented 1 year ago

cuda已经正常安装了

Traceback (most recent call last): File "D:\chatglm-web-main\service\main.py", line 186, in model = AutoModel.from_pretrained(model_path, trust_remote_code=True).half().quantize(quantize).cuda() File "C:\Users\Administrator/.cache\huggingface\modules\transformers_modules\THUDM\chatglm-6b\658202d88ac4bb782b99e99ac3adff58b4d0b813\modeling_chatglm.py", line 1434, in quantize self.transformer = quantize(self.transformer, bits, empty_init=empty_init, **kwargs) File "C:\Users\Administrator/.cache\huggingface\modules\transformers_modules\THUDM\chatglm-6b\658202d88ac4bb782b99e99ac3adff58b4d0b813\quantization.py", line 159, in quantize weight_tensor=layer.attention.query_key_value.weight.to(torch.cuda.current_device()), File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\cuda__init__.py", line 674, in current_device _lazy_init() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\cuda__init__.py", line 239, in _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled

bluegass commented 1 year ago

cuda配置有问题,建议用命令检查cuda是否正常启用

Asyncload commented 1 year ago

model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().to('mps')

5102a commented 1 year ago

torch和cuda版本不兼容,建议先卸载 torch 再去 https://pytorch.org/ 这里下载对应版本(命令行指定版本也行)