benchaffe commited on
Commit
2ba4925
·
verified ·
1 Parent(s): febbbc3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -32,8 +32,7 @@ def log_interaction(input_text, prediction):
32
  def predict_and_log(text):
33
  result = model(text)
34
  log_interaction(text, result)
35
- # Update the file component's value
36
- return result, download_file.update(value=LOG_FILE) # Note: download_file instance here
37
 
38
  with gr.Blocks() as demo:
39
  gr.Markdown("## Biomedical Abbreviation Identifier")
@@ -46,7 +45,7 @@ with gr.Blocks() as demo:
46
  submit_btn.click(
47
  fn=predict_and_log,
48
  inputs=input_box,
49
- outputs=[output_box, download_file] # outputs must correspond to returned tuple
50
  )
51
 
52
  demo.launch()
 
32
  def predict_and_log(text):
33
  result = model(text)
34
  log_interaction(text, result)
35
+ return result, download_file.update(value=LOG_FILE)
 
36
 
37
  with gr.Blocks() as demo:
38
  gr.Markdown("## Biomedical Abbreviation Identifier")
 
45
  submit_btn.click(
46
  fn=predict_and_log,
47
  inputs=input_box,
48
+ outputs=[output_box, download_file]
49
  )
50
 
51
  demo.launch()