oucgc1996 commited on
Commit
81be004
Β·
verified Β·
1 Parent(s): 6332cc7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -142,8 +142,8 @@ def CTXGen(X1, X2, Ο„, g_num, length_range, model_name):
142
  })
143
  out.to_csv("output.csv", index=False, encoding='utf-8-sig')
144
  count += 1
145
- yield out, "output.csv"
146
- return out, "output.csv"
147
 
148
  with gr.Blocks() as demo:
149
  gr.Markdown("πŸ”— **[Label Prediction](https://huggingface.co/spaces/oucgc1996/CTXGen_Label_Prediction)**")
@@ -173,12 +173,12 @@ with gr.Blocks() as demo:
173
  with gr.Row():
174
  start_button = gr.Button("Start Generation")
175
  stop_button = gr.Button("Stop Generation")
176
- with gr.Row():
177
- output_df = gr.DataFrame(label="Generated Conotoxins")
178
  with gr.Row():
179
  output_file = gr.File(label="Download generated conotoxins")
 
 
180
 
181
- start_button.click(CTXGen, inputs=[X1, X2, Ο„, g_num, length_range,model_name], outputs=[output_df, output_file])
182
  stop_button.click(stop_generation, outputs=None)
183
 
184
  demo.launch()
 
142
  })
143
  out.to_csv("output.csv", index=False, encoding='utf-8-sig')
144
  count += 1
145
+ yield "output.csv", out
146
+ return "output.csv", out
147
 
148
  with gr.Blocks() as demo:
149
  gr.Markdown("πŸ”— **[Label Prediction](https://huggingface.co/spaces/oucgc1996/CTXGen_Label_Prediction)**")
 
173
  with gr.Row():
174
  start_button = gr.Button("Start Generation")
175
  stop_button = gr.Button("Stop Generation")
 
 
176
  with gr.Row():
177
  output_file = gr.File(label="Download generated conotoxins")
178
+ with gr.Row():
179
+ output_df = gr.DataFrame(label="Generated Conotoxins")
180
 
181
+ start_button.click(CTXGen, inputs=[X1, X2, Ο„, g_num, length_range,model_name], outputs=[output_file, output_df])
182
  stop_button.click(stop_generation, outputs=None)
183
 
184
  demo.launch()