Spaces:
Running on Zero
Running on Zero
[Admin maintenance] Support new ZeroGPU hardware
#36
by multimodalart HF Staff - opened
- README.md +2 -2
- requirements.txt +2 -3
- run/gradio_ootd.py +29 -0
README.md
CHANGED
|
@@ -4,8 +4,8 @@ emoji: π₯Όππ
|
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: pink
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
-
python_version:
|
| 9 |
app_file: ./run/gradio_ootd.py
|
| 10 |
pinned: false
|
| 11 |
license: cc-by-nc-sa-4.0
|
|
|
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: pink
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 6.20.0
|
| 8 |
+
python_version: '3.10'
|
| 9 |
app_file: ./run/gradio_ootd.py
|
| 10 |
pinned: false
|
| 11 |
license: cc-by-nc-sa-4.0
|
requirements.txt
CHANGED
|
@@ -7,12 +7,11 @@ scikit-image==0.21.0
|
|
| 7 |
opencv-python==4.7.0.72
|
| 8 |
pillow==9.4.0
|
| 9 |
diffusers==0.24.0
|
| 10 |
-
transformers
|
| 11 |
accelerate==0.26.1
|
| 12 |
matplotlib==3.7.4
|
| 13 |
tqdm==4.64.1
|
| 14 |
config==0.5.1
|
| 15 |
einops==0.7.0
|
| 16 |
onnxruntime==1.16.2
|
| 17 |
-
|
| 18 |
-
basicsr
|
|
|
|
| 7 |
opencv-python==4.7.0.72
|
| 8 |
pillow==9.4.0
|
| 9 |
diffusers==0.24.0
|
| 10 |
+
transformers
|
| 11 |
accelerate==0.26.1
|
| 12 |
matplotlib==3.7.4
|
| 13 |
tqdm==4.64.1
|
| 14 |
config==0.5.1
|
| 15 |
einops==0.7.0
|
| 16 |
onnxruntime==1.16.2
|
| 17 |
+
basicsr
|
|
|
run/gradio_ootd.py
CHANGED
|
@@ -17,6 +17,35 @@ except Exception:
|
|
| 17 |
# --- end compat shim ---
|
| 18 |
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
import gradio as gr
|
| 21 |
import os
|
| 22 |
from pathlib import Path
|
|
|
|
| 17 |
# --- end compat shim ---
|
| 18 |
|
| 19 |
|
| 20 |
+
# --- compat shim: huggingface_hub >=1.0 removed cached_download and HfFolder,
|
| 21 |
+
# which diffusers==0.24.0 (and old transformers) still import. Re-inject them
|
| 22 |
+
# BEFORE importing diffusers / transformers / the model.
|
| 23 |
+
import huggingface_hub as _hub
|
| 24 |
+
import huggingface_hub.constants as _hc
|
| 25 |
+
if not hasattr(_hub, "cached_download"):
|
| 26 |
+
_hub.cached_download = _hub.hf_hub_download
|
| 27 |
+
if not hasattr(_hub, "HfFolder"):
|
| 28 |
+
class _HfFolder:
|
| 29 |
+
@staticmethod
|
| 30 |
+
def get_token():
|
| 31 |
+
return _hub.get_token()
|
| 32 |
+
_hub.HfFolder = _HfFolder
|
| 33 |
+
if not hasattr(_hc, "hf_cache_home"):
|
| 34 |
+
_hc.hf_cache_home = _hc.HF_HOME
|
| 35 |
+
if not hasattr(_hub, "is_offline_mode"):
|
| 36 |
+
_hub.is_offline_mode = lambda: _hc.HF_HUB_OFFLINE
|
| 37 |
+
# --- end hub compat shim ---
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
# --- compat shim: transformers >=5.0 removed the Flax weight-name constant that
|
| 41 |
+
# diffusers==0.24.0 (pipeline_utils) still imports. Re-inject it BEFORE the
|
| 42 |
+
# diffusers/transformers import chain triggered by the model imports below.
|
| 43 |
+
import transformers.utils as _tu
|
| 44 |
+
if not hasattr(_tu, "FLAX_WEIGHTS_NAME"):
|
| 45 |
+
_tu.FLAX_WEIGHTS_NAME = "flax_model.msgpack"
|
| 46 |
+
# --- end transformers compat shim ---
|
| 47 |
+
|
| 48 |
+
|
| 49 |
import gradio as gr
|
| 50 |
import os
|
| 51 |
from pathlib import Path
|