arikat commited on
Commit
5371b1f
β€’
1 Parent(s): 165eb5f

new family model

Browse files
Files changed (3) hide show
  1. app.py +3 -3
  2. model_650M.pth β†’ family.pth +2 -2
  3. 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/esm2_t33_650M_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_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
 
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:36a565e96eefc30f1809be4afcba0bed656fc81ed6d34d78cb58bafc9f1d7c4d
3
- size 2610018370
 
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:9a22d6c50aaaffe9306de56cf40283a2b74107bed475de9674ac279ae1c44446
3
- size 20257
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3e8fe9ddb883008ab377fba3837200626ee609fbe892950b1fada9ff078eca4
3
+ size 4559