Update app.py
Browse files
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
|
| 146 |
-
return
|
| 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=[
|
| 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()
|