Spaces:
Sleeping
Sleeping
minor edits
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ device
|
|
33 |
modelfam = EsmForSequenceClassification.from_pretrained("facebook/esm2_t33_650M_UR50D", num_labels=len(set(labelsfam.tolist())))
|
34 |
modelfam = modelfam.to('cpu')
|
35 |
|
36 |
-
modelfam.load_state_dict(torch.load("model_650M.pth"))
|
37 |
modelfam.eval()
|
38 |
|
39 |
x_testfam = ["""MAEVLRTLAGKPKCHALRPMILFLIMLVLVLFGYGVLSPRSLMPGSLERGFCMAVREPDH
|
@@ -68,13 +68,11 @@ with open('donor_labels.pkl', 'rb') as file:
|
|
68 |
|
69 |
# encoded_labels = label_encoder.fit(y)
|
70 |
# labels = torch.tensor(encoded_labels)
|
71 |
-
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
72 |
-
device
|
73 |
|
74 |
model = EsmForSequenceClassification.from_pretrained("facebook/esm2_t12_35M_UR50D", num_labels=len(label_encoder.classes_))
|
75 |
model = model.to('cpu')
|
76 |
|
77 |
-
model.load_state_dict(torch.load("best_model_35M_t12_5v5.pth")) #model_best_35v2M.pth
|
78 |
model.eval()
|
79 |
|
80 |
x_test = ["""MAEVLRTLAGKPKCHALRPMILFLIMLVLVLFGYGVLSPRSLMPGSLERGFCMAVREPDH
|
|
|
33 |
modelfam = EsmForSequenceClassification.from_pretrained("facebook/esm2_t33_650M_UR50D", num_labels=len(set(labelsfam.tolist())))
|
34 |
modelfam = modelfam.to('cpu')
|
35 |
|
36 |
+
modelfam.load_state_dict(torch.load("model_650M.pth", map_location=torch.device('cpu')))
|
37 |
modelfam.eval()
|
38 |
|
39 |
x_testfam = ["""MAEVLRTLAGKPKCHALRPMILFLIMLVLVLFGYGVLSPRSLMPGSLERGFCMAVREPDH
|
|
|
68 |
|
69 |
# encoded_labels = label_encoder.fit(y)
|
70 |
# labels = torch.tensor(encoded_labels)
|
|
|
|
|
71 |
|
72 |
model = EsmForSequenceClassification.from_pretrained("facebook/esm2_t12_35M_UR50D", num_labels=len(label_encoder.classes_))
|
73 |
model = model.to('cpu')
|
74 |
|
75 |
+
model.load_state_dict(torch.load("best_model_35M_t12_5v5.pth", map_location=torch.device('cpu'))) #model_best_35v2M.pth
|
76 |
model.eval()
|
77 |
|
78 |
x_test = ["""MAEVLRTLAGKPKCHALRPMILFLIMLVLVLFGYGVLSPRSLMPGSLERGFCMAVREPDH
|