Spaces:
Runtime error
Runtime error
Download scripts/utils/stage.py from descript/vampnet: direct link, hf CLI and curl.
- Browser
- Download file 712 Bytes
-
https://huggingface.co/spaces/descript/vampnet/resolve/refs%2Fpr%2F9/scripts/utils/stage.py
- Command line
-
hf download hf://spaces/descript/vampnet@refs/pr/9/scripts/utils/stage.py
-
curl -L -o stage.py https://huggingface.co/spaces/descript/vampnet/resolve/refs%2Fpr%2F9/scripts/utils/stage.py
712 Bytes
| import os | |
| import subprocess | |
| from pathlib import Path | |
| import argbind | |
| import rich | |
| from audiotools.ml import Experiment | |
| def run( | |
| run_dir: str = os.getenv("PATH_TO_RUNS", "runs"), | |
| name: str = None, | |
| recent: bool = False, | |
| ): | |
| if recent: | |
| paths = sorted(Path(run_dir).iterdir(), key=os.path.getmtime) | |
| paths = [p.name for p in paths if p.is_dir()] | |
| if paths: | |
| name = paths[-1] | |
| with Experiment(run_dir, name) as exp: | |
| exp.snapshot() | |
| rich.print(f"Created a snapshot of {exp.parent_directory} at {exp.exp_dir}") | |
| if __name__ == "__main__": | |
| args = argbind.parse_args() | |
| with argbind.scope(args): | |
| run() | |