Download scripts/fix_yaml_paths.py from zhangdebiao/rlclean: direct link, hf CLI and curl.
- Browser
- Download file 688 Bytes
-
https://huggingface.co/datasets/zhangdebiao/rlclean/resolve/main/scripts/fix_yaml_paths.py
- Command line
-
hf download hf://datasets/zhangdebiao/rlclean/scripts/fix_yaml_paths.py
-
curl -L -o fix_yaml_paths.py https://huggingface.co/datasets/zhangdebiao/rlclean/resolve/main/scripts/fix_yaml_paths.py
688 Bytes
| from pathlib import Path | |
| def main(): | |
| root = Path(__file__).resolve().parents[1] | |
| for p in root.rglob("*.yaml"): | |
| if ".git" in p.parts or ".trae" in p.parts: | |
| continue | |
| s = p.read_text(encoding="utf-8") | |
| t = s | |
| t = t.replace("FineGrained_RL/", "") | |
| t = t.replace("datasets/", "data/raw/") | |
| t = t.replace("\"runs/", "\"outputs/runs/") | |
| t = t.replace(" runs/", " outputs/runs/") | |
| t = t.replace("\"logs/", "\"outputs/logs/") | |
| t = t.replace(" logs/", " outputs/logs/") | |
| if t != s: | |
| p.write_text(t, encoding="utf-8") | |
| print("yaml path rewrite done") | |
| if __name__ == "__main__": | |
| main() | |