AntonyManojXavier commited on
Commit
fc3c2fb
·
verified ·
1 Parent(s): e18ac27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -14
app.py CHANGED
@@ -1,22 +1,23 @@
1
  import gradio as gr
2
  from processing import process_file
3
- from models import ModifiedGCN # Ensure the model class is imported
4
 
5
  def process_file_wrapper(file):
6
  status, file = process_file(file)
7
  return status, file
8
 
9
- with gr.Blocks() as demo:
10
- gr.Markdown(
11
- """
12
- # File Processor
13
- Upload a file and click 'Process' to see the status and download the file.
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
- process_button.click(process_file_wrapper, inputs=file_input, outputs=[status_output, file_output])
20
 
21
- if __name__ == "__main__":
22
- demo.launch(share=True)
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
  from processing import process_file
3
+ from models import ModifiedGCN
4
 
5
  def process_file_wrapper(file):
6
  status, file = process_file(file)
7
  return status, file
8
 
9
+ def upload_file(file):
10
+ if file is None:
11
+ return "No file uploaded.", None
12
+ status, processed_file = process_file_wrapper(file)
13
+ return status, processed_file
 
 
 
 
 
 
14
 
15
+ # Create a Gradio Interface
16
+ iface = gr.Interface(
17
+ fn=upload_file,
18
+ inputs=gr.File(label="Upload your file"),
19
+ outputs=[gr.Textbox(label="Status"), gr.File(label="Download the file")]
20
+ )
21
+
22
+ # Launch the Gradio Interface
23
+ iface.launch(share=True)