multimodalart HF Staff commited on
Commit
1a5e314
·
verified ·
1 Parent(s): 8485652

[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. app.py +12 -5
  2. requirements.txt +6 -9
app.py CHANGED
@@ -15,13 +15,12 @@
15
 
16
  import os
17
  os.system("rm -rf /data-nvme/zerogpu-offload/")
18
- os.system("pip install chumpy")
19
  os.system("pip uninstall -y basicsr")
20
  os.system("pip install git+https://github.com/hitsz-zuoqi/BasicSR/")
21
  os.system("pip install numpy==1.23.0")
22
- os.system("pip install ./wheels_new/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl --force-reinstall")
23
- os.system("pip install ./wheels/simple_knn-0.0.0-cp310-cp310-linux_x86_64.whl --force-reinstall")
24
- os.system("pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py310_cu121_pyt240/download.html")
25
  import cv2
26
  import time
27
  from PIL import Image
@@ -31,6 +30,14 @@ import base64
31
  import spaces
32
  import torch
33
  torch._dynamo.config.disable = True
 
 
 
 
 
 
 
 
34
  import subprocess
35
  import os
36
  import argparse
@@ -400,7 +407,7 @@ def launch_pretrained():
400
  hf_hub_download(repo_id="3DAIGC/LHM-500M-HF", repo_type='model', filename='model.safetensors', local_dir="./exps/releases/video_human_benchmark/human-lrm-500M/step_060000/")
401
 
402
  def launch_env_not_compile_with_cuda():
403
- os.system("pip install chumpy")
404
  os.system("pip uninstall -y basicsr")
405
  os.system("pip install git+https://github.com/hitsz-zuoqi/BasicSR/")
406
  os.system("pip install numpy==1.23.0")
 
15
 
16
  import os
17
  os.system("rm -rf /data-nvme/zerogpu-offload/")
18
+ os.system("pip install --no-build-isolation chumpy")
19
  os.system("pip uninstall -y basicsr")
20
  os.system("pip install git+https://github.com/hitsz-zuoqi/BasicSR/")
21
  os.system("pip install numpy==1.23.0")
22
+ # diff_gaussian_rasterization / pytorch3d / simple_knn are now installed at build time from
23
+ # requirements.txt (prebuilt Blackwell sm_120 wheels); no runtime pip install needed.
 
24
  import cv2
25
  import time
26
  from PIL import Image
 
30
  import spaces
31
  import torch
32
  torch._dynamo.config.disable = True
33
+
34
+ # torch>=2.6 flipped torch.load's default to weights_only=True, which breaks loading
35
+ # these (trusted, first-party) checkpoints that pickle argparse.Namespace and other globals.
36
+ _orig_torch_load = torch.load
37
+ def _torch_load_full(*args, **kwargs):
38
+ kwargs.setdefault("weights_only", False)
39
+ return _orig_torch_load(*args, **kwargs)
40
+ torch.load = _torch_load_full
41
  import subprocess
42
  import os
43
  import argparse
 
407
  hf_hub_download(repo_id="3DAIGC/LHM-500M-HF", repo_type='model', filename='model.safetensors', local_dir="./exps/releases/video_human_benchmark/human-lrm-500M/step_060000/")
408
 
409
  def launch_env_not_compile_with_cuda():
410
+ os.system("pip install --no-build-isolation chumpy")
411
  os.system("pip uninstall -y basicsr")
412
  os.system("pip install git+https://github.com/hitsz-zuoqi/BasicSR/")
413
  os.system("pip install numpy==1.23.0")
requirements.txt CHANGED
@@ -12,7 +12,6 @@ diffusers
12
  dna==0.0.1
13
  gfpgan==1.3.8
14
  gsplat==1.4.0
15
- huggingface_hub==0.23.2
16
  imageio==2.19.3
17
  jaxtyping==0.2.38
18
  kiui==0.2.14
@@ -38,14 +37,12 @@ setuptools==74.0.0
38
  taming_transformers_rom1504==0.0.6
39
  timm==1.0.15
40
 
41
- # https://download.pytorch.org/whl/cu121/torch-2.5.1%2Bcu121-cp310-cp310-linux_x86_64.whl#sha256=92af92c569de5da937dd1afb45ecfdd598ec1254cf2e49e3d698cb24d71aae14
42
- # https://download.pytorch.org/whl/cu121/torchvision-0.20.1%2Bcu121-cp310-cp310-linux_x86_64.whl#sha256=304937b82c933d5155bd04d771f4b187273f67a76050bb4276b521f7e9b4c4e7
43
- # https://download.pytorch.org/whl/cu121/xformers-0.0.29.post1-cp310-cp310-manylinux_2_28_x86_64.whl#sha256=e213ff8123e20602bd486739ffee4013338b02f9d2e0e4635a2912750854fdbe
44
-
45
- https://download.pytorch.org/whl/cu121/torch-2.4.0%2Bcu121-cp310-cp310-linux_x86_64.whl#sha256=28bfba084dca52a06c465d7ad0f3cc372c35fc503f3eab881cc17a5fd82914e7
46
- https://download.pytorch.org/whl/cu121/torchvision-0.19.0%2Bcu121-cp310-cp310-linux_x86_64.whl#sha256=5ee103c7eb47f8b08837e0e48b178f7ecc91d769d2b61240b90cb5aa2d06ce77
47
-
48
-
49
 
50
  tqdm==4.66.4
51
  transformers==4.41.2
 
12
  dna==0.0.1
13
  gfpgan==1.3.8
14
  gsplat==1.4.0
 
15
  imageio==2.19.3
16
  jaxtyping==0.2.38
17
  kiui==0.2.14
 
37
  taming_transformers_rom1504==0.0.6
38
  timm==1.0.15
39
 
40
+ # Blackwell (sm_120) ZeroGPU: use stock torch 2.8.0 (default PyPI cu128 wheel supports sm_120)
41
+ # plus prebuilt CUDA-extension wheels from multimodalart/zerogpu-blackwell-wheels (tag pt28-cu128-cp310).
42
+ torch==2.8.0
43
+ torchvision==0.23.0
44
+ https://huggingface.co/datasets/multimodalart/zerogpu-blackwell-wheels/resolve/main/wheels/pt28-cu128-cp310/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl
45
+ https://huggingface.co/datasets/multimodalart/zerogpu-blackwell-wheels/resolve/main/wheels/pt28-cu128-cp310/pytorch3d-0.7.9-cp310-cp310-linux_x86_64.whl
 
 
46
 
47
  tqdm==4.66.4
48
  transformers==4.41.2