Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -20,6 +20,7 @@ svm_model = joblib.load('svm_model.joblib')
|
|
20 |
vectorizer = joblib.load("vectorizer.joblib") # global vocabulary (used for Logistic, SVC)
|
21 |
tokenizer = joblib.load("tokenizer.joblib") # used for LSTM
|
22 |
|
|
|
23 |
tokenizer1 = DistilBertTokenizer.from_pretrained("tokenizer_bert")
|
24 |
model = DistilBertForSequenceClassification.from_pretrained('distilbert-base-uncased', num_labels=5)
|
25 |
model.load_state_dict(torch.load("fine_tuned_bert_model1.pth", map_location=torch.device('gpu')))
|
|
|
20 |
vectorizer = joblib.load("vectorizer.joblib") # global vocabulary (used for Logistic, SVC)
|
21 |
tokenizer = joblib.load("tokenizer.joblib") # used for LSTM
|
22 |
|
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=torch.device('gpu')))
|