Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -12,8 +12,32 @@ import pandas as pd
|
|
| 12 |
import numpy as np
|
| 13 |
import plotly.graph_objects as go
|
| 14 |
from plotly.subplots import make_subplots
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
from huggingface_hub import HfApi
|
|
|
|
| 17 |
|
| 18 |
# Internal System Modules
|
| 19 |
import quant_data
|
|
|
|
| 12 |
import numpy as np
|
| 13 |
import plotly.graph_objects as go
|
| 14 |
from plotly.subplots import make_subplots
|
| 15 |
+
|
| 16 |
+
# Hugging Face Hub / Gradio 4.42 Compatibility Shim
|
| 17 |
+
# (Ensures HfFolder is available across all huggingface_hub versions)
|
| 18 |
+
import huggingface_hub
|
| 19 |
+
if not hasattr(huggingface_hub, "HfFolder"):
|
| 20 |
+
try:
|
| 21 |
+
from huggingface_hub.utils._hf_folder import HfFolder
|
| 22 |
+
huggingface_hub.HfFolder = HfFolder
|
| 23 |
+
except Exception:
|
| 24 |
+
class HfFolder:
|
| 25 |
+
@classmethod
|
| 26 |
+
def get_token(cls):
|
| 27 |
+
try:
|
| 28 |
+
return huggingface_hub.get_token()
|
| 29 |
+
except Exception:
|
| 30 |
+
return None
|
| 31 |
+
@classmethod
|
| 32 |
+
def save_token(cls, token):
|
| 33 |
+
pass
|
| 34 |
+
@classmethod
|
| 35 |
+
def delete_token(cls):
|
| 36 |
+
pass
|
| 37 |
+
huggingface_hub.HfFolder = HfFolder
|
| 38 |
+
|
| 39 |
from huggingface_hub import HfApi
|
| 40 |
+
import gradio as gr
|
| 41 |
|
| 42 |
# Internal System Modules
|
| 43 |
import quant_data
|