File size: 342 Bytes
5f46aa9 | 1 2 3 4 5 6 7 8 9 10 11 12 | # Disable Gradio OAuth import errors caused by removed HfFolder in huggingface_hub>=0.30
import sys
import types
# Create a fake huggingface_hub.HfFolder so Gradio doesn't crash
fake_hub = types.ModuleType("huggingface_hub")
fake_hub.HfFolder = object
fake_hub.whoami = lambda *args, **kwargs: {}
sys.modules["huggingface_hub"] = fake_hub
|