oucgc1996 commited on
Commit
1a8df8b
1 Parent(s): 814fc4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -48,7 +48,7 @@ class MyModel(nn.Module):
48
  return torch.softmax(output_feature,dim=1)
49
 
50
  model = MyModel()
51
- model.load_state_dict(torch.load("best_model.pth"))
52
  model = model.to(device)
53
  model.eval()
54
 
@@ -70,7 +70,7 @@ def conotoxinfinder(files):
70
  fr=open(files, 'r')
71
  seqs = []
72
  for line in fr:
73
- if not line.startswith('>'): #判断字符串是否以‘>开始’
74
  seqs.append(line)
75
  seq_all = []
76
  output_all = []
 
48
  return torch.softmax(output_feature,dim=1)
49
 
50
  model = MyModel()
51
+ model.load_state_dict(torch.load("best_model.pth", map_location=torch.device('cpu')))
52
  model = model.to(device)
53
  model.eval()
54
 
 
70
  fr=open(files, 'r')
71
  seqs = []
72
  for line in fr:
73
+ if not line.startswith('>'):
74
  seqs.append(line)
75
  seq_all = []
76
  output_all = []