File size: 688 Bytes
5679f59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()