Open Tungsong opened 1 year ago
遇到同样的问题,之后我在inference.py内加了:
device = torch.device("cuda:0") if torch.cuda.is_available() else torch.device("cpu") input_ids = input_ids.to(device) # 该句加在input_ids = torch.LongTensor([ids])后面
后面用CUDA_VISIBLE_DEVICES=0 python inference.py 命令还是报这个错
多卡推理参考的ChatGLM-6B官方的多卡部署 https://github.com/THUDM/ChatGLM-6B#%E5%A4%9A%E5%8D%A1%E9%83%A8%E7%BD%B2