Spaces:
Runtime error
Runtime error
linjieccc
commited on
Commit
·
cee9c65
1
Parent(s):
71eb0f2
fix pdf
Browse files
app.py
CHANGED
@@ -87,7 +87,10 @@ def process_path(path):
|
|
87 |
error = None
|
88 |
if path:
|
89 |
try:
|
90 |
-
|
|
|
|
|
|
|
91 |
return (
|
92 |
path,
|
93 |
gr.update(visible=True, value=images_list),
|
|
|
87 |
error = None
|
88 |
if path:
|
89 |
try:
|
90 |
+
if path.endswith(".pdf"):
|
91 |
+
images_list = [doc_parser.read_pdf(path)]
|
92 |
+
else:
|
93 |
+
images_list = [doc_parser.read_image(path)]
|
94 |
return (
|
95 |
path,
|
96 |
gr.update(visible=True, value=images_list),
|