-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'coqui-ai:dev' into dev
- Loading branch information
Showing
9 changed files
with
183 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.21.1 | ||
0.21.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import json | ||
import os | ||
import re | ||
import tarfile | ||
import zipfile | ||
from pathlib import Path | ||
|
@@ -26,7 +27,6 @@ | |
} | ||
|
||
|
||
|
||
class ModelManager(object): | ||
tqdm_progress = None | ||
"""Manage TTS models defined in .models.json. | ||
|
@@ -276,13 +276,15 @@ def set_model_url(model_item: Dict): | |
model_item["model_url"] = model_item["hf_url"] | ||
elif "fairseq" in model_item["model_name"]: | ||
model_item["model_url"] = "https://coqui.gateway.scarf.sh/fairseq/" | ||
elif "xtts" in model_item["model_name"]: | ||
model_item["model_url"] = "https://coqui.gateway.scarf.sh/xtts/" | ||
return model_item | ||
|
||
def _set_model_item(self, model_name): | ||
# fetch model info from the dict | ||
model_type, lang, dataset, model = model_name.split("/") | ||
model_full_name = f"{model_type}--{lang}--{dataset}--{model}" | ||
if "fairseq" in model_name: | ||
model_type = "tts_models" | ||
lang = model_name.split("/")[1] | ||
model_item = { | ||
"model_type": "tts_models", | ||
"license": "CC BY-NC 4.0", | ||
|
@@ -291,10 +293,37 @@ def _set_model_item(self, model_name): | |
"description": "this model is released by Meta under Fairseq repo. Visit https://github.com/facebookresearch/fairseq/tree/main/examples/mms for more info.", | ||
} | ||
model_item["model_name"] = model_name | ||
elif "xtts" in model_name and len(model_name.split("/")) != 4: | ||
# loading xtts models with only model name (e.g. xtts_v2.0.2) | ||
# check model name has the version number with regex | ||
version_regex = r"v\d+\.\d+\.\d+" | ||
if re.search(version_regex, model_name): | ||
model_version = model_name.split("_")[-1] | ||
else: | ||
model_version = "main" | ||
model_type = "tts_models" | ||
lang = "multilingual" | ||
dataset = "multi-dataset" | ||
model = model_name | ||
model_item = { | ||
"default_vocoder": None, | ||
"license": "CPML", | ||
"contact": "[email protected]", | ||
"tos_required": True, | ||
"hf_url": [ | ||
f"https://coqui.gateway.scarf.sh/hf-coqui/XTTS-v2/{model_version}/model.pth", | ||
f"https://coqui.gateway.scarf.sh/hf-coqui/XTTS-v2/{model_version}/config.json", | ||
f"https://coqui.gateway.scarf.sh/hf-coqui/XTTS-v2/{model_version}/vocab.json", | ||
f"https://coqui.gateway.scarf.sh/hf-coqui/XTTS-v2/{model_version}/hash.md5", | ||
], | ||
} | ||
else: | ||
# get model from models.json | ||
model_type, lang, dataset, model = model_name.split("/") | ||
model_item = self.models_dict[model_type][lang][dataset][model] | ||
model_item["model_type"] = model_type | ||
|
||
model_full_name = f"{model_type}--{lang}--{dataset}--{model}" | ||
md5hash = model_item["model_hash"] if "model_hash" in model_item else None | ||
model_item = self.set_model_url(model_item) | ||
return model_item, model_full_name, model, md5hash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.