From 4f3bcfd2527bf232b76dce512bdb6b8c2c8b1730 Mon Sep 17 00:00:00 2001 From: tuna2134 Date: Thu, 23 Jul 2026 11:33:43 +0900 Subject: [PATCH 1/5] fix --- Dockerfile.deploy | 2 +- Dockerfile.train | 25 +++++++++++++++---------- README.md | 4 ++-- pyproject.toml | 16 +++++++--------- requirements-colab.txt | 6 +++--- requirements-infer.txt | 14 +++++++------- requirements.txt | 14 +++++++------- scripts/Install-Style-Bert-VITS2.bat | 4 ++-- scripts/Setup-Python.bat | 8 ++++---- 9 files changed, 48 insertions(+), 45 deletions(-) diff --git a/Dockerfile.deploy b/Dockerfile.deploy index 48c22d0..5e66f5e 100644 --- a/Dockerfile.deploy +++ b/Dockerfile.deploy @@ -2,7 +2,7 @@ # See https://huggingface.co/docs/hub/spaces-sdks-docker-first-demo -FROM python:3.10 +FROM python:3.12 RUN useradd -m -u 1000 user diff --git a/Dockerfile.train b/Dockerfile.train index 59d5655..2b6a9e9 100644 --- a/Dockerfile.train +++ b/Dockerfile.train @@ -5,8 +5,8 @@ # 主なバージョン等 # Ubuntu 22.04 -# Python 3.10 -# PyTorch 2.1.2 (CUDA 11.8) +# Python 3.12 +# PyTorch 2.7.x (CUDA 11.8) # CUDA Toolkit 12.0, CUDNN 8.9.7 @@ -24,7 +24,7 @@ ENV SHELL=/bin/bash ENV DEBIAN_FRONTEND=noninteractive ENV APT_INSTALL="apt-get install -y --no-install-recommends" -ENV PIP_INSTALL="python3 -m pip --no-cache-dir install --upgrade" +ENV PIP_INSTALL="python3.12 -m pip --no-cache-dir install --upgrade" ENV GIT_CLONE="git clone --depth 10" # ================================================================== @@ -44,10 +44,14 @@ RUN apt-get update && \ nano \ ffmpeg \ software-properties-common \ - gnupg \ - python3 \ - python3-pip \ - python3-dev + gnupg + +RUN add-apt-repository ppa:deadsnakes/ppa && \ + apt-get update && \ + $APT_INSTALL python3.12 python3.12-dev && \ + curl -sS https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py && \ + python3.12 /tmp/get-pip.py && \ + rm /tmp/get-pip.py # ================================================================== # Git-lfs @@ -57,8 +61,9 @@ RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.d $APT_INSTALL git-lfs -# Add symlink so python and python3 commands use same python3.9 executable -RUN ln -s /usr/bin/python3 /usr/local/bin/python +# Add symlinks so python and python3 commands use Python 3.12. +RUN ln -s /usr/bin/python3.12 /usr/local/bin/python && \ + ln -s /usr/bin/python3.12 /usr/local/bin/python3 # ================================================================== # Installing CUDA packages (CUDA Toolkit 12.0 and CUDNN 8.9.7) @@ -106,4 +111,4 @@ RUN rm /tmp/requirements.txt EXPOSE 8888 6006 -CMD jupyter lab --allow-root --ip=0.0.0.0 --no-browser --ServerApp.trust_xheaders=True --ServerApp.disable_check_xsrf=False --ServerApp.allow_remote_access=True --ServerApp.allow_origin='*' --ServerApp.allow_credentials=True \ No newline at end of file +CMD jupyter lab --allow-root --ip=0.0.0.0 --no-browser --ServerApp.trust_xheaders=True --ServerApp.disable_check_xsrf=False --ServerApp.allow_remote_access=True --ServerApp.allow_origin='*' --ServerApp.allow_credentials=True diff --git a/README.md b/README.md index ec8117f..a58165f 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,9 @@ Pythonの仮想環境・パッケージ管理ツールである[uv](https://gith powershell -c "irm https://astral.sh/uv/install.ps1 | iex" git clone https://github.com/litagin02/Style-Bert-VITS2.git cd Style-Bert-VITS2 -uv venv venv +uv venv --python 3.12 venv venv\Scripts\activate -uv pip install "torch<2.4" "torchaudio<2.4" --index-url https://download.pytorch.org/whl/cu118 +uv pip install "torch>=2.7,<2.8" "torchaudio>=2.7,<2.8" --index-url https://download.pytorch.org/whl/cu118 uv pip install -r requirements.txt python initialize.py # 必要なモデルとデフォルトTTSモデルをダウンロード ``` diff --git a/pyproject.toml b/pyproject.toml index 861ab85..ae10dbe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "style-bert-vits2" dynamic = ["version"] description = "Style-Bert-VITS2: Bert-VITS2 with more controllable voice styles." readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.12" license = "AGPL-3.0" keywords = [] authors = [ @@ -16,9 +16,7 @@ authors = [ classifiers = [ "Development Status :: 4 - Beta", "Programming Language :: Python", - "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 = [ @@ -27,10 +25,10 @@ dependencies = [ "g2p_en", "jieba", "loguru", - "nltk<=3.8.1", + "nltk>=3.9,<4", "num2words", "numba", - "numpy<2", + "numpy>=1.26,<3", "onnxruntime", "pydantic>=2.0", "pyopenjtalk-dict", @@ -43,7 +41,7 @@ dependencies = [ [project.optional-dependencies] torch = [ "accelerate", - "torch>=2.1", + "torch>=2.7,<2.8", ] [project.urls] @@ -93,7 +91,7 @@ cov-report = ["- coverage combine", "coverage report"] # Usage: `hatch run test:cov` cov = ["test-cov", "cov-report"] [[tool.hatch.envs.test.matrix]] -python = ["3.9", "3.10", "3.11"] +python = ["3.12"] # for ONNX inference (without PyTorch dependency) [tool.hatch.envs.test-onnx] @@ -120,7 +118,7 @@ cov-report = ["- coverage combine", "coverage report"] # Usage: `hatch run test-onnx:cov` cov = ["test-cov", "cov-report"] [[tool.hatch.envs.test-onnx.matrix]] -python = ["3.9", "3.10", "3.11"] +python = ["3.12"] [tool.hatch.envs.style] detached = true diff --git a/requirements-colab.txt b/requirements-colab.txt index 3b7d1dc..b04e4de 100644 --- a/requirements-colab.txt +++ b/requirements-colab.txt @@ -4,11 +4,11 @@ cn2an g2p_en gradio>=4.32 jieba -librosa==0.9.2 +librosa>=0.11,<1 loguru -nltk<=3.8.1 +nltk>=3.9,<4 num2words -numpy<2 +numpy>=1.26,<3 onnx onnxconverter-common onnxruntime diff --git a/requirements-infer.txt b/requirements-infer.txt index ad8e4df..d650653 100644 --- a/requirements-infer.txt +++ b/requirements-infer.txt @@ -1,23 +1,23 @@ accelerate cmudict cn2an -# faster-whisper==0.10.1 +# faster-whisper>=1.2,<2 g2p_en GPUtil gradio>=4.32 jieba -# librosa==0.9.2 +# librosa>=0.11,<1 loguru -nltk<=3.8.1 +nltk>=3.9,<4 num2words -numpy<2 +numpy>=1.26,<3 onnx onnxconverter-common onnxruntime onnxruntime-directml; sys_platform == 'win32' onnxruntime-gpu; sys_platform != 'darwin' onnxsim-prebuilt -# protobuf==4.25 +# protobuf>=5,<7 psutil # punctuators pyannote.audio>=3.1.0 @@ -27,7 +27,7 @@ pypinyin pyworld-prebuilt # stable_ts # tensorboard -torch<2.4 -torchaudio<2.4 +torch>=2.7,<2.8 +torchaudio>=2.7,<2.8 transformers umap-learn diff --git a/requirements.txt b/requirements.txt index 180e061..f7df7c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,23 +1,23 @@ accelerate cmudict cn2an -faster-whisper==0.10.1 +faster-whisper>=1.2,<2 g2p_en GPUtil gradio>=4.32 jieba -librosa==0.9.2 +librosa>=0.11,<1 loguru -nltk<=3.8.1 +nltk>=3.9,<4 num2words -numpy<2 +numpy>=1.26,<3 onnx onnxconverter-common onnxruntime onnxruntime-directml; sys_platform == 'win32' onnxruntime-gpu; sys_platform != 'darwin' onnxsim-prebuilt -protobuf==4.25 +protobuf>=5,<7 psutil punctuators pyannote.audio>=3.1.0 @@ -27,7 +27,7 @@ pypinyin pyworld-prebuilt stable_ts tensorboard -torch<2.4 -torchaudio<2.4 +torch>=2.7,<2.8 +torchaudio>=2.7,<2.8 transformers umap-learn diff --git a/scripts/Install-Style-Bert-VITS2.bat b/scripts/Install-Style-Bert-VITS2.bat index dafe3e2..fedd2a8 100644 --- a/scripts/Install-Style-Bert-VITS2.bat +++ b/scripts/Install-Style-Bert-VITS2.bat @@ -110,8 +110,8 @@ if !errorlevel! neq 0 ( pause & popd & exit /b !errorlevel! ) echo -------------------------------------------------- echo Installing PyTorch... echo -------------------------------------------------- -echo Executing: uv pip install "torch<2.4" "torchaudio<2.4" --index-url https://download.pytorch.org/whl/cu118 -uv pip install "torch<2.4" "torchaudio<2.4" --index-url https://download.pytorch.org/whl/cu118 +echo Executing: uv pip install "torch>=2.7,<2.8" "torchaudio>=2.7,<2.8" --index-url https://download.pytorch.org/whl/cu118 +uv pip install "torch>=2.7,<2.8" "torchaudio>=2.7,<2.8" --index-url https://download.pytorch.org/whl/cu118 if !errorlevel! neq 0 ( pause & popd & exit /b !errorlevel! ) echo -------------------------------------------------- diff --git a/scripts/Setup-Python.bat b/scripts/Setup-Python.bat index c5c99e7..59e8836 100644 --- a/scripts/Setup-Python.bat +++ b/scripts/Setup-Python.bat @@ -40,8 +40,8 @@ if not exist "%PYTHON_DIR%"\ ( echo -------------------------------------------------- echo Downloading Python... echo -------------------------------------------------- - echo Executing: %CURL_CMD% -o python.zip https://www.python.org/ftp/python/3.10.11/python-3.10.11-embed-amd64.zip - %CURL_CMD% -o python.zip https://www.python.org/ftp/python/3.10.11/python-3.10.11-embed-amd64.zip + echo Executing: %CURL_CMD% -o python.zip https://www.python.org/ftp/python/3.12.10/python-3.12.10-embed-amd64.zip + %CURL_CMD% -o python.zip https://www.python.org/ftp/python/3.12.10/python-3.12.10-embed-amd64.zip if !errorlevel! neq 0 ( pause & exit /b !errorlevel! ) echo -------------------------------------------------- @@ -61,8 +61,8 @@ if not exist "%PYTHON_DIR%"\ ( echo -------------------------------------------------- echo Enabling 'site' module in the embedded Python environment... echo -------------------------------------------------- - echo Executing: %PS_CMD% "&{(Get-Content '%PYTHON_DIR%/python310._pth') -creplace '#import site', 'import site' | Set-Content '%PYTHON_DIR%/python310._pth' }" - %PS_CMD% "&{(Get-Content '%PYTHON_DIR%/python310._pth') -creplace '#import site', 'import site' | Set-Content '%PYTHON_DIR%/python310._pth' }" + echo Executing: %PS_CMD% "&{(Get-Content '%PYTHON_DIR%/python312._pth') -creplace '#import site', 'import site' | Set-Content '%PYTHON_DIR%/python312._pth' }" + %PS_CMD% "&{(Get-Content '%PYTHON_DIR%/python312._pth') -creplace '#import site', 'import site' | Set-Content '%PYTHON_DIR%/python312._pth' }" if !errorlevel! neq 0 ( pause & exit /b !errorlevel! ) echo -------------------------------------------------- From 9cfaa27f3f3d68573b22d64cb7a2019a15f80ce9 Mon Sep 17 00:00:00 2001 From: tuna2134 Date: Thu, 23 Jul 2026 11:51:07 +0900 Subject: [PATCH 2/5] fix --- bert_gen.py | 2 +- data_utils.py | 4 +- style_bert_vits2/models/utils/checkpoints.py | 4 +- .../nlp/japanese/user_dict/word_model.py | 36 +++++++----- tests/test_library_compatibility.py | 58 +++++++++++++++++++ 5 files changed, 87 insertions(+), 17 deletions(-) create mode 100644 tests/test_library_compatibility.py diff --git a/bert_gen.py b/bert_gen.py index 49be3e6..279b2bb 100644 --- a/bert_gen.py +++ b/bert_gen.py @@ -55,7 +55,7 @@ def process_line(x: tuple[str, bool]): bert_path = wav_path.replace(".WAV", ".wav").replace(".wav", ".bert.pt") try: - bert = torch.load(bert_path) + bert = torch.load(bert_path, weights_only=True) assert bert.shape[-1] == len(phone) except Exception: bert = extract_bert_feature(text, word2ph, Languages(language_str), device) diff --git a/data_utils.py b/data_utils.py index 54d4e27..1bb6364 100644 --- a/data_utils.py +++ b/data_utils.py @@ -129,7 +129,7 @@ class TextAudioSpeakerLoader(torch.utils.data.Dataset): if self.use_mel_spec_posterior: spec_filename = spec_filename.replace(".spec.pt", ".mel.pt") try: - spec = torch.load(spec_filename) + spec = torch.load(spec_filename, weights_only=True) except: if self.use_mel_spec_posterior: spec = mel_spectrogram_torch( @@ -168,7 +168,7 @@ class TextAudioSpeakerLoader(torch.utils.data.Dataset): word2ph[0] += 1 bert_path = wav_path.replace(".wav", ".bert.pt") try: - bert_ori = torch.load(bert_path) + bert_ori = torch.load(bert_path, weights_only=True) assert bert_ori.shape[-1] == len(phone) except Exception as e: logger.warning("Bert load Failed") diff --git a/style_bert_vits2/models/utils/checkpoints.py b/style_bert_vits2/models/utils/checkpoints.py index 756586c..26a8cfa 100644 --- a/style_bert_vits2/models/utils/checkpoints.py +++ b/style_bert_vits2/models/utils/checkpoints.py @@ -32,7 +32,9 @@ def load_checkpoint( """ assert os.path.isfile(checkpoint_path) - checkpoint_dict = torch.load(checkpoint_path, map_location=device) + checkpoint_dict = torch.load( + checkpoint_path, map_location=device, weights_only=True + ) iteration = checkpoint_dict["iteration"] learning_rate = checkpoint_dict["learning_rate"] logger.info( diff --git a/style_bert_vits2/nlp/japanese/user_dict/word_model.py b/style_bert_vits2/nlp/japanese/user_dict/word_model.py index 43420da..8a6780d 100644 --- a/style_bert_vits2/nlp/japanese/user_dict/word_model.py +++ b/style_bert_vits2/nlp/japanese/user_dict/word_model.py @@ -9,7 +9,13 @@ from enum import Enum from re import findall, fullmatch from typing import List, Optional -from pydantic import BaseModel, Field, validator +from pydantic import ( + BaseModel, + ConfigDict, + Field, + ValidationInfo, + field_validator, +) USER_DICT_MIN_PRIORITY = 0 @@ -39,11 +45,11 @@ class UserDictWord(BaseModel): mora_count: Optional[int] = Field(title="モーラ数", default=None) accent_associative_rule: str = Field(title="アクセント結合規則") - class Config: - validate_assignment = True + model_config = ConfigDict(validate_assignment=True, validate_default=True) - @validator("surface") - def convert_to_zenkaku(cls, surface): + @field_validator("surface") + @classmethod + def convert_to_zenkaku(cls, surface: str) -> str: return surface.translate( str.maketrans( "".join(chr(0x21 + i) for i in range(94)), @@ -51,8 +57,9 @@ class UserDictWord(BaseModel): ) ) - @validator("pronunciation", pre=True) - def check_is_katakana(cls, pronunciation): + @field_validator("pronunciation", mode="before") + @classmethod + def check_is_katakana(cls, pronunciation: str) -> str: if not fullmatch(r"[ァ-ヴー]+", pronunciation): raise ValueError("発音は有効なカタカナでなくてはいけません。") sutegana = ["ァ", "ィ", "ゥ", "ェ", "ォ", "ャ", "ュ", "ョ", "ヮ", "ッ"] @@ -75,9 +82,12 @@ class UserDictWord(BaseModel): ) return pronunciation - @validator("mora_count", pre=True, always=True) - def check_mora_count_and_accent_type(cls, mora_count, values): - if "pronunciation" not in values or "accent_type" not in values: + @field_validator("mora_count", mode="before") + @classmethod + def check_mora_count_and_accent_type( + cls, mora_count: Optional[int], info: ValidationInfo + ) -> Optional[int]: + if "pronunciation" not in info.data or "accent_type" not in info.data: # 適切な場所でエラーを出すようにする return mora_count @@ -91,14 +101,14 @@ class UserDictWord(BaseModel): mora_count = len( findall( f"(?:{rule_others}|{rule_line_i}|{rule_line_u}|{rule_one_mora})", - values["pronunciation"], + info.data["pronunciation"], ) ) - if not 0 <= values["accent_type"] <= mora_count: + if not 0 <= info.data["accent_type"] <= mora_count: raise ValueError( "誤ったアクセント型です({})。 expect: 0 <= accent_type <= {}".format( - values["accent_type"], mora_count + info.data["accent_type"], mora_count ) ) return mora_count diff --git a/tests/test_library_compatibility.py b/tests/test_library_compatibility.py new file mode 100644 index 0000000..578fb3e --- /dev/null +++ b/tests/test_library_compatibility.py @@ -0,0 +1,58 @@ +from pathlib import Path + +import pytest +import torch +from pydantic import ValidationError + +from style_bert_vits2.models.utils.checkpoints import load_checkpoint, save_checkpoint +from style_bert_vits2.nlp.japanese.user_dict.word_model import UserDictWord + + +def _user_dict_word(**overrides: object) -> UserDictWord: + values = { + "surface": "test", + "priority": 5, + "part_of_speech": "名詞", + "part_of_speech_detail_1": "一般", + "part_of_speech_detail_2": "*", + "part_of_speech_detail_3": "*", + "inflectional_type": "*", + "inflectional_form": "*", + "stem": "*", + "yomi": "テスト", + "pronunciation": "テスト", + "accent_type": 1, + "accent_associative_rule": "*", + } + values.update(overrides) + return UserDictWord.model_validate(values) + + +def test_user_dict_word_uses_pydantic_v2_validation() -> None: + word = _user_dict_word() + + assert word.surface == "test" + assert word.mora_count == 3 + + with pytest.raises(ValidationError): + _user_dict_word(pronunciation="てすと") + + +def test_checkpoint_round_trip_with_safe_torch_load(tmp_path: Path) -> None: + checkpoint_path = tmp_path / "checkpoint.pth" + source = torch.nn.Linear(2, 1) + optimizer = torch.optim.AdamW(source.parameters()) + save_checkpoint(source, optimizer, 1e-4, 12, checkpoint_path) + + destination = torch.nn.Linear(2, 1) + destination_optimizer = torch.optim.AdamW(destination.parameters()) + _, _, learning_rate, iteration = load_checkpoint( + checkpoint_path, destination, destination_optimizer + ) + + assert learning_rate == 1e-4 + assert iteration == 12 + for source_parameter, destination_parameter in zip( + source.parameters(), destination.parameters() + ): + assert torch.equal(source_parameter, destination_parameter) From fd72a193846078cbc0eace756ec4825c629d14f7 Mon Sep 17 00:00:00 2001 From: tuna2134 Date: Thu, 23 Jul 2026 12:06:17 +0900 Subject: [PATCH 3/5] bump --- app.py | 3 ++- gradio_tabs/convert_onnx.py | 4 ++-- gradio_tabs/dataset.py | 4 ++-- gradio_tabs/inference.py | 4 ++-- gradio_tabs/merge.py | 4 ++-- gradio_tabs/style_vectors.py | 4 ++-- gradio_tabs/train.py | 4 ++-- pyproject.toml | 4 ++-- requirements-colab.txt | 4 ++-- requirements-infer.txt | 4 ++-- requirements.txt | 4 ++-- 11 files changed, 22 insertions(+), 21 deletions(-) diff --git a/app.py b/app.py index 4da8e7a..1773378 100644 --- a/app.py +++ b/app.py @@ -49,7 +49,7 @@ model_holder = TTSModelHolder( ignore_onnx=True, ) -with gr.Blocks(theme=GRADIO_THEME) as app: +with gr.Blocks() as app: gr.Markdown(f"# Style-Bert-VITS2 WebUI (version {VERSION})") with gr.Tabs(): with gr.Tab("音声合成"): @@ -66,6 +66,7 @@ with gr.Blocks(theme=GRADIO_THEME) as app: create_onnx_app(model_holder=model_holder) app.launch( + theme=GRADIO_THEME, server_name=args.host, server_port=args.port, inbrowser=not args.no_autolaunch, diff --git a/gradio_tabs/convert_onnx.py b/gradio_tabs/convert_onnx.py index 47f8276..8ba1dec 100644 --- a/gradio_tabs/convert_onnx.py +++ b/gradio_tabs/convert_onnx.py @@ -52,7 +52,7 @@ def create_onnx_app(model_holder: TTSModelHolder) -> gr.Blocks: initial_id = 0 initial_pth_files = get_model_files(model_names[initial_id]) - with gr.Blocks(theme=GRADIO_THEME) as app: + with gr.Blocks() as app: gr.Markdown(initial_md) with gr.Row(): with gr.Column(): @@ -100,4 +100,4 @@ if __name__ == "__main__": assets_root = path_config.assets_root model_holder = TTSModelHolder(assets_root, "cpu", "", ignore_onnx=True) app = create_onnx_app(model_holder) - app.launch(inbrowser=True) + app.launch(inbrowser=True, theme=GRADIO_THEME) diff --git a/gradio_tabs/dataset.py b/gradio_tabs/dataset.py index abedf62..3c722c8 100644 --- a/gradio_tabs/dataset.py +++ b/gradio_tabs/dataset.py @@ -115,7 +115,7 @@ Style-Bert-VITS2の学習用データセットを作成するためのツール def create_dataset_app() -> gr.Blocks: - with gr.Blocks(theme=GRADIO_THEME) as app: + with gr.Blocks() as app: gr.Markdown( "**既に1ファイル2-12秒程度の音声ファイル集とその書き起こしデータがある場合は、このタブは使用せずに学習できます。**" ) @@ -273,4 +273,4 @@ def create_dataset_app() -> gr.Blocks: if __name__ == "__main__": app = create_dataset_app() - app.launch(inbrowser=True) + app.launch(inbrowser=True, theme=GRADIO_THEME) diff --git a/gradio_tabs/inference.py b/gradio_tabs/inference.py index 7898283..02d4d58 100644 --- a/gradio_tabs/inference.py +++ b/gradio_tabs/inference.py @@ -361,7 +361,7 @@ def create_inference_app(model_holder: TTSModelHolder) -> gr.Blocks: initial_id = 0 initial_pth_files = get_model_files(model_names[initial_id]) - with gr.Blocks(theme=GRADIO_THEME) as app: + with gr.Blocks() as app: gr.Markdown(initial_md) gr.Markdown(terms_of_use_md) null_models = gr.State({}) @@ -742,4 +742,4 @@ if __name__ == "__main__": assets_root, device, torch_device_to_onnx_providers(device) ) app = create_inference_app(model_holder) - app.launch(inbrowser=True) + app.launch(inbrowser=True, theme=GRADIO_THEME) diff --git a/gradio_tabs/merge.py b/gradio_tabs/merge.py index 75cc661..89536d0 100644 --- a/gradio_tabs/merge.py +++ b/gradio_tabs/merge.py @@ -1042,7 +1042,7 @@ def create_merge_app(model_holder: TTSModelHolder) -> gr.Blocks: str(f) for f in model_holder.model_files_dict[model_names[initial_id]] ] - with gr.Blocks(theme=GRADIO_THEME) as app: + with gr.Blocks() as app: gr.Markdown( "複数のStyle-Bert-VITS2モデルから、声質・話し方・話す速さを取り替えたり混ぜたり引いたりして新しいモデルを作成できます。" ) @@ -1554,4 +1554,4 @@ if __name__ == "__main__": assets_root, device, torch_device_to_onnx_providers(device), ignore_onnx=True ) app = create_merge_app(model_holder) - app.launch(inbrowser=True) + app.launch(inbrowser=True, theme=GRADIO_THEME) diff --git a/gradio_tabs/style_vectors.py b/gradio_tabs/style_vectors.py index 46e8a74..e81c960 100644 --- a/gradio_tabs/style_vectors.py +++ b/gradio_tabs/style_vectors.py @@ -416,7 +416,7 @@ https://ja.wikipedia.org/wiki/DBSCAN def create_style_vectors_app(): - with gr.Blocks(theme=GRADIO_THEME) as app: + with gr.Blocks() as app: with gr.Accordion("使い方", open=False): gr.Markdown(how_to_md) model_name = gr.Textbox(placeholder="your_model_name", label="モデル名") @@ -583,4 +583,4 @@ def create_style_vectors_app(): if __name__ == "__main__": app = create_style_vectors_app() - app.launch(inbrowser=True) + app.launch(inbrowser=True, theme=GRADIO_THEME) diff --git a/gradio_tabs/train.py b/gradio_tabs/train.py index 61dfda8..303c858 100644 --- a/gradio_tabs/train.py +++ b/gradio_tabs/train.py @@ -492,7 +492,7 @@ english_teacher.wav|Mary|EN|How are you? I'm fine, thank you, and you? def create_train_app(): - with gr.Blocks(theme=GRADIO_THEME).queue() as app: + with gr.Blocks().queue() as app: gr.Markdown(change_log_md) with gr.Accordion("使い方", open=False): gr.Markdown(how_to_md) @@ -852,4 +852,4 @@ def create_train_app(): if __name__ == "__main__": app = create_train_app() - app.launch(inbrowser=True) + app.launch(inbrowser=True, theme=GRADIO_THEME) diff --git a/pyproject.toml b/pyproject.toml index ae10dbe..860ba79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,10 +28,10 @@ dependencies = [ "nltk>=3.9,<4", "num2words", "numba", - "numpy>=1.26,<3", + "numpy>=2,<2.5", "onnxruntime", "pydantic>=2.0", - "pyopenjtalk-dict", + "pyopenjtalk-plus", "pypinyin", "pyworld-prebuilt", "safetensors", diff --git a/requirements-colab.txt b/requirements-colab.txt index b04e4de..388c177 100644 --- a/requirements-colab.txt +++ b/requirements-colab.txt @@ -8,7 +8,7 @@ librosa>=0.11,<1 loguru nltk>=3.9,<4 num2words -numpy>=1.26,<3 +numpy>=2,<2.5 onnx onnxconverter-common onnxruntime @@ -16,7 +16,7 @@ onnxruntime-gpu onnxsim-prebuilt pyannote.audio>=3.1.0 pyloudnorm -pyopenjtalk-dict +pyopenjtalk-plus pypinyin pyworld-prebuilt torch diff --git a/requirements-infer.txt b/requirements-infer.txt index d650653..ecfd754 100644 --- a/requirements-infer.txt +++ b/requirements-infer.txt @@ -10,7 +10,7 @@ jieba loguru nltk>=3.9,<4 num2words -numpy>=1.26,<3 +numpy>=2,<2.5 onnx onnxconverter-common onnxruntime @@ -22,7 +22,7 @@ psutil # punctuators pyannote.audio>=3.1.0 # pyloudnorm -pyopenjtalk-dict +pyopenjtalk-plus pypinyin pyworld-prebuilt # stable_ts diff --git a/requirements.txt b/requirements.txt index f7df7c5..c0690aa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ librosa>=0.11,<1 loguru nltk>=3.9,<4 num2words -numpy>=1.26,<3 +numpy>=2,<2.5 onnx onnxconverter-common onnxruntime @@ -22,7 +22,7 @@ psutil punctuators pyannote.audio>=3.1.0 pyloudnorm -pyopenjtalk-dict +pyopenjtalk-plus pypinyin pyworld-prebuilt stable_ts From a8b36ba33f7a6aa0ff9f88b8ae1b404b007d452d Mon Sep 17 00:00:00 2001 From: tuna2134 Date: Thu, 23 Jul 2026 14:51:23 +0900 Subject: [PATCH 4/5] fix --- slice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slice.py b/slice.py index b231ce8..657263f 100644 --- a/slice.py +++ b/slice.py @@ -171,7 +171,7 @@ if __name__ == "__main__": # モデルをダウンロードしておく _ = torch.hub.load( - repo_or_dir="litagin02/silero-vad", + repo_or_dir="snakers4/silero-vad", model="silero_vad", onnx=True, trust_repo=True, @@ -186,7 +186,7 @@ if __name__ == "__main__": ): # logger.debug("Worker started.") vad_model, utils = torch.hub.load( - repo_or_dir="litagin02/silero-vad", + repo_or_dir="snakers4/silero-vad", model="silero_vad", onnx=True, trust_repo=True, From 1785e815090c508d1e5291141b30d4b2dd8a502a Mon Sep 17 00:00:00 2001 From: tuna2134 Date: Thu, 23 Jul 2026 15:59:17 +0900 Subject: [PATCH 5/5] fix --- README.md | 2 +- pyproject.toml | 2 +- requirements-colab.txt | 2 +- requirements-infer.txt | 6 +++--- requirements.txt | 6 +++--- scripts/Install-Style-Bert-VITS2.bat | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a58165f..ba4918c 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ git clone https://github.com/litagin02/Style-Bert-VITS2.git cd Style-Bert-VITS2 uv venv --python 3.12 venv venv\Scripts\activate -uv pip install "torch>=2.7,<2.8" "torchaudio>=2.7,<2.8" --index-url https://download.pytorch.org/whl/cu118 +uv pip install "torch>=2.8,<2.9" "torchaudio>=2.8,<2.9" --index-url https://download.pytorch.org/whl/cu126 uv pip install -r requirements.txt python initialize.py # 必要なモデルとデフォルトTTSモデルをダウンロード ``` diff --git a/pyproject.toml b/pyproject.toml index 860ba79..250bada 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ dependencies = [ [project.optional-dependencies] torch = [ "accelerate", - "torch>=2.7,<2.8", + "torch>=2.8,<2.9", ] [project.urls] diff --git a/requirements-colab.txt b/requirements-colab.txt index 388c177..f6e1f16 100644 --- a/requirements-colab.txt +++ b/requirements-colab.txt @@ -14,7 +14,7 @@ onnxconverter-common onnxruntime onnxruntime-gpu onnxsim-prebuilt -pyannote.audio>=3.1.0 +pyannote.audio>=4,<5 pyloudnorm pyopenjtalk-plus pypinyin diff --git a/requirements-infer.txt b/requirements-infer.txt index ecfd754..eaae793 100644 --- a/requirements-infer.txt +++ b/requirements-infer.txt @@ -20,14 +20,14 @@ onnxsim-prebuilt # protobuf>=5,<7 psutil # punctuators -pyannote.audio>=3.1.0 +pyannote.audio>=4,<5 # pyloudnorm pyopenjtalk-plus pypinyin pyworld-prebuilt # stable_ts # tensorboard -torch>=2.7,<2.8 -torchaudio>=2.7,<2.8 +torch>=2.8,<2.9 +torchaudio>=2.8,<2.9 transformers umap-learn diff --git a/requirements.txt b/requirements.txt index c0690aa..385fd22 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,14 +20,14 @@ onnxsim-prebuilt protobuf>=5,<7 psutil punctuators -pyannote.audio>=3.1.0 +pyannote.audio>=4,<5 pyloudnorm pyopenjtalk-plus pypinyin pyworld-prebuilt stable_ts tensorboard -torch>=2.7,<2.8 -torchaudio>=2.7,<2.8 +torch>=2.8,<2.9 +torchaudio>=2.8,<2.9 transformers umap-learn diff --git a/scripts/Install-Style-Bert-VITS2.bat b/scripts/Install-Style-Bert-VITS2.bat index fedd2a8..0b443b5 100644 --- a/scripts/Install-Style-Bert-VITS2.bat +++ b/scripts/Install-Style-Bert-VITS2.bat @@ -110,8 +110,8 @@ if !errorlevel! neq 0 ( pause & popd & exit /b !errorlevel! ) echo -------------------------------------------------- echo Installing PyTorch... echo -------------------------------------------------- -echo Executing: uv pip install "torch>=2.7,<2.8" "torchaudio>=2.7,<2.8" --index-url https://download.pytorch.org/whl/cu118 -uv pip install "torch>=2.7,<2.8" "torchaudio>=2.7,<2.8" --index-url https://download.pytorch.org/whl/cu118 +echo Executing: uv pip install "torch>=2.8,<2.9" "torchaudio>=2.8,<2.9" --index-url https://download.pytorch.org/whl/cu126 +uv pip install "torch>=2.8,<2.9" "torchaudio>=2.8,<2.9" --index-url https://download.pytorch.org/whl/cu126 if !errorlevel! neq 0 ( pause & popd & exit /b !errorlevel! ) echo --------------------------------------------------