File size: 657 Bytes
796edc7
 
 
4d68ad0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gradio as gr
from processing import process_file

def process_file_wrapper(file):
    status, file = process_file(file)
    return status, file

with gr.Blocks() as demo:
    gr.Markdown(
    """
    # File Processor
    Upload a file and click 'Process' to see the status and download the file.
    """)

    file_input = gr.File(label="Upload your file")
    status_output = gr.Textbox(label="Status")
    file_output = gr.File(label="Download the file")
    process_button = gr.Button("Process")

    process_button.click(process_file_wrapper, inputs=file_input, outputs=[status_output, file_output])

if __name__ == "__main__":
    demo.launch()