Fix: maintain compatibility with Python 3.9

This commit is contained in:
tsukumi
2024-03-08 08:45:56 +00:00
parent e2daa55000
commit a672aeefd9
6 changed files with 17 additions and 19 deletions

View File

@@ -9,13 +9,13 @@ from style_bert_vits2.nlp import bert_models
from style_bert_vits2.nlp.japanese.g2p import text_to_sep_kata
__models: dict[torch.device | str, PreTrainedModel] = {}
__models: dict[str, PreTrainedModel] = {}
def extract_bert_feature(
text: str,
word2ph: list[int],
device: torch.device | str,
device: str,
assist_text: Optional[str] = None,
assist_text_weight: float = 0.7,
) -> torch.Tensor:
@@ -25,7 +25,7 @@ def extract_bert_feature(
Args:
text (str): 日本語のテキスト
word2ph (list[int]): 元のテキストの各文字に音素が何個割り当てられるかを表すリスト
device (torch.device | str): 推論に利用するデバイス
device (str): 推論に利用するデバイス
assist_text (Optional[str], optional): 補助テキスト (デフォルト: None)
assist_text_weight (float, optional): 補助テキストの重み (デフォルト: 0.7)