Text Classification
PyTorch
Safetensors
English
eurovoc
Inference Endpoints
scampion commited on
Commit
fb25b96
1 Parent(s): 436475c

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +1 -0
handler.py CHANGED
@@ -69,6 +69,7 @@ class EndpointHandler:
69
  truncation=True,
70
  return_attention_mask=True,
71
  return_tensors='pt')
 
72
  _, prediction = self.model(item["input_ids"], item["attention_mask"])
73
  prediction = prediction.cpu().detach().numpy()
74
  print(text, prediction)
 
69
  truncation=True,
70
  return_attention_mask=True,
71
  return_tensors='pt')
72
+ item.to(self.device)
73
  _, prediction = self.model(item["input_ids"], item["attention_mask"])
74
  prediction = prediction.cpu().detach().numpy()
75
  print(text, prediction)