Skip to content

Commit

Permalink
minor fixes on embedders
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisewf committed Aug 20, 2024
1 parent cc96aea commit 9a00d1c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
12 changes: 8 additions & 4 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,9 @@ def parse_arguments():
help=embedder_model_description,
choices=[
"contentvec",
"chinese-hubert-base",
"japanese-hubert-base",
"chinese-hubert-large",
"korean-hubert-base",
"custom",
],
default="contentvec",
Expand Down Expand Up @@ -797,8 +798,9 @@ def parse_arguments():
help=embedder_model_description,
choices=[
"contentvec",
"chinese-hubert-base",
"japanese-hubert-base",
"chinese-hubert-large",
"korean-hubert-base",
"custom",
],
default="contentvec",
Expand Down Expand Up @@ -981,8 +983,9 @@ def parse_arguments():
help=embedder_model_description,
choices=[
"contentvec",
"chinese-hubert-base",
"japanese-hubert-base",
"chinese-hubert-large",
"korean-hubert-base",
"custom",
],
default="contentvec",
Expand Down Expand Up @@ -1112,8 +1115,9 @@ def parse_arguments():
help=embedder_model_description,
choices=[
"contentvec",
"chinese-hubert-base",
"japanese-hubert-base",
"chinese-hubert-large",
"korean-hubert-base",
"custom",
],
default="contentvec",
Expand Down
12 changes: 7 additions & 5 deletions rvc/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@ def load_embedding(embedder_model, custom_embedder=None):
embedder_root = os.path.join(now_dir, "rvc", "models", "embedders")
embedding_list = {
"contentvec": os.path.join(embedder_root, "contentvec_base.pt"),
"japanese-hubert-base": os.path.join(embedder_root, "japanese-hubert-base.pt"),
"chinese-hubert-large": os.path.join(embedder_root, "chinese-hubert-large.pt"),
"chinese-hubert-base": os.path.join(embedder_root, "chinese_hubert_base.pt"),
"japanese-hubert-base": os.path.join(embedder_root, "japanese_hubert_base.pt"),
"korean-hubert-base": os.path.join(embedder_root, "korean_hubert_base.pt"),
}

online_embedders = {
"japanese-hubert-base": "https://huggingface.co/rinna/japanese-hubert-base/resolve/main/fairseq/model.pt",
"chinese-hubert-large": "https://huggingface.co/TencentGameMate/chinese-hubert-large/resolve/main/chinese-hubert-large-fairseq-ckpt.pt",
"chinese-hubert-base": "https://huggingface.co/IAHispano/Applio/resolve/main/Resources/embedders/chinese_hubert_base.pt",
"japanese-hubert-base": "https://huggingface.co/IAHispano/Applio/resolve/main/Resources/embedders/japanese_hubert_base.pt",
"korean-hubert-base": "https://huggingface.co/IAHispano/Applio/resolve/main/Resources/embedders/korean_hubert_base.pt",
}

if embedder_model == "custom":
Expand All @@ -108,7 +110,7 @@ def load_embedding(embedder_model, custom_embedder=None):
if embedder_model in online_embedders:
if not os.path.exists(model_path):
url = online_embedders[embedder_model]
print(f"\nDownloading {url} to {model_path}...")
print(f"Downloading {url} to {model_path}...")
wget.download(url, out=model_path)
else:
model_path = embedding_list["contentvec"]
Expand Down
6 changes: 4 additions & 2 deletions tabs/inference/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,9 @@ def inference_tab():
info=i18n("Model used for learning speaker embedding."),
choices=[
"contentvec",
"chinese-hubert-base",
"japanese-hubert-base",
"chinese-hubert-large",
"korean-hubert-base",
"custom",
],
value="contentvec",
Expand Down Expand Up @@ -906,8 +907,9 @@ def inference_tab():
info=i18n("Model used for learning speaker embedding."),
choices=[
"contentvec",
"chinese-hubert-base",
"japanese-hubert-base",
"chinese-hubert-large",
"korean-hubert-base",
"custom",
],
value="contentvec",
Expand Down
3 changes: 2 additions & 1 deletion tabs/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,9 @@ def train_tab():
info=i18n("Model used for learning speaker embedding."),
choices=[
"contentvec",
"chinese-hubert-base",
"japanese-hubert-base",
"chinese-hubert-large",
"korean-hubert-base",
"custom",
],
value="contentvec",
Expand Down
3 changes: 2 additions & 1 deletion tabs/tts/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,9 @@ def tts_tab():
info=i18n("Model used for learning speaker embedding."),
choices=[
"contentvec",
"chinese-hubert-base",
"japanese-hubert-base",
"chinese-hubert-large",
"korean-hubert-base",
"custom",
],
value="contentvec",
Expand Down

0 comments on commit 9a00d1c

Please sign in to comment.