Spaces:
Sleeping
Sleeping
Update run/gradio_ootd.py
Browse files- run/gradio_ootd.py +5 -5
run/gradio_ootd.py
CHANGED
|
@@ -5,17 +5,17 @@ _ft_mod = type(sys)("torchvision.transforms.functional_tensor")
|
|
| 5 |
_ft_mod.rgb_to_grayscale = _tvf.rgb_to_grayscale
|
| 6 |
sys.modules["torchvision.transforms.functional_tensor"] = _ft_mod
|
| 7 |
|
| 8 |
-
# Patch gradio_client bug:
|
| 9 |
from gradio_client import utils as _gc_utils
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
-
def
|
| 14 |
if not isinstance(schema, dict):
|
| 15 |
return "Any"
|
| 16 |
-
return
|
| 17 |
|
| 18 |
-
_gc_utils.
|
| 19 |
|
| 20 |
import spaces
|
| 21 |
|
|
|
|
| 5 |
_ft_mod.rgb_to_grayscale = _tvf.rgb_to_grayscale
|
| 6 |
sys.modules["torchvision.transforms.functional_tensor"] = _ft_mod
|
| 7 |
|
| 8 |
+
# Patch gradio_client bug: el schema puede ser un bool (additionalProperties: true) en gradio 4.36
|
| 9 |
from gradio_client import utils as _gc_utils
|
| 10 |
|
| 11 |
+
_orig_json_schema_to_python_type = _gc_utils._json_schema_to_python_type
|
| 12 |
|
| 13 |
+
def _patched_json_schema_to_python_type(schema, defs=None):
|
| 14 |
if not isinstance(schema, dict):
|
| 15 |
return "Any"
|
| 16 |
+
return _orig_json_schema_to_python_type(schema, defs)
|
| 17 |
|
| 18 |
+
_gc_utils._json_schema_to_python_type = _patched_json_schema_to_python_type
|
| 19 |
|
| 20 |
import spaces
|
| 21 |
|