Spaces:
Runtime error
Runtime error
Download mirror.py from EngineeringWithJay/zimage-mirror: direct link, hf CLI and curl.
- Browser
- Download file 661 Bytes
-
https://huggingface.co/spaces/EngineeringWithJay/zimage-mirror/resolve/main/mirror.py
- Command line
-
hf download hf://spaces/EngineeringWithJay/zimage-mirror/mirror.py
-
curl -L -o mirror.py https://huggingface.co/spaces/EngineeringWithJay/zimage-mirror/resolve/main/mirror.py
661 Bytes
| from huggingface_hub import hf_hub_download, upload_file, login | |
| import os | |
| # HF Spaces have HF_TOKEN set automatically | |
| token = os.environ.get("HF_TOKEN", "") | |
| print("Downloading Z-Image-Turbo Q2_K from unsloth (fast - we're on HF infra)...") | |
| path = hf_hub_download( | |
| "unsloth/Z-Image-Turbo-GGUF", | |
| "z-image-turbo-Q2_K.gguf", | |
| token=token, | |
| ) | |
| print(f"Downloaded: {os.path.getsize(path)} bytes") | |
| print("Uploading to wannabecomputerscientist/zimage-mirror...") | |
| upload_file( | |
| path_or_fileobj=path, | |
| path_in_repo="z-image-turbo-Q2_K.gguf", | |
| repo_id="wannabecomputerscientist/zimage-mirror", | |
| repo_type="model", | |
| token=token, | |
| ) | |
| print("Done!") | |