Datasets:
Download unpack_images.py from Candlest/Robot-Use-Agent-SFTData: direct link, hf CLI and curl.
- Browser
- Download file 812 Bytes
-
https://huggingface.co/datasets/Candlest/Robot-Use-Agent-SFTData/resolve/main/unpack_images.py
- Command line
-
hf download hf://datasets/Candlest/Robot-Use-Agent-SFTData/unpack_images.py
-
curl -L -o unpack_images.py https://huggingface.co/datasets/Candlest/Robot-Use-Agent-SFTData/resolve/main/unpack_images.py
812 Bytes
| #!/usr/bin/env python3 | |
| """Unpack images.tar into the images/ directory for training.""" | |
| import subprocess | |
| import sys | |
| from pathlib import Path | |
| def main(): | |
| root = Path(__file__).parent.resolve() | |
| tar_file = root / "images.tar" | |
| if not tar_file.exists(): | |
| print(f"Error: {tar_file} not found.", file=sys.stderr) | |
| return 1 | |
| out_dir = root / "images" | |
| out_dir.mkdir(parents=True, exist_ok=True) | |
| print(f"Extracting {tar_file} into {root}...") | |
| res = subprocess.run(["tar", "-xf", str(tar_file), "-C", str(root)]) | |
| if res.returncode == 0: | |
| print("Extraction complete! Images are ready in ./images/") | |
| return 0 | |
| else: | |
| print("Failed to extract images.", file=sys.stderr) | |
| return res.returncode | |
| if __name__ == "__main__": | |
| sys.exit(main()) | |