Xaot6 commited on
Commit
4d68ad0
1 Parent(s): c10b214

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -8
app.py CHANGED
@@ -1,11 +1,23 @@
1
  import gradio as gr
2
  from processing import process_file
3
 
4
- iface = gr.Interface(
5
- fn=process_file,
6
- inputs=gr.File(label="Upload your file"),
7
- outputs=[gr.Textbox(label="Status"), gr.File(label="Download the file")],
8
- live=False
9
- )
10
-
11
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
  from processing import process_file
3
 
4
+ def process_file_wrapper(file):
5
+ status, file = process_file(file)
6
+ return status, file
7
+
8
+ with gr.Blocks() as demo:
9
+ gr.Markdown(
10
+ """
11
+ # File Processor
12
+ Upload a file and click 'Process' to see the status and download the file.
13
+ """)
14
+
15
+ file_input = gr.File(label="Upload your file")
16
+ status_output = gr.Textbox(label="Status")
17
+ file_output = gr.File(label="Download the file")
18
+ process_button = gr.Button("Process")
19
+
20
+ process_button.click(process_file_wrapper, inputs=file_input, outputs=[status_output, file_output])
21
+
22
+ if __name__ == "__main__":
23
+ demo.launch()