forked from fishaudio/Bert-VITS2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto download missing model for
bert_gen.py
(fishaudio#146)
* auto download missing model * support openi * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix wrong delete * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * pass pre-commit * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix repeat login --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4d6de24
commit 8609449
Showing
9 changed files
with
89 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"deberta-v2-large-japanese": { | ||
"repo_id": "ku-nlp/deberta-v2-large-japanese", | ||
"files": ["spm.model", "pytorch_model.bin"] | ||
}, | ||
"chinese-roberta-wwm-ext-large": { | ||
"repo_id": "hfl/chinese-roberta-wwm-ext-large", | ||
"files": ["pytorch_model.bin"] | ||
}, | ||
"deberta-v3-large": { | ||
"repo_id": "microsoft/deberta-v3-large", | ||
"files": ["spm.model", "pytorch_model.bin"] | ||
} | ||
} |
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
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 |
---|---|---|
@@ -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 | ||
) |
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