Mishmosh commited on
Commit
c349cca
1 Parent(s): 8220fc6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -9
app.py CHANGED
@@ -1,12 +1,25 @@
1
  import gradio as gr
2
- input_text="Please upload a PDF file that contains an abstract. You will receive a one sentence summary of the PDF and you can listen to that summary too"
3
- def request_pdf(input_text):
4
- greetings = f"{input_text}"
5
- return
6
-
7
- demo = gr.Interface(
8
- fn=request_pdf,
9
- inputs=["text"]
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  )
11
 
12
- demo.launch()
 
1
  import gradio as gr
2
+
3
+ def process_input(message, pdf_file):
4
+ print("Received Message:", message)
5
+ print("Received PDF File:", pdf_file.name)
6
+
7
+ # Save the received PDF file
8
+ with open("received_pdf.pdf", "wb") as output_file:
9
+ output_file.write(pdf_file.read())
10
+
11
+ return "Processing complete. Check the console for details."
12
+
13
+ iface = gr.Interface(
14
+ fn=process_input,
15
+ inputs=[
16
+ "text",
17
+ gr.File(
18
+ type="pdf",
19
+ label="Please upload a PDF file that contains an abstract. You will receive a one-sentence summary of the PDF and can listen to it.",
20
+ ),
21
+ ],
22
+ outputs="text",
23
  )
24
 
25
+ iface.launch()