Spaces:
Sleeping
Sleeping
cpu torch
Browse files
app.py
CHANGED
@@ -25,13 +25,13 @@ with open('family_labels.pkl', 'rb') as filefam:
|
|
25 |
|
26 |
tokenizerfam = AutoTokenizer.from_pretrained("facebook/esm2_t12_35M_UR50D") #facebook/esm2_t33_650M_UR50D
|
27 |
|
28 |
-
device = '
|
29 |
device
|
30 |
|
31 |
modelfam = EsmForSequenceClassification.from_pretrained("facebook/esm2_t12_35M_UR50D", num_labels=len(yfam.classes_))
|
32 |
modelfam = modelfam.to('cpu')
|
33 |
|
34 |
-
modelfam.load_state_dict(torch.load("family.pth"))
|
35 |
modelfam.eval()
|
36 |
|
37 |
x_testfam = ["""MAEVLRTLAGKPKCHALRPMILFLIMLVLVLFGYGVLSPRSLMPGSLERGFCMAVREPDH
|
|
|
25 |
|
26 |
tokenizerfam = AutoTokenizer.from_pretrained("facebook/esm2_t12_35M_UR50D") #facebook/esm2_t33_650M_UR50D
|
27 |
|
28 |
+
device = 'cpu'
|
29 |
device
|
30 |
|
31 |
modelfam = EsmForSequenceClassification.from_pretrained("facebook/esm2_t12_35M_UR50D", num_labels=len(yfam.classes_))
|
32 |
modelfam = modelfam.to('cpu')
|
33 |
|
34 |
+
modelfam.load_state_dict(torch.load("family.pth", map_location=torch.device('cpu')))
|
35 |
modelfam.eval()
|
36 |
|
37 |
x_testfam = ["""MAEVLRTLAGKPKCHALRPMILFLIMLVLVLFGYGVLSPRSLMPGSLERGFCMAVREPDH
|