Download tools/pick_subset.py from RightNowAI/duplex-v0: direct link, hf CLI and curl.
- Browser
- Download file 581 Bytes
-
https://huggingface.co/RightNowAI/duplex-v0/resolve/main/tools/pick_subset.py
- Command line
-
hf download hf://RightNowAI/duplex-v0/tools/pick_subset.py
-
curl -L -o pick_subset.py https://huggingface.co/RightNowAI/duplex-v0/resolve/main/tools/pick_subset.py
581 Bytes
| """Copy a few questions of the benchmark subset into another folder (smoke tests). | |
| python -m tools.pick_subset eval/data/bba eval/data/bba4 0 30 55 80 | |
| """ | |
| import json | |
| import shutil | |
| import sys | |
| from pathlib import Path | |
| src, dst = Path(sys.argv[1]), Path(sys.argv[2]) | |
| dst.mkdir(parents=True, exist_ok=True) | |
| subset = json.loads((src / "subset.json").read_text()) | |
| pick = [subset[int(i)] for i in sys.argv[3:]] | |
| (dst / "subset.json").write_text(json.dumps(pick)) | |
| for q in pick: | |
| shutil.copy(src / f"q_{q['id']}.wav", dst / f"q_{q['id']}.wav") | |
| print(len(pick), "questions in", dst) | |