neerajkalyank commited on
Commit
5037069
·
verified ·
1 Parent(s): 7d14b2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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 as e:
16
  install_ghostscript()
17
- return gr.update(label="Ghostscript installed. Please retry.")
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"),