Mock-app / src /disable_oauth_patch.py
mohdomer's picture
Create disable_oauth_patch.py
5f46aa9 verified
Raw History Blame Contribute Delete
342 Bytes
# 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