Spaces:
Runtime error
Runtime error
Download checkpoints/cleaner.py from kevinwang676/DiffSinger: direct link, hf CLI and curl.
- Browser
- Download file 273 Bytes
-
https://huggingface.co/spaces/kevinwang676/DiffSinger/resolve/b2c3cd9507bbd28045ff41b7570b841020679c16/checkpoints/cleaner.py
- Command line
-
hf download hf://spaces/kevinwang676/DiffSinger@b2c3cd9507bbd28045ff41b7570b841020679c16/checkpoints/cleaner.py
-
curl -L -o cleaner.py https://huggingface.co/spaces/kevinwang676/DiffSinger/resolve/b2c3cd9507bbd28045ff41b7570b841020679c16/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) | |