Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,11 +11,12 @@ def extract_tables(pdf_file):
|
|
11 |
try:
|
12 |
tables = camelot.read_pdf(pdf_file.name, pages="all")
|
13 |
df = pd.concat([table.df for table in tables], ignore_index=True)
|
14 |
-
return df
|
15 |
-
except OSError
|
16 |
install_ghostscript()
|
17 |
-
return
|
18 |
|
|
|
19 |
demo = gr.Interface(
|
20 |
fn=extract_tables,
|
21 |
inputs=gr.File(label="Upload PDF"),
|
|
|
11 |
try:
|
12 |
tables = camelot.read_pdf(pdf_file.name, pages="all")
|
13 |
df = pd.concat([table.df for table in tables], ignore_index=True)
|
14 |
+
return df, "Ready"
|
15 |
+
except OSError:
|
16 |
install_ghostscript()
|
17 |
+
return None, "Ghostscript installed. Please retry."
|
18 |
|
19 |
+
## Gradio Interface
|
20 |
demo = gr.Interface(
|
21 |
fn=extract_tables,
|
22 |
inputs=gr.File(label="Upload PDF"),
|