Spaces:
Build error
Build error
Download checkpoints/cleaner.py from justyoung/DiffSinger: direct link, hf CLI and curl.
- Browser
- Download file 273 Bytes
-
https://huggingface.co/spaces/justyoung/DiffSinger/resolve/main/checkpoints/cleaner.py
- Command line
-
hf download hf://spaces/justyoung/DiffSinger/checkpoints/cleaner.py
-
curl -L -o cleaner.py https://huggingface.co/spaces/justyoung/DiffSinger/resolve/main/checkpoints/cleaner.py
273 Bytes
| import sys | |
| import torch | |
| if __name__ == '__main__': | |
| ckpt_path = sys.argv[1] | |
| checkpoint = torch.load(ckpt_path, map_location='cpu') | |
| checkpoint = {'state_dict': checkpoint['state_dict']} | |
| torch.save(checkpoint, ckpt_path, _use_new_zipfile_serialization=False) | |