Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -23,8 +23,7 @@ tokenizer = joblib.load("tokenizer.joblib") # used for LSTM
|
|
23 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
24 |
tokenizer1 = DistilBertTokenizer.from_pretrained("tokenizer_bert")
|
25 |
model = DistilBertForSequenceClassification.from_pretrained('distilbert-base-uncased', num_labels=5)
|
26 |
-
model.load_state_dict(torch.load("fine_tuned_bert_model1.pth", map_location=
|
27 |
-
model = model.to('gpu')
|
28 |
|
29 |
# Decode label function
|
30 |
# {'business': 0, 'entertainment': 1, 'health': 2, 'politics': 3, 'sport': 4}
|
|
|
23 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
24 |
tokenizer1 = DistilBertTokenizer.from_pretrained("tokenizer_bert")
|
25 |
model = DistilBertForSequenceClassification.from_pretrained('distilbert-base-uncased', num_labels=5)
|
26 |
+
model.load_state_dict(torch.load("fine_tuned_bert_model1.pth", map_location=device))
|
|
|
27 |
|
28 |
# Decode label function
|
29 |
# {'business': 0, 'entertainment': 1, 'health': 2, 'politics': 3, 'sport': 4}
|