FinGPT
FinGPT copied to clipboard
执行 FinGPT v3 Series 的 Try your model 例子报错如下
报错信息:RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument index in method wrapper_CUDA__index_select) 能请您给指点一下么?
Just feed all the data and model to the same device(e.g. cuda)
将第28行改成下面:
device = torch.device("cuda:0") tokens = tokenizer(prompt, return_tensors='pt', padding=True, max_length=512).to(device)