Mishmosh commited on
Commit
d76bc23
1 Parent(s): f2f5000

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -7
app.py CHANGED
@@ -1,13 +1,23 @@
1
  import gradio as gr
2
 
 
 
 
 
 
 
 
 
 
3
  # Gradio interface
4
  iface = gr.Interface(
5
- inputs=gr.File(label="Upload PDF", type="file"),
6
- outputs="text",
7
- live=True,
8
- title="PDF Abstract Summarizer",
9
- description="Please upload a PDF that contains an abstract. I will provide a one-sentence summary of the abstract and will say the summary out loud."
 
10
  )
11
 
12
- # Launch the interface
13
- iface.launch()
 
1
  import gradio as gr
2
 
3
+ # Function to process the input message and PDF file
4
+ def process_input(message, pdf_file):
5
+ # Save the uploaded PDF file
6
+ pdf_file.save("uploaded_pdf.pdf")
7
+
8
+ # Process the message and return a result
9
+ result = f"Message: {message}\nPDF file uploaded successfully!"
10
+ return result
11
+
12
  # Gradio interface
13
  iface = gr.Interface(
14
+ fn=process_input,
15
+ inputs=[
16
+ gr.inputs.Textbox(label="Enter your message"),
17
+ gr.inputs.File(label="Upload a PDF file", type="file", accept=".pdf")
18
+ ],
19
+ outputs=gr.outputs.Textbox(label="Result")
20
  )
21
 
22
+ # Launch the Gradio interface
23
+ iface.launch()