Open athack opened 2 years ago
I am having the same issue. Is there a fix for this?
You need to add use_gpu
argument in predict
function, then add the same code block as in load_model
to set self.device
attribute properly. @Shivanandroy
Or Simply call `` import torch
model.device= torch.device("cpu") ``
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user/.virtualenvs/t5/lib/python3.8/site-packages/simplet5/simplet5.py", line 442, in predict input_ids = input_ids.to(self.device) AttributeError: 'SimpleT5' object has no attribute 'device'
Did you 'load_model' before 'predict'?
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user/.virtualenvs/t5/lib/python3.8/site-packages/simplet5/simplet5.py", line 442, in predict input_ids = input_ids.to(self.device) AttributeError: 'SimpleT5' object has no attribute 'device'