Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1,4 +1,19 @@
|
|
| 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import torch
|
| 4 |
import numpy as np
|
|
|
|
| 1 |
|
| 2 |
+
import huggingface_hub as hf_hub
|
| 3 |
+
|
| 4 |
+
# Gradio <-> hub compatibility shim: newer huggingface_hub removed HfFolder.
|
| 5 |
+
if not hasattr(hf_hub, "HfFolder"):
|
| 6 |
+
class _HfFolderShim:
|
| 7 |
+
@staticmethod
|
| 8 |
+
def get_token():
|
| 9 |
+
return None
|
| 10 |
+
|
| 11 |
+
@staticmethod
|
| 12 |
+
def save_token(token):
|
| 13 |
+
return None
|
| 14 |
+
|
| 15 |
+
hf_hub.HfFolder = _HfFolderShim # type: ignore[attr-defined]
|
| 16 |
+
|
| 17 |
import gradio as gr
|
| 18 |
import torch
|
| 19 |
import numpy as np
|