Spaces:
Running
on
Zero
Running
on
Zero
Mohamed Rashad
commited on
Commit
·
d4f1119
1
Parent(s):
92871c6
feat: Add gradio_pdf library for PDF handling and processing
Browse files- app.py +2 -1
- requirements.txt +2 -1
app.py
CHANGED
@@ -9,6 +9,7 @@ from pathlib import Path
|
|
9 |
from pdf2image import convert_from_path
|
10 |
import spaces
|
11 |
from threading import Thread
|
|
|
12 |
|
13 |
models_supported = {
|
14 |
"arabic-small-nougat": [
|
@@ -152,7 +153,7 @@ with gr.Blocks(title="Arabic Nougat") as demo:
|
|
152 |
with gr.Tab("Extract Text from PDF"):
|
153 |
with gr.Row():
|
154 |
with gr.Column():
|
155 |
-
pdf =
|
156 |
model_dropdown = gr.Dropdown(
|
157 |
label="Model", choices=list(models_supported.keys()), value=None
|
158 |
)
|
|
|
9 |
from pdf2image import convert_from_path
|
10 |
import spaces
|
11 |
from threading import Thread
|
12 |
+
from gradio_pdf import PDF
|
13 |
|
14 |
models_supported = {
|
15 |
"arabic-small-nougat": [
|
|
|
153 |
with gr.Tab("Extract Text from PDF"):
|
154 |
with gr.Row():
|
155 |
with gr.Column():
|
156 |
+
pdf = PDF(label="Input PDF")
|
157 |
model_dropdown = gr.Dropdown(
|
158 |
label="Model", choices=list(models_supported.keys()), value=None
|
159 |
)
|
requirements.txt
CHANGED
@@ -5,4 +5,5 @@ spaces
|
|
5 |
python-Levenshtein
|
6 |
pillow
|
7 |
pathlib
|
8 |
-
nltk
|
|
|
|
5 |
python-Levenshtein
|
6 |
pillow
|
7 |
pathlib
|
8 |
+
nltk
|
9 |
+
gradio_pdf
|