This commit is contained in:
tuna2134
2026-07-23 11:33:43 +09:00
parent 7d535f3761
commit 4f3bcfd252
9 changed files with 48 additions and 45 deletions

View File

@@ -2,7 +2,7 @@
# See https://huggingface.co/docs/hub/spaces-sdks-docker-first-demo # 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 RUN useradd -m -u 1000 user

View File

@@ -5,8 +5,8 @@
# 主なバージョン等 # 主なバージョン等
# Ubuntu 22.04 # Ubuntu 22.04
# Python 3.10 # Python 3.12
# PyTorch 2.1.2 (CUDA 11.8) # PyTorch 2.7.x (CUDA 11.8)
# CUDA Toolkit 12.0, CUDNN 8.9.7 # CUDA Toolkit 12.0, CUDNN 8.9.7
@@ -24,7 +24,7 @@ ENV SHELL=/bin/bash
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV APT_INSTALL="apt-get install -y --no-install-recommends" 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" ENV GIT_CLONE="git clone --depth 10"
# ================================================================== # ==================================================================
@@ -44,10 +44,14 @@ RUN apt-get update && \
nano \ nano \
ffmpeg \ ffmpeg \
software-properties-common \ software-properties-common \
gnupg \ gnupg
python3 \
python3-pip \ RUN add-apt-repository ppa:deadsnakes/ppa && \
python3-dev 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 # Git-lfs
@@ -57,8 +61,9 @@ RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.d
$APT_INSTALL git-lfs $APT_INSTALL git-lfs
# Add symlink so python and python3 commands use same python3.9 executable # Add symlinks so python and python3 commands use Python 3.12.
RUN ln -s /usr/bin/python3 /usr/local/bin/python 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) # Installing CUDA packages (CUDA Toolkit 12.0 and CUDNN 8.9.7)
@@ -106,4 +111,4 @@ RUN rm /tmp/requirements.txt
EXPOSE 8888 6006 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 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

View File

