Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

求助,这是什么问题 #14

Open
luowei729 opened this issue Apr 29, 2023 · 3 comments
Open

求助,这是什么问题 #14

luowei729 opened this issue Apr 29, 2023 · 3 comments

Comments

@luowei729
Copy link

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
Copy link

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

@Asyncload
Copy link

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

@5102a
Copy link

5102a commented Jul 8, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants