alinikkhah commited on
Commit
52dcfd7
·
verified ·
1 Parent(s): d289606

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -3,7 +3,7 @@ from transformers import BertForSequenceClassification
3
 
4
  # Load your BERT model
5
  model = BertForSequenceClassification.from_pretrained('bert-base-uncased', num_labels=2)
6
- model.load_state_dict(torch.load('bert_model_complete.pth', map_location=torch.device('cpu')))
7
  model.eval() # Set the model to evaluation mode
8
  import gradio as gr
9
  from transformers import BertTokenizer
 
3
 
4
  # Load your BERT model
5
  model = BertForSequenceClassification.from_pretrained('bert-base-uncased', num_labels=2)
6
+ model.load_state_dict(torch.load('bert_model_complete.pth', map_location=torch.device('cpu'), weights_only=True), strict=False)
7
  model.eval() # Set the model to evaluation mode
8
  import gradio as gr
9
  from transformers import BertTokenizer