multimodalart HF Staff commited on
Commit
3dd9ebb
·
verified ·
1 Parent(s): 6517bc6

[Admin maintenance] Support new ZeroGPU hardware

Browse files

Thank you so much for having shared this Space with the community on this demo. We have upgraded the ZeroGPU infra-structure to run on modern blackwell architecture.
For that, we need to upgrade your demo to support that. This PR fixes your demo to work with the new architecture. As this is something we broke on our end, we may merge this PR autonomously. If this breaks unexpectedly or brings unintended consequences, feel free to revert, modify or otherwise. Any issues you can email apolinario@huggingface.co

Files changed (2) hide show
  1. README.md +1 -0
  2. run/gradio_ootd.py +17 -0
README.md CHANGED
@@ -5,6 +5,7 @@ colorFrom: yellow
5
  colorTo: pink
6
  sdk: gradio
7
  sdk_version: 4.36.1
 
8
  app_file: ./run/gradio_ootd.py
9
  pinned: false
10
  license: cc-by-nc-sa-4.0
 
5
  colorTo: pink
6
  sdk: gradio
7
  sdk_version: 4.36.1
8
+ python_version: "3.10"
9
  app_file: ./run/gradio_ootd.py
10
  pinned: false
11
  license: cc-by-nc-sa-4.0
run/gradio_ootd.py CHANGED
@@ -1,4 +1,21 @@
1
  import spaces
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  import gradio as gr
4
  import os
 
1
  import spaces
2
+ # --- compat shim: torchvision >=0.17 removed torchvision.transforms.functional_tensor,
3
+ # which basicsr/gfpgan/facexlib still import from. Re-create it as an alias module
4
+ # pointing at torchvision.transforms.functional (which has the same tensor-capable fns).
5
+ import sys as _sys, types as _types
6
+ try:
7
+ import torchvision.transforms.functional as _tv_functional
8
+ if "torchvision.transforms.functional_tensor" not in _sys.modules:
9
+ _functional_tensor_shim = _types.ModuleType("torchvision.transforms.functional_tensor")
10
+ for _name in ("rgb_to_grayscale", "adjust_brightness", "adjust_contrast",
11
+ "adjust_hue", "adjust_saturation", "normalize"):
12
+ if hasattr(_tv_functional, _name):
13
+ setattr(_functional_tensor_shim, _name, getattr(_tv_functional, _name))
14
+ _sys.modules["torchvision.transforms.functional_tensor"] = _functional_tensor_shim
15
+ except Exception:
16
+ pass
17
+ # --- end compat shim ---
18
+
19
 
20
  import gradio as gr
21
  import os