Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|