LoocasGoose Claude Opus 4.6 commited on
Commit
40cdbbd
·
1 Parent(s): be42188

Fix: replace removed gr.update() with component constructors for Gradio 5.x

Browse files

gr.update() was removed in Gradio 5.x, causing "No API found" error
on HuggingFace Spaces when clicking SCOPE or Custom database options.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

docs/LEARNINGS.md CHANGED
@@ -194,8 +194,9 @@ except ImportError:
194
  create_structure_with_heatmap = None
195
  ```
196
 
197
- ### Gradio 4.x Breaking Changes
198
  - `gr.Dataframe(height=...)` removed - don't use height parameter
 
199
  - Use `gr.themes.Soft()` instead of custom CSS where possible
200
  - Test locally with same Gradio version as HF Spaces
201
 
 
194
  create_structure_with_heatmap = None
195
  ```
196
 
197
+ ### Gradio 4.x/5.x Breaking Changes
198
  - `gr.Dataframe(height=...)` removed - don't use height parameter
199
+ - `gr.update()` removed in Gradio 5.x - use component constructors instead (e.g. `gr.File(visible=False)` not `gr.update(visible=False)`). Causes "No API found" error on HF Spaces.
200
  - Use `gr.themes.Soft()` instead of custom CSS where possible
201
  - Test locally with same Gradio version as HF Spaces
202
 
protein_conformal/backend/gradio_interface.py CHANGED
@@ -1256,22 +1256,22 @@ MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPL
1256
  return (
1257
  DEFAULT_LOOKUP_EMBEDDING,
1258
  DEFAULT_LOOKUP_METADATA,
1259
- gr.update(value=None, visible=False),
1260
- gr.update(value=None, visible=False),
1261
  )
1262
  if db_choice == "SCOPE":
1263
  return (
1264
  DEFAULT_SCOPE_EMBEDDING,
1265
  DEFAULT_SCOPE_METADATA,
1266
- gr.update(value=None, visible=False),
1267
- gr.update(value=None, visible=False),
1268
  )
1269
  # Custom database
1270
  return (
1271
  CUSTOM_UPLOAD_EMBEDDING,
1272
  CUSTOM_UPLOAD_METADATA,
1273
- gr.update(visible=True),
1274
- gr.update(visible=True),
1275
  )
1276
 
1277
  db_type.change(
 
1256
  return (
1257
  DEFAULT_LOOKUP_EMBEDDING,
1258
  DEFAULT_LOOKUP_METADATA,
1259
+ gr.File(value=None, visible=False),
1260
+ gr.File(value=None, visible=False),
1261
  )
1262
  if db_choice == "SCOPE":
1263
  return (
1264
  DEFAULT_SCOPE_EMBEDDING,
1265
  DEFAULT_SCOPE_METADATA,
1266
+ gr.File(value=None, visible=False),
1267
+ gr.File(value=None, visible=False),
1268
  )
1269
  # Custom database
1270
  return (
1271
  CUSTOM_UPLOAD_EMBEDDING,
1272
  CUSTOM_UPLOAD_METADATA,
1273
+ gr.File(visible=True),
1274
+ gr.File(visible=True),
1275
  )
1276
 
1277
  db_type.change(