Fix: problem with test failures

Style-Bert-VITS2 has been reported to not work with some PyTorch 2.2 series, but Python 3.12 is only supported in Torch >= 2.2, so Python 3.12 support is not provided for the time being
This commit is contained in:
tsukumi
2024-03-10 10:48:21 +00:00
parent afff154da4
commit 84b1dbe1b5
2 changed files with 8 additions and 6 deletions

View File

@@ -19,7 +19,6 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
]
dependencies = [
@@ -37,7 +36,7 @@ dependencies = [
'pydantic',
'pyopenjtalk-dict',
'pypinyin',
'pyworld',
# 'pyworld',
'safetensors',
'scipy',
'torch>=2.1,<2.2',
@@ -74,7 +73,7 @@ cov = [
]
[[tool.hatch.envs.test.matrix]]
python = ["3.9", "3.10", "3.11", "3.12"]
python = ["3.9", "3.10", "3.11"]
[tool.coverage.run]
source_pkgs = ["style_bert_vits2", "tests"]

View File

@@ -4,24 +4,27 @@ import os
import re
import subprocess
from pathlib import Path
from typing import Any, Optional, Union
from typing import Any, Optional, Union, TYPE_CHECKING
import numpy as np
import torch
from numpy.typing import NDArray
from scipy.io.wavfile import read
from torch.utils.tensorboard import SummaryWriter
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
__is_matplotlib_imported = False
def summarize(
writer: SummaryWriter,
writer: "SummaryWriter",
global_step: int,
scalars: dict[str, float] = {},
histograms: dict[str, Any] = {},