Download 1.3B/code/utils/paths.py from Elastic-forcing/Elastic-forcing-code: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/Elastic-forcing/Elastic-forcing-code/resolve/main/1.3B/code/utils/paths.py
- Command line
-
hf download hf://Elastic-forcing/Elastic-forcing-code/1.3B/code/utils/paths.py
-
curl -L -o paths.py https://huggingface.co/Elastic-forcing/Elastic-forcing-code/resolve/main/1.3B/code/utils/paths.py
1.1 kB
| """Centralized filesystem layout for Self-Forcing assets. | |
| The pretrained Wan model weights and shared training checkpoints live outside | |
| the repository (on the large data partition). This module is the single | |
| source of truth for those paths so callers do not have to hard-code them. | |
| Both can be overridden with environment variables for portability: | |
| * ``SELF_FORCING_MODELS_DIR`` (defaults to assets/) | |
| * ``SELF_FORCING_CKPT_DIR`` (defaults to assets/) | |
| """ | |
| from __future__ import annotations | |
| import os | |
| from pathlib import Path | |
| _ASSET_ROOT = Path( | |
| os.environ.get( | |
| "SELF_FORCING_ASSET_ROOT", | |
| "assets", | |
| ) | |
| ) | |
| MODELS_DIR = Path(os.environ.get("SELF_FORCING_MODELS_DIR", _ASSET_ROOT / "models")) | |
| CKPT_DIR = Path( | |
| os.environ.get("SELF_FORCING_CKPT_DIR", _ASSET_ROOT / "checkpoints") | |
| ) | |
| def model_path(name: str) -> Path: | |
| """Return the on-disk directory for a Wan-style pretrained model bundle.""" | |
| return MODELS_DIR / name | |
| def ckpt_path(*parts: str) -> Path: | |
| """Return a path under the shared checkpoint directory.""" | |
| return CKPT_DIR.joinpath(*parts) | |