dalexanderch commited on
Commit
be08073
1 Parent(s): 9e05631

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -76,13 +76,13 @@ def fn(glycan, model):
76
  pred = np.exp(pred)/sum(np.exp(pred)) # Softmax
77
  pred = [float(x) for x in pred]
78
  pred = {class_list[i]:pred[i] for i in range(15)}
79
- return "graph.png", pred
80
 
81
 
82
  demo = gr.Interface(
83
  fn=fn,
84
  inputs=[gr.Textbox(label="Glycan sequence"), gr.Radio(label="Model",choices=["No data augmentation", "Random node deletion", "Ensemble"])],
85
- outputs=[gr.Image(label="Glycan graph"), gr.Label(num_top_classes=15, label="Prediction")],
86
  allow_flagging=False,
87
  title="SweetNet demo",
88
  examples=[["GlcOSN(a1-4)GlcA(b1-4)GlcOSN(a1-4)GlcAOS(b1-4)GlcOSN(a1-4)GlcOSN", "No data augmentation"],
 
76
  pred = np.exp(pred)/sum(np.exp(pred)) # Softmax
77
  pred = [float(x) for x in pred]
78
  pred = {class_list[i]:pred[i] for i in range(15)}
79
+ return pred, "graph.png"
80
 
81
 
82
  demo = gr.Interface(
83
  fn=fn,
84
  inputs=[gr.Textbox(label="Glycan sequence"), gr.Radio(label="Model",choices=["No data augmentation", "Random node deletion", "Ensemble"])],
85
+ outputs=[gr.Label(num_top_classes=15, label="Prediction"), gr.Image(label="Glycan graph")],
86
  allow_flagging=False,
87
  title="SweetNet demo",
88
  examples=[["GlcOSN(a1-4)GlcA(b1-4)GlcOSN(a1-4)GlcAOS(b1-4)GlcOSN(a1-4)GlcOSN", "No data augmentation"],