Spaces:
Running
Running
Download export_model.py from sukiru/BlueArchiveTTS: direct link, hf CLI and curl.
- Browser
- Download file 438 Bytes
-
https://huggingface.co/spaces/sukiru/BlueArchiveTTS/resolve/main/export_model.py
- Command line
-
hf download hf://spaces/sukiru/BlueArchiveTTS/export_model.py
-
curl -L -o export_model.py https://huggingface.co/spaces/sukiru/BlueArchiveTTS/resolve/main/export_model.py
438 Bytes
| import torch | |
| if __name__ == '__main__': | |
| model_path = "saved_model/11/model.pth" | |
| output_path = "saved_model/11/model1.pth" | |
| checkpoint_dict = torch.load(model_path, map_location='cpu') | |
| checkpoint_dict_new = {} | |
| for k, v in checkpoint_dict.items(): | |
| if k == "optimizer": | |
| print("remove optimizer") | |
| continue | |
| checkpoint_dict_new[k] = v | |
| torch.save(checkpoint_dict_new, output_path) | |