Spaces:
Sleeping
Sleeping
new family model
Browse files- app.py +3 -3
- model_650M.pth β family.pth +2 -2
- family_labels.pkl +2 -2
app.py
CHANGED
@@ -23,17 +23,17 @@ import os
|
|
23 |
with open('family_labels.pkl', 'rb') as filefam:
|
24 |
yfam = pickle.load(filefam)
|
25 |
|
26 |
-
tokenizerfam = AutoTokenizer.from_pretrained("facebook/
|
27 |
label_encoderfam = LabelEncoder()
|
28 |
encoded_labelsfam = label_encoderfam.fit_transform(yfam)
|
29 |
labelsfam = torch.tensor(encoded_labelsfam)
|
30 |
device = 'cpu'
|
31 |
device
|
32 |
|
33 |
-
modelfam = EsmForSequenceClassification.from_pretrained("facebook/
|
34 |
modelfam = modelfam.to('cpu')
|
35 |
|
36 |
-
modelfam.load_state_dict(torch.load("
|
37 |
modelfam.eval()
|
38 |
|
39 |
x_testfam = ["""MAEVLRTLAGKPKCHALRPMILFLIMLVLVLFGYGVLSPRSLMPGSLERGFCMAVREPDH
|
|
|
23 |
with open('family_labels.pkl', 'rb') as filefam:
|
24 |
yfam = pickle.load(filefam)
|
25 |
|
26 |
+
tokenizerfam = AutoTokenizer.from_pretrained("facebook/esm2_t12_35M_UR50D") #facebook/esm2_t33_650M_UR50D
|
27 |
label_encoderfam = LabelEncoder()
|
28 |
encoded_labelsfam = label_encoderfam.fit_transform(yfam)
|
29 |
labelsfam = torch.tensor(encoded_labelsfam)
|
30 |
device = 'cpu'
|
31 |
device
|
32 |
|
33 |
+
modelfam = EsmForSequenceClassification.from_pretrained("facebook/esm2_t12_35M_UR50D", num_labels=len(set(labelsfam.tolist())))
|
34 |
modelfam = modelfam.to('cpu')
|
35 |
|
36 |
+
modelfam.load_state_dict(torch.load("family.pth", map_location=torch.device('cpu')))
|
37 |
modelfam.eval()
|
38 |
|
39 |
x_testfam = ["""MAEVLRTLAGKPKCHALRPMILFLIMLVLVLFGYGVLSPRSLMPGSLERGFCMAVREPDH
|
model_650M.pth β family.pth
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:03dcff847ada129cd2889ea3f62071b666b009087829dabf85301210c7fe8382
|
3 |
+
size 136199341
|
family_labels.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c3e8fe9ddb883008ab377fba3837200626ee609fbe892950b1fada9ff078eca4
|
3 |
+
size 4559
|