@@ -79,9 +79,9 @@ Pythonの仮想環境・パッケージ管理ツールである[uv](https://gith
powershell -c "irm https://astral.sh/uv/install.ps1 | iex" powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
git clone https://github.com/litagin02/Style-Bert-VITS2.git git clone https://github.com/litagin02/Style-Bert-VITS2.git
cd Style-Bert-VITS2 cd Style-Bert-VITS2
uv venv venv uv venv --python 3.12 venv
venv\Scripts\activate 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 uv pip install -r requirements.txt
python initialize.py # 必要なモデルとデフォルトTTSモデルをダウンロード python initialize.py # 必要なモデルとデフォルトTTSモデルをダウンロード
``` ```

View File

@@ -7,7 +7,7 @@ name = "style-bert-vits2"
dynamic = ["version"] dynamic = ["version"]
description = "Style-Bert-VITS2: Bert-VITS2 with more controllable voice styles." description = "Style-Bert-VITS2: Bert-VITS2 with more controllable voice styles."
readme = "README.md" readme = "README.md"
requires-python = ">=3.9" requires-python = ">=3.12"
license = "AGPL-3.0" license = "AGPL-3.0"
keywords = [] keywords = []
authors = [ authors = [
@@ -16,9 +16,7 @@ authors = [
classifiers = [ classifiers = [
"Development Status :: 4 - Beta", "Development Status :: 4 - Beta",
"Programming Language :: Python", "Programming Language :: Python",
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: CPython",
] ]
dependencies = [ dependencies = [
@@ -27,10 +25,10 @@ dependencies = [
"g2p_en", "g2p_en",
"jieba", "jieba",
"loguru", "loguru",
"nltk<=3.8.1", "nltk>=3.9,<4",
"num2words", "num2words",
"numba", "numba",
"numpy<2", "numpy>=1.26,<3",
"onnxruntime", "onnxruntime",
"pydantic>=2.0", "pydantic>=2.0",
"pyopenjtalk-dict", "pyopenjtalk-dict",
@@ -43,7 +41,7 @@ dependencies = [
[project.optional-dependencies] [project.optional-dependencies]
torch = [ torch = [
"accelerate", "accelerate",
"torch>=2.1", "torch>=2.7,<2.8",
] ]
[project.urls] [project.urls]
@@ -93,7 +91,7 @@ cov-report = ["- coverage combine", "coverage report"]
# Usage: `hatch run test:cov` # Usage: `hatch run test:cov`
cov = ["test-cov", "cov-report"] cov = ["test-cov", "cov-report"]
[[tool.hatch.envs.test.matrix]] [[tool.hatch.envs.test.matrix]]
python = ["3.9", "3.10", "3.11"] python = ["3.12"]
# for ONNX inference (without PyTorch dependency) # for ONNX inference (without PyTorch dependency)
[tool.hatch.envs.test-onnx] [tool.hatch.envs.test-onnx]
@@ -120,7 +118,7 @@ cov-report = ["- coverage combine", "coverage report"]
# Usage: `hatch run test-onnx:cov` # Usage: `hatch run test-onnx:cov`
cov = ["test-cov", "cov-report"] cov = ["test-cov", "cov-report"]
[[tool.hatch.envs.test-onnx.matrix]] [[tool.hatch.envs.test-onnx.matrix]]
python = ["3.9", "3.10", "3.11"] python = ["3.12"]
[tool.hatch.envs.style] [tool.hatch.envs.style]
detached = true detached = true

View File

@@ -4,11 +4,11 @@ cn2an
g2p_en g2p_en
gradio>=4.32 gradio>=4.32
jieba jieba
librosa==0.9.2 librosa>=0.11,<1
loguru loguru
nltk<=3.8.1 nltk>=3.9,<4
num2words num2words
numpy<2 numpy>=1.26,<3
onnx onnx
onnxconverter-common onnxconverter-common
onnxruntime onnxruntime

View File

@@ -1,23 +1,23 @@
accelerate accelerate
cmudict cmudict
cn2an cn2an
# faster-whisper==0.10.1 # faster-whisper>=1.2,<2
g2p_en g2p_en
GPUtil GPUtil
gradio>=4.32 gradio>=4.32
jieba jieba
# librosa==0.9.2 # librosa>=0.11,<1
loguru loguru
nltk<=3.8.1 nltk>=3.9,<4
num2words num2words
numpy<2 numpy>=1.26,<3
onnx onnx
onnxconverter-common onnxconverter-common
onnxruntime onnxruntime
onnxruntime-directml; sys_platform == 'win32' onnxruntime-directml; sys_platform == 'win32'
onnxruntime-gpu; sys_platform != 'darwin' onnxruntime-gpu; sys_platform != 'darwin'
onnxsim-prebuilt onnxsim-prebuilt
# protobuf==4.25 # protobuf>=5,<7
psutil psutil
# punctuators # punctuators
pyannote.audio>=3.1.0 pyannote.audio>=3.1.0
@@ -27,7 +27,7 @@ pypinyin
pyworld-prebuilt pyworld-prebuilt
# stable_ts # stable_ts
# tensorboard # tensorboard
torch<2.4 torch>=2.7,<2.8
torchaudio<2.4 torchaudio>=2.7,<2.8
transformers transformers
umap-learn umap-learn

View File

@@ -1,23 +1,23 @@
accelerate accelerate
cmudict cmudict
cn2an cn2an
faster-whisper==0.10.1 faster-whisper>=1.2,<2
g2p_en g2p_en
GPUtil GPUtil
gradio>=4.32 gradio>=4.32
jieba jieba
librosa==0.9.2 librosa>=0.11,<1
loguru loguru
nltk<=3.8.1 nltk>=3.9,<4
num2words num2words
numpy<2 numpy>=1.26,<3
onnx onnx
onnxconverter-common onnxconverter-common
onnxruntime onnxruntime
onnxruntime-directml; sys_platform == 'win32' onnxruntime-directml; sys_platform == 'win32'
onnxruntime-gpu; sys_platform != 'darwin' onnxruntime-gpu; sys_platform != 'darwin'
onnxsim-prebuilt onnxsim-prebuilt
protobuf==4.25 protobuf>=5,<7
psutil psutil
punctuators punctuators
pyannote.audio>=3.1.0 pyannote.audio>=3.1.0
@@ -27,7 +27,7 @@ pypinyin
pyworld-prebuilt pyworld-prebuilt
stable_ts stable_ts
tensorboard tensorboard
torch<2.4 torch>=2.7,<2.8
torchaudio<2.4 torchaudio>=2.7,<2.8
transformers transformers
umap-learn umap-learn

View File

@@ -110,8 +110,8 @@ if !errorlevel! neq 0 ( pause & popd & exit /b !errorlevel! )
echo -------------------------------------------------- echo --------------------------------------------------
echo Installing PyTorch... echo Installing PyTorch...
echo -------------------------------------------------- echo --------------------------------------------------
echo Executing: 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.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
if !errorlevel! neq 0 ( pause & popd & exit /b !errorlevel! ) if !errorlevel! neq 0 ( pause & popd & exit /b !errorlevel! )
echo -------------------------------------------------- echo --------------------------------------------------

View File

@@ -40,8 +40,8 @@ if not exist "%PYTHON_DIR%"\ (
echo -------------------------------------------------- echo --------------------------------------------------
echo Downloading Python... echo Downloading Python...
echo -------------------------------------------------- echo --------------------------------------------------
echo Executing: %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.10.11/python-3.10.11-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! ) if !errorlevel! neq 0 ( pause & exit /b !errorlevel! )
echo -------------------------------------------------- echo --------------------------------------------------
@@ -61,8 +61,8 @@ if not exist "%PYTHON_DIR%"\ (
echo -------------------------------------------------- echo --------------------------------------------------
echo Enabling 'site' module in the embedded Python environment... echo Enabling 'site' module in the embedded Python environment...
echo -------------------------------------------------- echo --------------------------------------------------
echo Executing: %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%/python310._pth') -creplace '#import site', 'import site' | Set-Content '%PYTHON_DIR%/python310._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! ) if !errorlevel! neq 0 ( pause & exit /b !errorlevel! )
echo -------------------------------------------------- echo --------------------------------------------------