Daeyongkwon98
commited on
Commit
•
4811d2a
1
Parent(s):
dbe00b2
load model to cpu
Browse files
app.py
CHANGED
@@ -44,7 +44,7 @@ def classify(sentence):
|
|
44 |
num_intents = num_intents_dict[data_type]
|
45 |
|
46 |
model = DistilBERTClass(num_intents)
|
47 |
-
model.load_state_dict(torch.load(f"./models/{data_type}_finetune_model.pth"))
|
48 |
model.to(device)
|
49 |
|
50 |
# Tokenize the input sentence
|
|
|
44 |
num_intents = num_intents_dict[data_type]
|
45 |
|
46 |
model = DistilBERTClass(num_intents)
|
47 |
+
model.load_state_dict(torch.load(f"./models/{data_type}_finetune_model.pth", map_location=torch.device('cpu')))
|
48 |
model.to(device)
|
49 |
|
50 |
# Tokenize the input sentence
|