eduardo4547 commited on
Commit
5c478be
·
verified ·
1 Parent(s): c5994d1

Update run/gradio_ootd.py

Browse files
Files changed (1) hide show
  1. 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: additionalProperties puede ser bool en JSON Schema
9
  from gradio_client import utils as _gc_utils
10
 
11
- _orig_get_type = _gc_utils.get_type
12
 
13
- def _patched_get_type(schema):
14
  if not isinstance(schema, dict):
15
  return "Any"
16
- return _orig_get_type(schema)
17
 
18
- _gc_utils.get_type = _patched_get_type
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