Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -59,10 +59,10 @@ model = DistillBERTClass()
|
|
59 |
LEARNING_RATE = 1e-05
|
60 |
|
61 |
optimizer = torch.optim.Adam(params = model.parameters(), lr=LEARNING_RATE)
|
62 |
-
|
63 |
-
model.load_state_dict(checkpoint['model'])
|
64 |
-
optimizer.load_state_dict(checkpoint['opt'])
|
65 |
-
model.to("cpu")
|
66 |
|
67 |
# print(model)
|
68 |
# model = DistilBertForSequenceClassification.from_pretrained("model/distilbert-model1.pt", local_files_only=True)
|
|
|
59 |
LEARNING_RATE = 1e-05
|
60 |
|
61 |
optimizer = torch.optim.Adam(params = model.parameters(), lr=LEARNING_RATE)
|
62 |
+
model = torch.load("pytorch_distilbert_news.bin", map_location=torch.device('cpu'))
|
63 |
+
# model.load_state_dict(checkpoint['model'])
|
64 |
+
# optimizer.load_state_dict(checkpoint['opt'])
|
65 |
+
# model.to("cpu")
|
66 |
|
67 |
# print(model)
|
68 |
# model = DistilBertForSequenceClassification.from_pretrained("model/distilbert-model1.pt", local_files_only=True)
|