Spaces:
Runtime error
Runtime error
| import sys | |
| import os | |
| # Gradio 4.44.1 imports HfFolder which was removed from huggingface_hub 0.25+ | |
| try: | |
| from huggingface_hub import HfFolder # noqa: F401 | |
| except ImportError: | |
| import huggingface_hub | |
| class _HfFolder: | |
| def get_token(cls): | |
| try: | |
| return huggingface_hub.get_token() | |
| except Exception: | |
| return None | |
| def save_token(cls, token): | |
| pass | |
| def delete_token(cls): | |
| pass | |
| huggingface_hub.HfFolder = _HfFolder | |
| sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src")) | |
| from gradio_interface import demo | |
| demo.launch(server_name="0.0.0.0", server_port=7860) | |