jayzen33 commited on
Commit
8368deb
·
1 Parent(s): 91c35de
Files changed (1) hide show
  1. op.py +0 -25
op.py DELETED
@@ -1,25 +0,0 @@
1
- import torch
2
-
3
- # state_dict = torch.load("model_485000.pt", map_location="cpu")
4
-
5
- # new_state_dict = state_dict.copy()["ema_model_state_dict"]
6
- # print(state_dict.keys())
7
- # print(new_state_dict.keys())
8
-
9
- # torch.save(new_state_dict, "model_485000_ema.pt")
10
-
11
- ema_state_dict = torch.load("model_485000_ema.pt", map_location="cpu")
12
- print(ema_state_dict.keys())
13
-
14
- for k in list(ema_state_dict.keys()):
15
- if "initted" in k or "step" in k or "melody_mel_spec.mel_basis" in k:
16
- ema_state_dict.pop(k)
17
- continue
18
-
19
- if k.startswith("ema_model."):
20
- new_k = k.replace("ema_model.", "")
21
- ema_state_dict[new_k] = ema_state_dict.pop(k)
22
-
23
- # remove "initted", "step", "melody_mel_spec.mel_basis".
24
-
25
- torch.save(ema_state_dict, "model_485000_ema_fixed.pt")