fixed model not going to correct device
Browse files- inference.py +1 -0
inference.py
CHANGED
|
@@ -32,6 +32,7 @@ class DistilBERTSent(nn.Module):
|
|
| 32 |
def initialize(path="models/model.pt"):
|
| 33 |
model = DistilBERTSent()
|
| 34 |
model.load_state_dict(torch.load(path, map_location=device))
|
|
|
|
| 35 |
model.eval()
|
| 36 |
return model
|
| 37 |
|
|
|
|
| 32 |
def initialize(path="models/model.pt"):
|
| 33 |
model = DistilBERTSent()
|
| 34 |
model.load_state_dict(torch.load(path, map_location=device))
|
| 35 |
+
model.to(device)
|
| 36 |
model.eval()
|
| 37 |
return model
|
| 38 |
|