wzzanthony7 commited on
Commit
ec3307f
·
verified ·
1 Parent(s): f280192

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -301,9 +301,8 @@ with gr.Blocks() as demo:
301
  boxed_img, textual, json_str = process_image(image)
302
  filepath = create_json_file(json_str)
303
 
304
- # Create an update object for the download button.
305
- # This sets its value to the file path and makes it clickable.
306
- download_update = gr.DownloadButton.update(value=filepath, interactive=True)
307
 
308
  return boxed_img, textual, json_str, download_update
309
 
@@ -329,6 +328,5 @@ with gr.Blocks() as demo:
329
  )
330
 
331
  # The download_btn no longer needs its own click event.
332
- # Clicking it after it has a 'value' will trigger the download.
333
 
334
  demo.launch()
 
301
  boxed_img, textual, json_str = process_image(image)
302
  filepath = create_json_file(json_str)
303
 
304
+ # Use the legacy gr.update() for compatibility with older Gradio versions.
305
+ download_update = gr.update(value=filepath, interactive=True)
 
306
 
307
  return boxed_img, textual, json_str, download_update
308
 
 
328
  )
329
 
330
  # The download_btn no longer needs its own click event.
 
331
 
332
  demo.launch()