Spaces:
Runtime error
Runtime error
JosephAlexander
commited on
Commit
•
b1fd553
1
Parent(s):
030608c
Update app.py
Browse files
app.py
CHANGED
@@ -23,12 +23,12 @@ model_name = 'distilbert-base-cased'
|
|
23 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
24 |
|
25 |
@st.cache(suppress_st_warning=True)
|
26 |
-
def LoadModel(
|
27 |
revived = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels=len(terms_list)).to(device)
|
28 |
-
revived.load_state_dict(torch.load(model_path, map_location=torch.device(device)))
|
29 |
return revived
|
30 |
|
31 |
-
revived = LoadModel(
|
|
|
32 |
|
33 |
from torch import nn
|
34 |
from transformers import Trainer, TrainingArguments
|
|
|
23 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
24 |
|
25 |
@st.cache(suppress_st_warning=True)
|
26 |
+
def LoadModel():
|
27 |
revived = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels=len(terms_list)).to(device)
|
|
|
28 |
return revived
|
29 |
|
30 |
+
revived = LoadModel()
|
31 |
+
revived.load_state_dict(torch.load(model_path, map_location=torch.device(device)))
|
32 |
|
33 |
from torch import nn
|
34 |
from transformers import Trainer, TrainingArguments
|