Fix: maintain compatibility with Python 3.9

This commit is contained in:
tsukumi
2024-03-08 06:14:50 +00:00
parent 4a3519c4b9
commit 8add1b4202
10 changed files with 52 additions and 46 deletions

View File

@@ -1,4 +1,5 @@
import torch
from typing import Optional
from style_bert_vits2.constants import Languages
from style_bert_vits2.text_processing.symbols import (
@@ -16,7 +17,7 @@ def extract_bert_feature(
word2ph: list[int],
language: Languages,
device: torch.device | str,
assist_text: str | None = None,
assist_text: Optional[str] = None,
assist_text_weight: float = 0.7,
) -> torch.Tensor:
"""
@@ -27,7 +28,7 @@ def extract_bert_feature(
word2ph (list[int]): 元のテキストの各文字に音素が何個割り当てられるかを表すリスト
language (Languages): テキストの言語
device (torch.device | str): 推論に利用するデバイス
assist_text (str | None, optional): 補助テキスト (デフォルト: None)
assist_text (Optional[str], optional): 補助テキスト (デフォルト: None)
assist_text_weight (float, optional): 補助テキストの重み (デフォルト: 0.7)
Returns: