wfranco commited on
Commit
787a70a
·
1 Parent(s): 6a9aef5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -3
app.py CHANGED
@@ -1,7 +1,18 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "."
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  iface.launch()
 
1
  import gradio as gr
2
 
3
+ def read_pdf(file_obj):
4
+ # Here, file_obj is a file object that Gradio passes to the function.
5
+ # You can read this file object using a PDF reading library, such as PyPDF2 or pdfplumber.
6
+ # For illustration, replace the following line with your own PDF processing logic.
7
+ text = "Processed PDF content here"
8
+ return text
9
+
10
+ iface = gr.Interface(
11
+ fn=read_pdf,
12
+ inputs=gr.inputs.File(type="file", label="Upload PDF"),
13
+ outputs="text",
14
+ title="PDF Processor",
15
+ description="Upload a PDF file to process."
16
+ )
17
 
 
18
  iface.launch()