Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,10 +16,10 @@ tokenizer = BertTokenizer.from_pretrained('bert-base-uncased',
|
|
| 16 |
do_lower_case=True)
|
| 17 |
# Create BERT model
|
| 18 |
model = BertForSequenceClassification.from_pretrained("bert-base-uncased",
|
| 19 |
-
num_labels=
|
| 20 |
output_attentions=False,
|
| 21 |
output_hidden_states=False)
|
| 22 |
-
model.load_state_dict(torch.load('
|
| 23 |
### 3. Predict function ###
|
| 24 |
|
| 25 |
# Create predict function
|
|
|
|
| 16 |
do_lower_case=True)
|
| 17 |
# Create BERT model
|
| 18 |
model = BertForSequenceClassification.from_pretrained("bert-base-uncased",
|
| 19 |
+
num_labels=2,
|
| 20 |
output_attentions=False,
|
| 21 |
output_hidden_states=False)
|
| 22 |
+
model.load_state_dict(torch.load(f='finetuned_BERT_epoch_10.model', map_location=torch.device('cpu')))
|
| 23 |
### 3. Predict function ###
|
| 24 |
|
| 25 |
# Create predict function
|