johnrobinsn commited on
Commit
79fd51d
·
verified ·
1 Parent(s): 72c7828

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -1,6 +1,14 @@
1
- # Force reinstall at runtime (hacky but works)
2
- import subprocess
3
- subprocess.run(["pip", "install", "gradio==5.9.1", "gradio_client==1.5.2", "-q"])
 
 
 
 
 
 
 
 
4
 
5
 
6
 
 
1
+ # Monkey-patch gradio_client's broken schema parser
2
+ import gradio_client.utils as client_utils
3
+
4
+ _original_json_schema_to_python_type = client_utils._json_schema_to_python_type
5
+
6
+ def _patched_json_schema_to_python_type(schema, defs=None):
7
+ if isinstance(schema, bool):
8
+ return "Any"
9
+ return _original_json_schema_to_python_type(schema, defs)
10
+
11
+ client_utils._json_schema_to_python_type = _patched_json_schema_to_python_type
12
 
13
 
14