Spaces:
Runtime error
Runtime error
Commit
·
4e2f6bd
1
Parent(s):
713d064
Update app.py
Browse files
app.py
CHANGED
@@ -37,6 +37,7 @@ model1 = torch.load("model1.pt", map_location=torch.device('cpu'))
|
|
37 |
model2 = torch.load("model2.pt", map_location=torch.device('cpu'))
|
38 |
model3 = torch.load("model3.pt", map_location=torch.device('cpu'))
|
39 |
model4 = torch.load("model4.pt", map_location=torch.device('cpu'))
|
|
|
40 |
|
41 |
def fn(glycan, model):
|
42 |
# Draw graph
|
@@ -61,6 +62,9 @@ def fn(glycan, model):
|
|
61 |
elif model == "Bootstrap Ensemble":
|
62 |
model_pred = model4
|
63 |
model_pred.eval()
|
|
|
|
|
|
|
64 |
else:
|
65 |
model_pred = model2
|
66 |
model_pred.eval()
|
@@ -89,7 +93,7 @@ def fn(glycan, model):
|
|
89 |
|
90 |
demo = gr.Interface(
|
91 |
fn=fn,
|
92 |
-
inputs=[gr.Textbox(label="Glycan sequence", value="Man(a1-2)Man(a1-3)[Man(a1-3)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc"), gr.Radio(label="Model",choices=["No data augmentation", "Random node deletion", "Ensemble", "Bootstrap Ensemble"])],
|
93 |
outputs=[gr.Label(num_top_classes=15, label="Prediction"), gr.Image(label="Glycan graph")],
|
94 |
allow_flagging="never",
|
95 |
title="SweetNet demo",
|
|
|
37 |
model2 = torch.load("model2.pt", map_location=torch.device('cpu'))
|
38 |
model3 = torch.load("model3.pt", map_location=torch.device('cpu'))
|
39 |
model4 = torch.load("model4.pt", map_location=torch.device('cpu'))
|
40 |
+
model5 = torch.load("model5.pt", map_location=torch.device('cpu'))
|
41 |
|
42 |
def fn(glycan, model):
|
43 |
# Draw graph
|
|
|
62 |
elif model == "Bootstrap Ensemble":
|
63 |
model_pred = model4
|
64 |
model_pred.eval()
|
65 |
+
elif model == "Random edge deletion":
|
66 |
+
mode_pred = model5
|
67 |
+
model_pred.eval()
|
68 |
else:
|
69 |
model_pred = model2
|
70 |
model_pred.eval()
|
|
|
93 |
|
94 |
demo = gr.Interface(
|
95 |
fn=fn,
|
96 |
+
inputs=[gr.Textbox(label="Glycan sequence", value="Man(a1-2)Man(a1-3)[Man(a1-3)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc"), gr.Radio(label="Model",choices=["No data augmentation", "Random node deletion", "Random edge deletion", "Ensemble", "Bootstrap Ensemble"])],
|
97 |
outputs=[gr.Label(num_top_classes=15, label="Prediction"), gr.Image(label="Glycan graph")],
|
98 |
allow_flagging="never",
|
99 |
title="SweetNet demo",
|