Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,23 @@
|
|
1 |
import gradio as gr
|
2 |
from processing import process_file
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|