Spaces:
Build error
Build error
Download diffusers_helper/hf_login.py from Amarble1208/FramePack: direct link, hf CLI and curl.
- Browser
- Download file 416 Bytes
-
https://huggingface.co/spaces/Amarble1208/FramePack/resolve/main/diffusers_helper/hf_login.py
- Command line
-
hf download hf://spaces/Amarble1208/FramePack/diffusers_helper/hf_login.py
-
curl -L -o hf_login.py https://huggingface.co/spaces/Amarble1208/FramePack/resolve/main/diffusers_helper/hf_login.py
416 Bytes
| import os | |
| def login(token): | |
| from huggingface_hub import login | |
| import time | |
| while True: | |
| try: | |
| login(token) | |
| print('HF login ok.') | |
| break | |
| except Exception as e: | |
| print(f'HF login failed: {e}. Retrying') | |
| time.sleep(0.5) | |
| hf_token = os.environ.get('HF_TOKEN', None) | |
| if hf_token is not None: | |
| login(hf_token) | |