Add files via upload

This commit is contained in:
RVC-Boss 2023-06-06 22:32:32 +08:00 committed by GitHub
parent 9ff976b155
commit 6f1bc7d683
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 64 deletions

View File

@ -8,7 +8,7 @@ from i18n import I18nAuto
i18n = I18nAuto() i18n = I18nAuto()
def savee(ckpt, sr, if_f0, name, epoch, version): def savee(ckpt, sr, if_f0, name, epoch, version,hps):
try: try:
opt = OrderedDict() opt = OrderedDict()
opt["weight"] = {} opt["weight"] = {}
@ -16,69 +16,26 @@ def savee(ckpt, sr, if_f0, name, epoch, version):
if "enc_q" in key: if "enc_q" in key:
continue continue
opt["weight"][key] = ckpt[key].half() opt["weight"][key] = ckpt[key].half()
if sr == "40k": opt["config"]=[
opt["config"] = [ hpt.data.filter_length//2+1,
1025, 32,
32, hpt.model.inter_channels,
192, hpt.model.hidden_channels,
192, hpt.model.filter_channels,
768, hpt.model.n_heads,
2, hpt.model.n_layers,
6, hpt.model.kernel_size,
3, hpt.model.p_dropout,
0, hpt.model.resblock,
"1", hpt.model.resblock_kernel_sizes,
[3, 7, 11], hpt.model.resblock_dilation_sizes,
[[1, 3, 5], [1, 3, 5], [1, 3, 5]], hpt.model.upsample_rates,
[10, 10, 2, 2], hpt.model.upsample_initial_channel,
512, hpt.model.upsample_kernel_sizes,
[16, 16, 4, 4], hpt.model.spk_embed_dim,
109, hpt.model.gin_channels,
256, hpt.data.sampling_rate
40000, ]
]
elif sr == "48k":
opt["config"] = [
1025,
32,
192,
192,
768,
2,
6,
3,
0,
"1",
[3, 7, 11],
[[1, 3, 5], [1, 3, 5], [1, 3, 5]],
[10, 6, 2, 2, 2],
512,
[16, 16, 4, 4, 4],
109,
256,
48000,
]
elif sr == "32k":
opt["config"] = [
513,
32,
192,
192,
768,
2,
6,
3,
0,
"1",
[3, 7, 11],
[[1, 3, 5], [1, 3, 5], [1, 3, 5]],
[10, 4, 2, 2, 2],
512,
[16, 16, 4, 4, 4],
109,
256,
32000,
]
opt["info"] = "%sepoch" % epoch opt["info"] = "%sepoch" % epoch
opt["sr"] = sr opt["sr"] = sr
opt["f0"] = if_f0 opt["f0"] = if_f0