Update handler.py
Browse files- 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)
|