Download pretrained.py from StrongDev2024/mini: direct link, hf CLI and curl.
- Browser
- Download file 457 Bytes
-
https://huggingface.co/StrongDev2024/mini/resolve/main/pretrained.py
- Command line
-
hf download hf://StrongDev2024/mini/pretrained.py
-
curl -L -o pretrained.py https://huggingface.co/StrongDev2024/mini/resolve/main/pretrained.py
457 Bytes
| """Find a local folder or a Hugging Face repo that holds Mini's files.""" | |
| from pathlib import Path | |
| def resolve_pretrained_folder(path_or_repo): | |
| """Return a directory with config.json. Download a Hub repo id first.""" | |
| folder = Path(path_or_repo) | |
| if folder.is_dir(): | |
| return folder | |
| from huggingface_hub import snapshot_download | |
| downloaded = snapshot_download(repo_id=str(path_or_repo)) | |
| return Path(downloaded) | |