lkaesberg commited on
Commit
7cc54fc
·
verified ·
1 Parent(s): 75a7706

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -44,13 +44,14 @@ def process(input_bib: str,
44
  output_bib = f.read().replace("\n ", "\n ")
45
 
46
  # Show output + enable “Download” button
47
- return output_bib, run_id, gr.Button.update(visible=True)
48
 
49
 
50
  def download_file(run_id: str):
51
  """Expose the normalized .bib for download."""
52
- path = f"output_{run_id}.bib"
53
- return gr.File.update(value=path, visible=True)
 
54
 
55
 
56
  # ---------- demo UI ---------- #
@@ -119,8 +120,8 @@ Anthology), deduplicates, sorts, and can abbreviate conference names.
119
  outputs=[output_box, run_uuid, download_btn],
120
  api_name="process",
121
  )
122
- download_btn.click(download_file, run_uuid, download_file_component)
123
- clear_btn.click(lambda _: "", None, input_bib)
124
 
125
 
126
  if __name__ == "__main__":
 
44
  output_bib = f.read().replace("\n ", "\n ")
45
 
46
  # Show output + enable “Download” button
47
+ return output_bib, run_id, gr.update(visible=True)
48
 
49
 
50
  def download_file(run_id: str):
51
  """Expose the normalized .bib for download."""
52
+ file_path = f"output_{run_id}.bib"
53
+
54
+ return file_path, gr.update(visible=True)
55
 
56
 
57
  # ---------- demo UI ---------- #
 
120
  outputs=[output_box, run_uuid, download_btn],
121
  api_name="process",
122
  )
123
+ download_btn.click(download_file, run_uuid, [download_file_component, download_file_component])
124
+ clear_btn.click(lambda: "", None, input_bib)
125
 
126
 
127
  if __name__ == "__main__":