vermen commited on
Commit
ca3ccf5
·
verified ·
1 Parent(s): 564d658

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -46,18 +46,18 @@ def create_excel(doc):
46
  data[HEADERS[idx_col]].append(None)
47
  idx_col = idx_col + 1
48
  # SHOW THE RECOVERED DATA
49
- print(data)
50
  df_table = pd.DataFrame.from_dict(data)
51
- return (df_table.to_excel("tabla.xlsx", index=False))
52
 
53
  def upload_file(filepath):
 
54
  name = Path(filepath).name
55
  # load pdf
56
  doc = fitz.open(filepath)
57
- df_table = create_excel(doc)
58
- print(df_table)
59
  # now create the excel file
60
- return [gr.UploadButton(visible=False), gr.DownloadButton(label=f"Download tabla.xlsx", value=df_table, visible=True)]
61
 
62
  def download_file():
63
  return [gr.UploadButton(visible=True), gr.DownloadButton(visible=False)]
 
46
  data[HEADERS[idx_col]].append(None)
47
  idx_col = idx_col + 1
48
  # SHOW THE RECOVERED DATA
49
+ #print(data)
50
  df_table = pd.DataFrame.from_dict(data)
51
+ df_table.to_excel("tabla.xlsx", index=False)
52
 
53
  def upload_file(filepath):
54
+ print(filepath)
55
  name = Path(filepath).name
56
  # load pdf
57
  doc = fitz.open(filepath)
58
+ create_excel(doc)
 
59
  # now create the excel file
60
+ return [gr.UploadButton(visible=False), gr.DownloadButton(label=f"Download tabla.xlsx", value="tabla.xlsx", visible=True)]
61
 
62
  def download_file():
63
  return [gr.UploadButton(visible=True), gr.DownloadButton(visible=False)]