ssl-vocoder / rewrite_names.py
Wataru's picture
rewrite names so that the torch.hub download works when using multiple models
5dda46f
raw
history blame contribute delete
297 Bytes
import pathlib
import shutil
ckpt_paths = pathlib.Path("./").glob("**/model.ckpt")
for ckpt_path in ckpt_paths:
print(ckpt_path)
shutil.move(
ckpt_path,
f"{ckpt_path.parent/ ckpt_path.parent.stem}.ckpt"
)
print(f"{ckpt_path.parent/ ckpt_path.parent.stem}.ckpt")