akseljoonas HF Staff commited on
Commit
49679e5
·
verified ·
1 Parent(s): 1b70b38

Fix: Update deprecated APIs and dependencies

Browse files

## Fix: Update Space to work with current Gradio/dependencies

This PR fixes the following issues preventing the Space from running:

- Updated `sdk_version` from `3.50.2` to `5.29.1`
- Removed `share=True` (not needed on HF Spaces)
- Removed deprecated `concurrency_count` from `.queue()`
- Removed outdated pinned `gradio==3.50.2`

### Details
The Space is currently showing as `RUNTIME_ERROR`. These changes update deprecated APIs and dependency versions to restore functionality.

---
*This fix was generated by [smolagents/ml-agent](https://huggingface.co/smolagents/ml-agent) 🤖*

Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +3 -4
  3. requirements.txt +0 -1
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 📚
4
  colorFrom: yellow
5
  colorTo: blue
6
  sdk: gradio
7
- sdk_version: 3.50.2
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
 
4
  colorFrom: yellow
5
  colorTo: blue
6
  sdk: gradio
7
+ sdk_version: 5.29.1
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
app.py CHANGED
@@ -103,7 +103,7 @@ block = gr.Blocks(
103
  radius_size=gr.themes.sizes.radius_none,
104
  text_size=gr.themes.sizes.text_md
105
  )
106
- ).queue(concurrency_count=2)
107
  with block:
108
  with gr.Row():
109
  with gr.Column():
@@ -255,8 +255,7 @@ with block:
255
  input_image.select(
256
  get_point,
257
  [original_image, selected_points, radio],
258
- [input_image, original_mask],
259
- )
260
 
261
  # undo the selected point
262
  def undo_points(orig_img, sel_pix):
@@ -310,4 +309,4 @@ with block:
310
  run_button.click(fn=process, inputs=ips, outputs=[result_gallery, request_id, gallery_flag])
311
 
312
 
313
- block.launch(share=True)
 
103
  radius_size=gr.themes.sizes.radius_none,
104
  text_size=gr.themes.sizes.text_md
105
  )
106
+ ).queue()
107
  with block:
108
  with gr.Row():
109
  with gr.Column():
 
255
  input_image.select(
256
  get_point,
257
  [original_image, selected_points, radio],
258
+ [input_image, original_mask])
 
259
 
260
  # undo the selected point
261
  def undo_points(orig_img, sel_pix):
 
309
  run_button.click(fn=process, inputs=ips, outputs=[result_gallery, request_id, gallery_flag])
310
 
311
 
312
+ block.launch()
requirements.txt CHANGED
@@ -1,7 +1,6 @@
1
  dashscope
2
  sympy
3
  Pillow==9.5.0
4
- gradio==3.50.2
5
  opencv-python
6
  omegaconf
7
  sentencepiece
 
1
  dashscope
2
  sympy
3
  Pillow==9.5.0
 
4
  opencv-python
5
  omegaconf
6
  sentencepiece