Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,14 @@
|
|
| 1 |
-
#
|
| 2 |
-
import
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|