Skip to content

Commit 368b40b

Browse files
authored
Merge pull request #69 from nadare881/multispeaker
server modeの実装
2 parents 3aed378 + c3dfc9d commit 368b40b

File tree

6 files changed

+726
-3
lines changed

6 files changed

+726
-3
lines changed

modules/models.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
from fairseq.models.hubert.hubert import HubertModel
88
from pydub import AudioSegment
99

10-
from lib.rvc.models import SynthesizerTrnMs256NSFSid, SynthesizerTrnMs256NSFSidNono
10+
from lib.rvc.models import (SynthesizerTrnMs256NSFSid,
11+
SynthesizerTrnMs256NSFSidNono)
1112
from lib.rvc.pipeline import VocalConvertPipeline
1213

1314
from .cmd_opts import opts
@@ -57,11 +58,18 @@ def update_state_dict(state_dict):
5758
i = i - n
5859
if len(state_dict["config"]) != 19 and key == "emb_channels":
5960
# backward compat.
60-
state_dict["params"][key] = 256
6161
n += 1
6262
continue
6363
state_dict["params"][key] = state_dict["config"][i]
6464

65+
if not "emb_channels" in state_dict["params"]:
66+
if state_dict.get("version", "v1") == "v1":
67+
state_dict["params"]["emb_channels"] = 256 # for backward compat.
68+
state_dict["embedder_output_layer"] = 9
69+
else:
70+
state_dict["params"]["emb_channels"] = 768 # for backward compat.
71+
state_dict["embedder_output_layer"] = 12
72+
6573

6674
class VoiceConvertModel:
6775
def __init__(self, model_name: str, state_dict: Dict[str, Any]) -> None:

0 commit comments

Comments
 (0)