Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
-
import
|
3 |
|
4 |
-
def
|
5 |
-
|
6 |
-
|
7 |
-
text = ''
|
8 |
-
for page in range(pdf_reader.numPages):
|
9 |
-
text += pdf_reader.getPage(page).extractText()
|
10 |
return text
|
11 |
|
12 |
-
iface = gr.Interface(
|
|
|
|
|
|
|
|
|
13 |
iface.launch()
|
14 |
-
|
|
|
1 |
import gradio as gr
|
2 |
+
import pdfminer
|
3 |
|
4 |
+
def read_pdf(file)
|
5 |
+
from pdfminer.high_level import extract_text
|
6 |
+
text = extract_text(file.name)
|
|
|
|
|
|
|
7 |
return text
|
8 |
|
9 |
+
iface = gr.Interface(
|
10 |
+
read_pdf,
|
11 |
+
gr.inputs.FileUpload(is_single=True, allow_pdf=True),
|
12 |
+
gr.outputs.Textbox()
|
13 |
+
)
|
14 |
iface.launch()
|
|