File size: 390 Bytes
f38384a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import json, glob

BASE = "/tmp/models"

for cfg in glob.glob("/workspace/MagiCompiler/example/*/config.json"):
    with open(cfg) as f:
        data = json.load(f)

    data["text_encoder_path"] = f"{BASE}/t5"
    data["audio_model_path"] = f"{BASE}/audio"
    data["vae_path"] = f"{BASE}/vae"

    with open(cfg, "w") as f:
        json.dump(data, f, indent=2)

    print("Patched:", cfg)