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
FROM python:3.10
FROM python:3.12
RUN useradd -m -u 1000 user

View File

@@ -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
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"
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モデルをダウンロード
```

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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