init (not checked bat script yet)
This commit is contained in:
@@ -28,36 +28,3 @@ def get_bert(norm_text, word2ph, language, device, style_text=None, style_weight
|
||||
norm_text, word2ph, device, style_text, style_weight
|
||||
)
|
||||
return bert
|
||||
|
||||
|
||||
def check_bert_models():
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from config import config
|
||||
from .bert_utils import _check_bert
|
||||
|
||||
if config.mirror.lower() == "openi":
|
||||
import openi
|
||||
|
||||
kwargs = {"token": config.openi_token} if config.openi_token else {}
|
||||
openi.login(**kwargs)
|
||||
|
||||
with open("./bert/bert_models.json", "r") as fp:
|
||||
models = json.load(fp)
|
||||
for k, v in models.items():
|
||||
local_path = Path("./bert").joinpath(k)
|
||||
_check_bert(v["repo_id"], v["files"], local_path)
|
||||
|
||||
|
||||
def init_openjtalk():
|
||||
import platform
|
||||
|
||||
if platform.platform() == "Linux":
|
||||
import pyopenjtalk
|
||||
|
||||
pyopenjtalk.g2p("こんにちは,世界。")
|
||||
|
||||
|
||||
init_openjtalk()
|
||||
check_bert_models()
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
from pathlib import Path
|
||||
|
||||
from huggingface_hub import hf_hub_download
|
||||
|
||||
from config import config
|
||||
|
||||
|
||||
MIRROR: str = config.mirror
|
||||
|
||||
|
||||
def _check_bert(repo_id, files, local_path):
|
||||
for file in files:
|
||||
if not Path(local_path).joinpath(file).exists():
|
||||
if MIRROR.lower() == "openi":
|
||||
import openi
|
||||
|
||||
openi.model.download_model(
|
||||
"Stardust_minus/Bert-VITS2", repo_id.split("/")[-1], "./bert"
|
||||
)
|
||||
else:
|
||||
hf_hub_download(
|
||||
repo_id, file, local_dir=local_path, local_dir_use_symlinks=False
|
||||
)
|
||||
Reference in New Issue
Block a user