Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import spaces
|
| 2 |
import gradio as gr
|
| 3 |
import numpy as np
|
|
|
|
| 1 |
+
import gradio_client.utils as _gcu
|
| 2 |
+
|
| 3 |
+
_orig_get_type = _gcu.get_type
|
| 4 |
+
def _patched_get_type(schema):
|
| 5 |
+
if not isinstance(schema, dict):
|
| 6 |
+
return "Any"
|
| 7 |
+
return _orig_get_type(schema)
|
| 8 |
+
_gcu.get_type = _patched_get_type
|
| 9 |
+
|
| 10 |
+
_orig_json_to_py = _gcu._json_schema_to_python_type
|
| 11 |
+
def _patched_json_to_py(schema, defs=None):
|
| 12 |
+
if isinstance(schema, bool):
|
| 13 |
+
return "bool"
|
| 14 |
+
return _orig_json_to_py(schema, defs)
|
| 15 |
+
_gcu._json_schema_to_python_type = _patched_json_to_py
|
| 16 |
+
# === end fix ===
|
| 17 |
import spaces
|
| 18 |
import gradio as gr
|
| 19 |
import numpy as np
|