Andrey Moskalenko
commited on
Commit
•
782dfba
1
Parent(s):
73ead6d
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ def get_models_and_tokenizers():
|
|
22 |
model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels=2)
|
23 |
model.eval()
|
24 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
25 |
-
model.load_state_dict(torch.load('./model.pth'))
|
26 |
|
27 |
model_name_translator = "facebook/wmt19-ru-en"
|
28 |
tokenizer_translator = FSMTTokenizer.from_pretrained(model_name_translator)
|
|
|
22 |
model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels=2)
|
23 |
model.eval()
|
24 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
25 |
+
model.load_state_dict(torch.load('./model.pth', map_location='cpu'))
|
26 |
|
27 |
model_name_translator = "facebook/wmt19-ru-en"
|
28 |
tokenizer_translator = FSMTTokenizer.from_pretrained(model_name_translator)
|