Keetawan commited on
Commit
ee188e2
1 Parent(s): c0d0a2f

fix: load state dict

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -5,7 +5,8 @@ from model import SentimentAnalysisModel
5
 
6
  # Load the pre-trained sentiment analysis model
7
  model = SentimentAnalysisModel(bert_model_name="SamLowe/roberta-base-go_emotions", num_labels=7)
8
- model.load_state_dict(torch.load("best_model_75.pth", map_location=torch.device('cpu')))
 
9
  model.eval()
10
 
11
  # Mapping from predicted class to emoji
 
5
 
6
  # Load the pre-trained sentiment analysis model
7
  model = SentimentAnalysisModel(bert_model_name="SamLowe/roberta-base-go_emotions", num_labels=7)
8
+ model.load_state_dict(torch.load("best_model_75.pth", map_location=torch.device('cpu')), strict=False)
9
+
10
  model.eval()
11
 
12
  # Mapping from predicted class to emoji