Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,16 +24,15 @@ def md_loading():
|
|
24 |
# device = torch.device('cpu')
|
25 |
|
26 |
tokenizer = XLMRobertaTokenizer.from_pretrained('xlm-roberta-large')
|
27 |
-
|
28 |
model = XLMRobertaForSequenceClassification.from_pretrained('xlm-roberta-large', num_labels=493)
|
29 |
|
30 |
model_checkpoint = 'base3_44_ko.bin'
|
31 |
project_path = './'
|
32 |
output_model_file = os.path.join(project_path, model_checkpoint)
|
33 |
|
34 |
-
|
35 |
-
ckpt = torch.load(output_model_file, map_location=torch.device('cpu'))
|
36 |
-
model.load_state_dict(ckpt['model_state_dict'])
|
37 |
|
38 |
# device = torch.device("cuda" if torch.cuda.is_available() and not False else "cpu")
|
39 |
# device = torch.device("cpu")
|
|
|
24 |
# device = torch.device('cpu')
|
25 |
|
26 |
tokenizer = XLMRobertaTokenizer.from_pretrained('xlm-roberta-large')
|
|
|
27 |
model = XLMRobertaForSequenceClassification.from_pretrained('xlm-roberta-large', num_labels=493)
|
28 |
|
29 |
model_checkpoint = 'base3_44_ko.bin'
|
30 |
project_path = './'
|
31 |
output_model_file = os.path.join(project_path, model_checkpoint)
|
32 |
|
33 |
+
model.load_state_dict(torch.load(output_model_file, map_location=torch.device('cpu')))
|
34 |
+
# ckpt = torch.load(output_model_file, map_location=torch.device('cpu'))
|
35 |
+
# model.load_state_dict(ckpt['model_state_dict'])
|
36 |
|
37 |
# device = torch.device("cuda" if torch.cuda.is_available() and not False else "cpu")
|
38 |
# device = torch.device("cpu")
|