Commit
·
fe4bdc6
1
Parent(s):
ebeddd5
Update app.py
Browse files
app.py
CHANGED
@@ -20,9 +20,10 @@ def load_model():
|
|
20 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
21 |
|
22 |
# assert torch.cuda.is_available()
|
23 |
-
|
|
|
24 |
model = AutoModelForSequenceClassification.from_pretrained(
|
25 |
-
|
26 |
).to(device)
|
27 |
|
28 |
return tokenizer, model
|
|
|
20 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
21 |
|
22 |
# assert torch.cuda.is_available()
|
23 |
+
save_dir = "./distilbert/distilbert-base-cased/checkpoint-738"
|
24 |
+
tokenizer = AutoTokenizer.from_pretrained(save_dir)
|
25 |
model = AutoModelForSequenceClassification.from_pretrained(
|
26 |
+
save_dir
|
27 |
).to(device)
|
28 |
|
29 |
return tokenizer, model
|