FinGPT icon indicating copy to clipboard operation
FinGPT copied to clipboard

执行 FinGPT v3 Series 的 Try your model 例子报错如下

Open shineyGuang opened this issue 2 years ago • 2 comments

报错信息: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) 能请您给指点一下么?

shineyGuang avatar Sep 07 '23 07:09 shineyGuang

Just feed all the data and model to the same device(e.g. cuda)

maywind23 avatar Sep 11 '23 02:09 maywind23

将第28行改成下面: device = torch.device("cuda:0") tokens = tokenizer(prompt, return_tensors='pt', padding=True, max_length=512).to(device)

liangtongt avatar Sep 20 '23 12:09 liangtongt