Format import using isort --profile black --gitignore --lai 2 .
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import math
|
||||
from typing import Any, Optional
|
||||
|
||||
import math
|
||||
import torch
|
||||
from torch import nn
|
||||
from torch.nn import functional as F
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
コードと完全に一致している保証はない。あくまで参考程度とすること。
|
||||
"""
|
||||
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import torch
|
||||
from torch.nn import functional as F
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
|
||||
def init_weights(m: torch.nn.Module, mean: float = 0.0, std: float = 0.01) -> None:
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
from typing import Any, cast, Optional, Union
|
||||
from typing import Any, Optional, Union, cast
|
||||
|
||||
import torch
|
||||
from numpy.typing import NDArray
|
||||
|
||||
from style_bert_vits2.constants import Languages
|
||||
from style_bert_vits2.logging import logger
|
||||
from style_bert_vits2.models import commons
|
||||
from style_bert_vits2.models import utils
|
||||
from style_bert_vits2.models import commons, utils
|
||||
from style_bert_vits2.models.hyper_parameters import HyperParameters
|
||||
from style_bert_vits2.models.models import SynthesizerTrn
|
||||
from style_bert_vits2.models.models_jp_extra import (
|
||||
|
||||
@@ -7,10 +7,7 @@ from torch.nn import Conv1d, Conv2d, ConvTranspose1d
|
||||
from torch.nn import functional as F
|
||||
from torch.nn.utils import remove_weight_norm, spectral_norm, weight_norm
|
||||
|
||||
from style_bert_vits2.models import attentions
|
||||
from style_bert_vits2.models import commons
|
||||
from style_bert_vits2.models import modules
|
||||
from style_bert_vits2.models import monotonic_alignment
|
||||
from style_bert_vits2.models import attentions, commons, modules, monotonic_alignment
|
||||
from style_bert_vits2.nlp.symbols import NUM_LANGUAGES, NUM_TONES, SYMBOLS
|
||||
|
||||
|
||||
|
||||
@@ -7,10 +7,7 @@ from torch.nn import Conv1d, Conv2d, ConvTranspose1d
|
||||
from torch.nn import functional as F
|
||||
from torch.nn.utils import remove_weight_norm, spectral_norm, weight_norm
|
||||
|
||||
from style_bert_vits2.models import attentions
|
||||
from style_bert_vits2.models import commons
|
||||
from style_bert_vits2.models import modules
|
||||
from style_bert_vits2.models import monotonic_alignment
|
||||
from style_bert_vits2.models import attentions, commons, modules, monotonic_alignment
|
||||
from style_bert_vits2.nlp.symbols import NUM_LANGUAGES, NUM_TONES, SYMBOLS
|
||||
|
||||
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
コードと完全に一致している保証はない。あくまで参考程度とすること。
|
||||
"""
|
||||
|
||||
from typing import Any
|
||||
|
||||
import numba
|
||||
import torch
|
||||
from numpy import int32, float32, zeros
|
||||
from typing import Any
|
||||
from numpy import float32, int32, zeros
|
||||
|
||||
|
||||
def maximum_path(neg_cent: torch.Tensor, mask: torch.Tensor) -> torch.Tensor:
|
||||
|
||||
@@ -4,7 +4,7 @@ import os
|
||||
import re
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from typing import Any, Optional, Union, TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Any, Optional, Union
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
@@ -15,6 +15,7 @@ from style_bert_vits2.logging import logger
|
||||
from style_bert_vits2.models.utils import checkpoints # type: ignore
|
||||
from style_bert_vits2.models.utils import safetensors # type: ignore
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# tensorboard はライブラリとしてインストールされている場合は依存関係に含まれないため、型チェック時のみインポートする
|
||||
from torch.utils.tensorboard import SummaryWriter
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Optional, TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from style_bert_vits2.constants import Languages
|
||||
from style_bert_vits2.nlp.symbols import (
|
||||
@@ -7,6 +7,7 @@ from style_bert_vits2.nlp.symbols import (
|
||||
SYMBOLS,
|
||||
)
|
||||
|
||||
|
||||
# __init__.py は配下のモジュールをインポートした時点で実行される
|
||||
# PyTorch のインポートは重いので、型チェック時以外はインポートしない
|
||||
if TYPE_CHECKING:
|
||||
@@ -99,10 +100,10 @@ def cleaned_text_to_sequence(
|
||||
cleaned_phones: list[str], tones: list[int], language: Languages
|
||||
) -> tuple[list[int], list[int], list[int]]:
|
||||
"""
|
||||
テキスト文字列を、テキスト内の記号に対応する一連の ID に変換する
|
||||
音素リスト・アクセントリスト・言語を、テキスト内の対応する ID に変換する
|
||||
|
||||
Args:
|
||||
cleaned_phones (list[str]): clean_text() でクリーニングされた音素のリスト (?)
|
||||
cleaned_phones (list[str]): clean_text() でクリーニングされた音素のリスト
|
||||
tones (list[int]): 各音素のアクセント
|
||||
language (Languages): テキストの言語
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Style-Bert-VITS2 の学習・推論に必要な各言語ごとの BERT モデル
|
||||
"""
|
||||
|
||||
import gc
|
||||
from typing import cast, Optional, Union
|
||||
from typing import Optional, Union, cast
|
||||
|
||||
import torch
|
||||
from transformers import (
|
||||
|
||||
@@ -2,7 +2,7 @@ import re
|
||||
from pathlib import Path
|
||||
|
||||
import jieba.posseg as psg
|
||||
from pypinyin import lazy_pinyin, Style
|
||||
from pypinyin import Style, lazy_pinyin
|
||||
|
||||
from style_bert_vits2.nlp.chinese.tone_sandhi import ToneSandhi
|
||||
from style_bert_vits2.nlp.symbols import PUNCTUATIONS
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import jieba
|
||||
from pypinyin import lazy_pinyin
|
||||
from pypinyin import Style
|
||||
from pypinyin import Style, lazy_pinyin
|
||||
|
||||
|
||||
class ToneSandhi:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import re
|
||||
import unicodedata
|
||||
|
||||
from num2words import num2words
|
||||
|
||||
from style_bert_vits2.nlp.symbols import PUNCTUATIONS
|
||||
|
||||
@@ -17,12 +17,13 @@ from fastapi import HTTPException
|
||||
|
||||
from style_bert_vits2.constants import DEFAULT_USER_DICT_DIR
|
||||
from style_bert_vits2.nlp.japanese import pyopenjtalk_worker as pyopenjtalk
|
||||
from style_bert_vits2.nlp.japanese.user_dict.word_model import UserDictWord, WordTypes
|
||||
from style_bert_vits2.nlp.japanese.user_dict.part_of_speech_data import (
|
||||
MAX_PRIORITY,
|
||||
MIN_PRIORITY,
|
||||
part_of_speech_data,
|
||||
)
|
||||
from style_bert_vits2.nlp.japanese.user_dict.word_model import UserDictWord, WordTypes
|
||||
|
||||
|
||||
# root_dir = engine_root()
|
||||
# save_dir = get_save_dir()
|
||||
|
||||
@@ -14,6 +14,7 @@ from style_bert_vits2.nlp.japanese.user_dict.word_model import (
|
||||
WordTypes,
|
||||
)
|
||||
|
||||
|
||||
MIN_PRIORITY = USER_DICT_MIN_PRIORITY
|
||||
MAX_PRIORITY = USER_DICT_MAX_PRIORITY
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel, Field, validator
|
||||
|
||||
|
||||
USER_DICT_MIN_PRIORITY = 0
|
||||
USER_DICT_MAX_PRIORITY = 10
|
||||
|
||||
|
||||
Reference in New Issue
Block a user