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
app.py
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
import torch
|
|
|
|
| 1 |
+
# --- ZeroGPU/Blackwell maintenance: newer huggingface_hub dropped HfFolder, which older
|
| 2 |
+
# gradio (gradio/oauth.py) still imports at load time. Restore a minimal shim before that import. ---
|
| 3 |
+
import huggingface_hub
|
| 4 |
+
if not hasattr(huggingface_hub, "HfFolder"):
|
| 5 |
+
class HfFolder:
|
| 6 |
+
@staticmethod
|
| 7 |
+
def get_token(): return huggingface_hub.get_token()
|
| 8 |
+
@staticmethod
|
| 9 |
+
def save_token(token): huggingface_hub.login(token)
|
| 10 |
+
@staticmethod
|
| 11 |
+
def delete_token():
|
| 12 |
+
try: huggingface_hub.logout()
|
| 13 |
+
except Exception: pass
|
| 14 |
+
huggingface_hub.HfFolder = HfFolder
|
| 15 |
import gradio as gr
|
| 16 |
import os
|
| 17 |
import torch
|