Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自動ビルド: コアを0.10.preview.3に更新, #286 の動作修正 #287

Merged
merged 11 commits into from
Jan 14, 2022
4 changes: 2 additions & 2 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ on:
env:
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/voicevox_engine
PYTHON_VERSION: '3.8.10'
VOICEVOX_CORE_VERSION: '0.10.preview.0'
VOICEVOX_CORE_SOURCE_VERSION: '0.10.preview.0'
VOICEVOX_CORE_VERSION: '0.10.preview.3'
VOICEVOX_CORE_SOURCE_VERSION: '0.10.preview.3'

jobs:
build-docker:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ env:
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/voicevox_engine
PYTHON_VERSION: '3.8.10'
VOICEVOX_RESOURCE_VERSION: '0.10.preview.2'
VOICEVOX_CORE_VERSION: '0.10.preview.0'
VOICEVOX_CORE_SOURCE_VERSION: '0.10.preview.0'
VOICEVOX_CORE_VERSION: '0.10.preview.3'
VOICEVOX_CORE_SOURCE_VERSION: '0.10.preview.3'

jobs:
# Build Mac binary (x64 arch only)
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN <<EOF
EOF

# assert VOICEVOX_CORE_VERSION >= 0.10.preview.0 (ONNX)
ARG VOICEVOX_CORE_VERSION=0.10.preview.0
ARG VOICEVOX_CORE_VERSION=0.10.preview.3
ARG VOICEVOX_CORE_LIBRARY_NAME=libcore_cpu_x64.so
RUN <<EOF
set -eux
Expand Down Expand Up @@ -203,7 +203,7 @@ COPY --from=download-core-env /opt/voicevox_core /opt/voicevox_core
COPY --from=download-onnxruntime-env /opt/onnxruntime /opt/onnxruntime

# Install VOICEVOX Core Python module
ARG VOICEVOX_CORE_SOURCE_VERSION=0.10.preview.0
ARG VOICEVOX_CORE_SOURCE_VERSION=0.10.preview.3
RUN <<EOF
set -eux

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ VOICEVOX ENGINEが使う処理能力を調節したい場合は、CPUスレッ

- 環境変数で指定する
```bash
CPU_NUM_THREADS=4
export VV_CPU_NUM_THREADS=4
python run.py --voicevox_dir=$VOICEVOX_DIR
```

Expand Down
14 changes: 8 additions & 6 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,15 +495,17 @@ def speaker_info(speaker_uuid: str):
parser.add_argument("--voicelib_dir", type=Path, default=None)
parser.add_argument("--enable_cancellable_synthesis", action="store_true")
parser.add_argument("--init_processes", type=int, default=2)
parser.add_argument("--cpu_num_threads", type=int, default=None)
args = parser.parse_args()

cpu_num_threads: Optional[int] = args.cpu_num_threads

# 引数へcpu_num_threadsの指定がなければ、環境変数をロールします。
# 環境変数にもない場合は、Noneのままとします。
if cpu_num_threads is None:
cpu_num_threads = os.getenv("CPU_NUM_THREADS", None)
# VV_CPU_NUM_THREADSが空文字列でなく数値でもない場合、エラー終了します。
parser.add_argument(
"--cpu_num_threads", type=int, default=os.getenv("VV_CPU_NUM_THREADS") or None
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
)

args = parser.parse_args()

cpu_num_threads: Optional[int] = args.cpu_num_threads

# voicelib_dir が Noneのとき、音声ライブラリの Python モジュールと同じディレクトリにあるとする
voicelib_dir: Optional[Path] = args.voicelib_dir
Expand Down