Spaces:
Sleeping
Sleeping
Download src/weights.py from hugging-apps/boom-vvt: direct link, hf CLI and curl.
- Browser
- Download file 652 Bytes
-
https://huggingface.co/spaces/hugging-apps/boom-vvt/resolve/main/src/weights.py
- Command line
-
hf download hf://spaces/hugging-apps/boom-vvt/src/weights.py
-
curl -L -o weights.py https://huggingface.co/spaces/hugging-apps/boom-vvt/resolve/main/src/weights.py
652 Bytes
| import os | |
| from huggingface_hub import hf_hub_download | |
| def resolve_file(path): | |
| if not path: | |
| return path | |
| if os.path.isfile(path): | |
| return os.path.abspath(path) | |
| parts = path.replace("\\", "/").strip("/").split("/") | |
| if len(parts) >= 3 and not os.path.isabs(path): | |
| repo_id = "/".join(parts[:2]) | |
| filename = "/".join(parts[2:]) | |
| local_path = hf_hub_download(repo_id=repo_id, filename=filename) | |
| print(f"[weights] {path} -> {local_path}") | |
| return local_path | |
| raise FileNotFoundError( | |
| f"weight file not found: {path}. Pass a local file or Hugging Face repo_id/filename." | |
| ) | |