Download scripts/remove_ablations.py from JCorners/results: direct link, hf CLI and curl.
- Browser
- Download file 391 Bytes
-
https://huggingface.co/datasets/JCorners/results/resolve/main/scripts/remove_ablations.py
- Command line
-
hf download hf://datasets/JCorners/results/scripts/remove_ablations.py
-
curl -L -o remove_ablations.py https://huggingface.co/datasets/JCorners/results/resolve/main/scripts/remove_ablations.py
391 Bytes
| import glob | |
| import os | |
| import json | |
| import tqdm | |
| for file in tqdm.tqdm(glob.glob("results/*/*.json")): | |
| print(file) | |
| if "Instruction" not in file: | |
| continue | |
| with open(file, "r") as fin: | |
| data = json.load(fin) | |
| if "individual" in data["test"]: | |
| del data["test"]["individual"] | |
| with open(file, "w") as fout: | |
| json.dump(data, fout, indent=2) | |