Download src/disable_oauth_patch.py from Pteclub/Mock-app: direct link, hf CLI and curl.
- Browser
- Download file 342 Bytes
-
https://huggingface.co/spaces/Pteclub/Mock-app/resolve/main/src/disable_oauth_patch.py
- Command line
-
hf download hf://spaces/Pteclub/Mock-app/src/disable_oauth_patch.py
-
curl -L -o disable_oauth_patch.py https://huggingface.co/spaces/Pteclub/Mock-app/resolve/main/src/disable_oauth_patch.py
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 | |