multimodalart HF Staff commited on
Commit
32998bf
·
verified ·
1 Parent(s): b36f2c5

[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 (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -1,3 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import torch
2
  import random
3
  import numpy as np
 
1
+ # ZeroGPU/Blackwell maintenance: restore symbols removed from newer huggingface_hub that older
2
+ # gradio (oauth.py) / diffusers still import at load time. Must run before import spaces/gradio.
3
+ import huggingface_hub, huggingface_hub.constants as _hc
4
+ if not hasattr(huggingface_hub, "cached_download"): huggingface_hub.cached_download = huggingface_hub.hf_hub_download
5
+ if not hasattr(huggingface_hub, "is_offline_mode"): huggingface_hub.is_offline_mode = lambda: _hc.HF_HUB_OFFLINE
6
+ if not hasattr(_hc, "hf_cache_home"): _hc.hf_cache_home = _hc.HF_HOME
7
+ if not hasattr(huggingface_hub, "HfFolder"):
8
+ class HfFolder:
9
+ @staticmethod
10
+ def get_token(): return huggingface_hub.get_token()
11
+ @staticmethod
12
+ def save_token(t): huggingface_hub.login(t)
13
+ @staticmethod
14
+ def delete_token():
15
+ try: huggingface_hub.logout()
16
+ except Exception: pass
17
+ huggingface_hub.HfFolder = HfFolder
18
  import torch
19
  import random
20
  import numpy as np