Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import torch
|
|
2 |
from transformers import BertForSequenceClassification
|
3 |
|
4 |
# Load your BERT model
|
5 |
-
model = BertForSequenceClassification.from_pretrained('bert-base-uncased')
|
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
|
|
|
2 |
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
|