Spaces:
Running on Zero
Running on Zero
[Admin maintenance] Support new ZeroGPU hardware
Browse filesThank 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
- README.md +2 -2
- app.py +13 -1
- requirements.txt +6 -7
README.md
CHANGED
|
@@ -4,8 +4,8 @@ emoji: 📸
|
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: gray
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
-
python_version: 3.
|
| 11 |
---
|
|
|
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: gray
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.49.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
python_version: "3.10"
|
| 11 |
---
|
app.py
CHANGED
|
@@ -2,12 +2,24 @@ import datetime
|
|
| 2 |
import json
|
| 3 |
import os
|
| 4 |
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
from huggingface_hub import hf_hub_download
|
| 7 |
-
import spaces
|
| 8 |
import PIL.Image
|
| 9 |
import numpy as np
|
| 10 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
import torchvision.transforms.functional
|
| 12 |
from numpy import deg2rad
|
| 13 |
from omegaconf import OmegaConf
|
|
|
|
| 2 |
import json
|
| 3 |
import os
|
| 4 |
|
| 5 |
+
import spaces
|
| 6 |
import gradio as gr
|
| 7 |
from huggingface_hub import hf_hub_download
|
|
|
|
| 8 |
import PIL.Image
|
| 9 |
import numpy as np
|
| 10 |
import torch
|
| 11 |
+
|
| 12 |
+
# Force xformers to use Cutlass op (FA3 Hopper kernel crashes on Blackwell sm_120).
|
| 13 |
+
import xformers
|
| 14 |
+
import xformers.ops as _xops
|
| 15 |
+
_orig_mea = _xops.memory_efficient_attention
|
| 16 |
+
_cutlass_ops = (_xops.fmha.cutlass.FwOp, _xops.fmha.cutlass.BwOp)
|
| 17 |
+
def _mea_cutlass(*a, **kw):
|
| 18 |
+
if kw.get("op") is None:
|
| 19 |
+
kw["op"] = _cutlass_ops
|
| 20 |
+
return _orig_mea(*a, **kw)
|
| 21 |
+
_xops.memory_efficient_attention = _mea_cutlass
|
| 22 |
+
xformers.ops.memory_efficient_attention = _mea_cutlass
|
| 23 |
import torchvision.transforms.functional
|
| 24 |
from numpy import deg2rad
|
| 25 |
from omegaconf import OmegaConf
|
requirements.txt
CHANGED
|
@@ -1,18 +1,17 @@
|
|
| 1 |
-
torch==2.
|
| 2 |
-
pytorch_lightning
|
| 3 |
-
deepspeed==0.15.0
|
| 4 |
taming-transformers==0.0.1
|
| 5 |
diffusers==0.30.1
|
| 6 |
transformers
|
| 7 |
-
torchvision==0.
|
| 8 |
scipy==1.14.1
|
| 9 |
einops==0.8.0
|
| 10 |
kornia==0.7.3
|
| 11 |
open_clip_torch==2.20.0
|
| 12 |
openai-clip==1.0.1
|
| 13 |
numpy==1.26.3
|
| 14 |
-
xformers
|
| 15 |
timm==1.0.9
|
| 16 |
av==12.3.0
|
| 17 |
-
|
| 18 |
-
|
|
|
|
| 1 |
+
torch==2.8.0
|
| 2 |
+
pytorch_lightning
|
|
|
|
| 3 |
taming-transformers==0.0.1
|
| 4 |
diffusers==0.30.1
|
| 5 |
transformers
|
| 6 |
+
torchvision==0.23.0
|
| 7 |
scipy==1.14.1
|
| 8 |
einops==0.8.0
|
| 9 |
kornia==0.7.3
|
| 10 |
open_clip_torch==2.20.0
|
| 11 |
openai-clip==1.0.1
|
| 12 |
numpy==1.26.3
|
| 13 |
+
xformers
|
| 14 |
timm==1.0.9
|
| 15 |
av==12.3.0
|
| 16 |
+
huggingface_hub
|
| 17 |
+
|