samxkevin commited on
Commit
3e76b20
·
verified ·
1 Parent(s): d96ec4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -7508,4 +7508,20 @@ except Exception as e:
7508
  print("[AgentLayer] Launching demo_v2 with continuous HTTP voice transport…")
7509
  # HF Space port: share=True dropped (Spaces already provides the public URL).
7510
  # .queue() is required so ZeroGPU can schedule @spaces.GPU calls properly.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7511
  demo_v2.queue().launch()
 
7508
  print("[AgentLayer] Launching demo_v2 with continuous HTTP voice transport…")
7509
  # HF Space port: share=True dropped (Spaces already provides the public URL).
7510
  # .queue() is required so ZeroGPU can schedule @spaces.GPU calls properly.
7511
+ # Gradio 4.44.x compatibility fix:
7512
+ # json-schema allows boolean schemas (e.g. additionalProperties: true),
7513
+ # but gradio_client's parser assumes every schema is a dict.
7514
+ try:
7515
+ import gradio_client.utils as _gc_utils
7516
+
7517
+ _orig_json_schema_to_python_type = _gc_utils._json_schema_to_python_type
7518
+
7519
+ def _safe_json_schema_to_python_type(schema, defs):
7520
+ if isinstance(schema, bool):
7521
+ return "Any"
7522
+ return _orig_json_schema_to_python_type(schema, defs)
7523
+
7524
+ _gc_utils._json_schema_to_python_type = _safe_json_schema_to_python_type
7525
+ except Exception as _schema_patch_err:
7526
+ print(f"[Gradio] Schema compatibility patch unavailable: {_schema_patch_err}")
7527
  demo_v2.queue().launch()