Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -290,13 +290,16 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
290 |
diversity_slider = gr.Slider(0, 100, value=25, step=1, label="Diversity")
|
291 |
|
292 |
submit_button = gr.Button("Submit")
|
293 |
-
output_textbox = gr.Textbox(label="Output", interactive=False)
|
294 |
download_button = gr.File(label="Download Processed File", visible=False)
|
295 |
|
296 |
def on_submit(llm, file, relevance, diversity):
|
297 |
result, output_file = process_inputs(llm, file, relevance, diversity)
|
298 |
-
|
299 |
-
|
|
|
|
|
|
|
|
|
300 |
|
301 |
# Launch the Gradio app
|
302 |
demo.launch()
|
|
|
290 |
diversity_slider = gr.Slider(0, 100, value=25, step=1, label="Diversity")
|
291 |
|
292 |
submit_button = gr.Button("Submit")
|
|
|
293 |
download_button = gr.File(label="Download Processed File", visible=False)
|
294 |
|
295 |
def on_submit(llm, file, relevance, diversity):
|
296 |
result, output_file = process_inputs(llm, file, relevance, diversity)
|
297 |
+
if output_file:
|
298 |
+
return gr.File.update(value=output_file, visible=True)
|
299 |
+
else:
|
300 |
+
return gr.File.update(visible=False)
|
301 |
+
|
302 |
+
submit_button.click(fn=on_submit, inputs=[llm_dropdown, file_upload, relevance_slider, diversity_slider], outputs=download_button)
|
303 |
|
304 |
# Launch the Gradio app
|
305 |
demo.launch()
|