(Bill) Yuchen Lin commited on
Commit
722ef03
1 Parent(s): 15b17df

hide the download button to avoid confusion before submit

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -36,7 +36,7 @@ def process(input_bib, shorten, remove_keys, deduplicate, sort):
36
  output_bib = f.read().replace("\n ", "\n ")
37
  # delete both files
38
  # print(output_bib)
39
- return output_bib, random_id
40
 
41
 
42
  example_input = """
@@ -118,6 +118,7 @@ with gr.Blocks() as demo:
118
  with gr.Column(scale=3):
119
  output=gr.Textbox(label="Output BIB (Note that you can copy the output bib file by clicking the top-right button.)").style(show_copy_button=True, interactive=False)
120
  download_btn = gr.Button("Generate Bib File")
 
121
  download_content = gr.outputs.File()
122
  download_content.visible = False
123
  def download_file(ex_uuid):
@@ -127,7 +128,7 @@ with gr.Blocks() as demo:
127
  download_content.update(visible=False)
128
  return file_path, gr.update(visible=True)
129
  download_btn.click(download_file, inputs=ex_uuid, outputs=[download_content,download_content])
130
- button.click(process, inputs=[input_bib, shorten, removekeys, dedup, sort], outputs=[output, ex_uuid], api_name = "process")
131
  def clean(text):
132
  return ""
133
  clr_button.click(clean, input_bib, input_bib)
 
36
  output_bib = f.read().replace("\n ", "\n ")
37
  # delete both files
38
  # print(output_bib)
39
+ return output_bib, random_id, gr.update(visible=True)
40
 
41
 
42
  example_input = """
 
118
  with gr.Column(scale=3):
119
  output=gr.Textbox(label="Output BIB (Note that you can copy the output bib file by clicking the top-right button.)").style(show_copy_button=True, interactive=False)
120
  download_btn = gr.Button("Generate Bib File")
121
+ download_btn.visible = False
122
  download_content = gr.outputs.File()
123
  download_content.visible = False
124
  def download_file(ex_uuid):
 
128
  download_content.update(visible=False)
129
  return file_path, gr.update(visible=True)
130
  download_btn.click(download_file, inputs=ex_uuid, outputs=[download_content,download_content])
131
+ button.click(process, inputs=[input_bib, shorten, removekeys, dedup, sort], outputs=[output, ex_uuid, download_btn], api_name = "process")
132
  def clean(text):
133
  return ""
134
  clr_button.click(clean, input_bib, input_bib)