Magi / patch_configs.py
rahul7star's picture
Create patch_configs.py
f38384a verified
raw
history blame contribute delete
390 Bytes
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)