rendy-ad89 commited on
Commit
0476014
·
1 Parent(s): ef4aecc

map location cpu

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -25,7 +25,7 @@ model = BertForSequenceClassification.from_pretrained(model_name,
25
  output_attentions=False,
26
  output_hidden_states=False)
27
 
28
- torch_model = torch.load('FineTune_IndoLEM_BERT_H_Mean_Pooling_LR1E-5_BS2_epoch_9.model')
29
  torch_model['classifier.weight'] = torch_model.pop('out.weight')
30
  torch_model['classifier.bias'] = torch_model.pop('out.bias')
31
  model.load_state_dict(torch_model)
 
25
  output_attentions=False,
26
  output_hidden_states=False)
27
 
28
+ torch_model = torch.load('FineTune_IndoLEM_BERT_H_Mean_Pooling_LR1E-5_BS2_epoch_9.model', map_location=torch.device('cpu'))
29
  torch_model['classifier.weight'] = torch_model.pop('out.weight')
30
  torch_model['classifier.bias'] = torch_model.pop('out.bias')
31
  model.load_state_dict(torch_model)