不同版本Onnx模型导出适配 (#221)
* Add files via upload * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add files via upload * Add files via upload * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
7ddc560617
commit
698d2bfa5b
23
onnx_modules/V200/text/bert_utils.py
Normal file
23
onnx_modules/V200/text/bert_utils.py
Normal file
@@ -0,0 +1,23 @@
|
||||
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