Fix: maintain compatibility with Python 3.9
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
from typing import Optional
|
||||
|
||||
import torch
|
||||
from transformers import PreTrainedModel
|
||||
@@ -15,7 +16,7 @@ def extract_bert_feature(
|
||||
text: str,
|
||||
word2ph: list[int],
|
||||
device: torch.device | str,
|
||||
assist_text: str | None = None,
|
||||
assist_text: Optional[str] = None,
|
||||
assist_text_weight: float = 0.7,
|
||||
) -> torch.Tensor:
|
||||
"""
|
||||
@@ -25,7 +26,7 @@ def extract_bert_feature(
|
||||
text (str): 日本語のテキスト
|
||||
word2ph (list[int]): 元のテキストの各文字に音素が何個割り当てられるかを表すリスト
|
||||
device (torch.device | str): 推論に利用するデバイス
|
||||
assist_text (str | None, optional): 補助テキスト (デフォルト: None)
|
||||
assist_text (Optional[str], optional): 補助テキスト (デフォルト: None)
|
||||
assist_text_weight (float, optional): 補助テキストの重み (デフォルト: 0.7)
|
||||
|
||||
Returns:
|
||||
|
||||
Reference in New Issue
Block a user