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 --------------------------------------------------