ynp3 commited on
Commit
142da08
·
1 Parent(s): 8a32999

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -6,7 +6,7 @@ from transformers import BertTokenizer, BertForSequenceClassification
6
  # Load pre-trained BERT model and tokenizer
7
  tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
8
  model = BertForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=6)
9
- model.load_state_dict(torch.load('/path/to/pretrained_model.pth', map_location=torch.device('cpu'))) # Replace with the correct path to your pre-trained model weights file
10
  model.eval()
11
 
12
  # Define function for classification
 
6
  # Load pre-trained BERT model and tokenizer
7
  tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
8
  model = BertForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=6)
9
+ model.load_state_dict(torch.load('/path/to/model.pt', map_location=torch.device('cpu'))) # Replace with the correct path to your pre-trained model weights file
10
  model.eval()
11
 
12
  # Define function for classification