-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:7! (when checking argument for argument mat2 in method wrapper_CUDA_bmm) #322
Comments
启动fastapi服务 和请求是要在两个终端的,你也可以使用request来请求 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我在01-LLaMA3-8B-Instruct FastApi 部署调用中运行其中的api.py,服务器是正常运行的,代码也没有报错,当我采用curl -X POST "http://127.0.0.1:6006/" -H "Content-Type: application/json" -d '{"prompt": "你好!", "history": []}'访问时,报错RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:7! (when checking argument for argument mat2 in method wrapper_CUDA_bmm)
我的自我解决经验:
1.检查model和input_ids的model均放在device,无效
2.使用accelerate库,accelerator = Accelerator() ; model, tokenizer = accelerator.prepare(model, tokenizer),无效
3.更新transformer库,参考其他issue,无效
求解决方案
The text was updated successfully, but these errors were encountered: