arikat commited on
Commit
a5ded1f
1 Parent(s): feb7c28
Files changed (1) hide show
  1. app.py +2 -2
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 = 'cuda' if torch.cuda.is_available() else '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"))
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