Vishu26 commited on
Commit
e3de1e6
·
1 Parent(s): dfcabe0
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -92,7 +92,7 @@ def text_fn(taxon, name):
92
  text_embeds = torch.tensor(text_embeds)
93
  preds = model(text_embeds).sigmoid().unsqueeze(0).unsqueeze(0).detach().numpy()
94
  #return gr.Image(preds, label="Predicted Heatmap", visible=True)
95
- return taxon + ": " + name + ": " + str(np.mean(preds))
96
 
97
  def pred_fn(taxon, name):
98
  if taxon=="Class":
@@ -128,9 +128,9 @@ with gr.Blocks() as demo:
128
  submit_button = gr.Button("Run Model")
129
 
130
  with gr.Row():
131
- pred = gr.Image(label="Predicted Heatmap", visible=False)
132
 
133
- check_button.click(text_fn, inputs=[inp, out], outputs=[text])
134
- submit_button.click(pred_fn, inputs=[inp, out], outputs=[pred])
135
 
136
  demo.launch()
 
92
  text_embeds = torch.tensor(text_embeds)
93
  preds = model(text_embeds).sigmoid().unsqueeze(0).unsqueeze(0).detach().numpy()
94
  #return gr.Image(preds, label="Predicted Heatmap", visible=True)
95
+ return taxon + ": " + name + ": " + str(np.mean(preds)), preds
96
 
97
  def pred_fn(taxon, name):
98
  if taxon=="Class":
 
128
  submit_button = gr.Button("Run Model")
129
 
130
  with gr.Row():
131
+ pred = gr.Image(label="Predicted Heatmap", visible=True)
132
 
133
+ check_button.click(text_fn, inputs=[inp, out], outputs=[text, pred])
134
+ #submit_button.click(pred_fn, inputs=[inp, out], outputs=[pred])
135
 
136
  demo.launch()