Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 = []
|