okewunmi commited on
Commit
97ddcb4
·
verified ·
1 Parent(s): 06593a1

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import pdfminer
3
+ from pdfminer.high_level import extract_text
4
+
5
+ def read_pdf(file):
6
+ if file is None:
7
+ return "No file uploaded"
8
+ text = extract_text(file.name)
9
+ return text
10
+
11
+ iface = gr.Interface(
12
+ fn=read_pdf,
13
+ inputs=gr.File(label="Upload PDF file"),
14
+ outputs=gr.Textbox(label="Extracted Text")
15
+ )
16
+
17
+ if __name__ == "__main__":
18
+ iface.launch()