Spaces:
Running
Running
ThanaritKanjanametawat
commited on
Commit
·
1fb6014
1
Parent(s):
dd9c120
Move everything to CPU 2
Browse files- ModelDriver.py +2 -2
ModelDriver.py
CHANGED
@@ -62,7 +62,7 @@ def RobertaClassifierOpenGPTInference(input_text):
|
|
62 |
tokenizer = RobertaTokenizer.from_pretrained("roberta-base")
|
63 |
model_path = "ClassifierCheckpoint/RobertaClassifierOpenGPT.pth"
|
64 |
model = RobertaForSequenceClassification.from_pretrained('roberta-base', num_labels=2)
|
65 |
-
model.load_state_dict(torch.load(model_path
|
66 |
model = model.to(torch.device('cpu'))
|
67 |
model.eval()
|
68 |
|
@@ -84,7 +84,7 @@ def RobertaClassifierCSAbstractInference(input_text):
|
|
84 |
tokenizer = RobertaTokenizer.from_pretrained("roberta-base")
|
85 |
model_path = "ClassifierCheckpoint/RobertaClassifierCSAbstract.pth"
|
86 |
model = RobertaForSequenceClassification.from_pretrained('roberta-base', num_labels=2)
|
87 |
-
model.load_state_dict(torch.load(model_path
|
88 |
model = model.to(torch.device('cpu'))
|
89 |
model.eval()
|
90 |
|
|
|
62 |
tokenizer = RobertaTokenizer.from_pretrained("roberta-base")
|
63 |
model_path = "ClassifierCheckpoint/RobertaClassifierOpenGPT.pth"
|
64 |
model = RobertaForSequenceClassification.from_pretrained('roberta-base', num_labels=2)
|
65 |
+
model.load_state_dict(torch.load(model_path, map_location=torch.device("cpu")))
|
66 |
model = model.to(torch.device('cpu'))
|
67 |
model.eval()
|
68 |
|
|
|
84 |
tokenizer = RobertaTokenizer.from_pretrained("roberta-base")
|
85 |
model_path = "ClassifierCheckpoint/RobertaClassifierCSAbstract.pth"
|
86 |
model = RobertaForSequenceClassification.from_pretrained('roberta-base', num_labels=2)
|
87 |
+
model.load_state_dict(torch.load(model_path, map_location=torch.device("cpu")))
|
88 |
model = model.to(torch.device('cpu'))
|
89 |
model.eval()
|
90 |
|