Spaces:
Running
Running
Download bootstrap.py from lerobot/annotation-studio: direct link, hf CLI and curl.
- Browser
- Download file 626 Bytes
-
https://huggingface.co/spaces/lerobot/annotation-studio/resolve/main/bootstrap.py
- Command line
-
hf download hf://spaces/lerobot/annotation-studio/bootstrap.py
-
curl -L -o bootstrap.py https://huggingface.co/spaces/lerobot/annotation-studio/resolve/main/bootstrap.py
626 Bytes
| """Verify and unpack the trusted, pinned pipeline bundle before running a job.""" | |
| import hashlib | |
| import json | |
| import tarfile | |
| from pathlib import Path | |
| def unpack(app, destination): | |
| archive = app / "pipeline-source.tar.gz" | |
| version = json.loads((app / "pipeline-version.json").read_text()) | |
| if hashlib.sha256(archive.read_bytes()).hexdigest() != version["sha256"]: | |
| raise RuntimeError("Pipeline archive checksum mismatch") | |
| with tarfile.open(archive) as bundle: | |
| bundle.extractall(destination, filter="data") | |
| if __name__ == "__main__": | |
| unpack(Path(__file__).parent, Path("/workspace/source")) | |