From fcbd80ff8051feb672928369191b7423ca3404d8 Mon Sep 17 00:00:00 2001 From: takana-v <44311840+takana-v@users.noreply.github.com> Date: Mon, 3 Jan 2022 20:12:57 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E5=91=A8=E3=82=8A?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 84 +++---------------------------------- Dockerfile | 12 ++---- run.py | 2 + 3 files changed, 11 insertions(+), 87 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9e5c988a..4aaaf6245 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -174,33 +174,6 @@ jobs: ref: ${{ matrix.voicevox_core_source_version }} path: download/voicevox_core_source - - name: Install dependencies for building VOICEVOX Core Python package - shell: bash - run: | - pip install -r download/voicevox_core_source/requirements.txt - - - name: Install VOICEVOX Core Python package - shell: bash - run: | - set -eux - - mkdir -p download/voicevox_core_source/core/lib - - # Copy VOICEVOX Core dylib to core/lib - cp download/core/${{ matrix.voicevox_core_library_name }} download/voicevox_core_source/core/lib/libcore.dylib - - cd download/voicevox_core_source - cp core/src/core.h core/lib/ - cd - - - # Copy ONNX Runtime dylib - cp download/onnxruntime/lib/libonnxruntime.*.dylib download/voicevox_core_source/core/lib/ - - # Install VOICEVOX Core Python package with libcore.dylib & libonnxruntime.*.dylib - cd download/voicevox_core_source - NUMPY_INCLUDE=`python -c "import numpy; print(numpy.get_include())"` - CPATH="$NUMPY_INCLUDE:${CPATH:-}" pip install . - - name: Install dependencies for building VOICEVOX engine shell: bash run: | @@ -250,7 +223,8 @@ jobs: --include-data-file=../user.dic=./ \ --include-data-file=../download/core/*.bin=./ \ --include-data-file=../download/core/metas.json=./ \ - --include-data-file=../download/onnxruntime/lib/libonnxruntime.*.dylib=./ \ + --include-data-file=../download/core/libcore_cpu_x64.dylib=./ \ + --include-data-file=../download/onnxruntime/lib/libonnxruntime.dylib=./ \ --include-data-file=${{ env.pythonLocation }}/lib/python*/site-packages/scipy/.dylibs/*.dylib=./scipy/.dylibs/ \ --include-data-file=${{ env.pythonLocation }}/lib/python*/site-packages/_soundfile_data/*=./_soundfile_data/ \ --include-data-dir=../speaker_info=./speaker_info \ @@ -681,49 +655,6 @@ jobs: unzip download/core.zip -d download/ rm download/core.zip - # Install VOICEVOX Core Python package - - name: Prepare VOICEVOX Core source cache - uses: actions/cache@v2 - id: voicevox-core-source-cache - with: - key: ${{ matrix.os }}-voicevox-core-source-${{ matrix.voicevox_core_source_version }} - path: download/voicevox_core_source - - - name: Checkout VOICEVOX Core source - if: steps.voicevox-core-source-cache.outputs.cache-hit != 'true' - uses: actions/checkout@v2 - with: - repository: VOICEVOX/voicevox_core - ref: ${{ matrix.voicevox_core_source_version }} - path: download/voicevox_core_source - - - name: Install VOICEVOX Core Python package - shell: bash - run: | - set -eux - - # Generate VOICEVOX Core LIB from DLL - cp download/core/${{ matrix.voicevox_core_dll_name }} download/voicevox_core_source/example/python/core.dll - - cd download/voicevox_core_source/example/python - ./makelib.bat core - cd - - - # Copy VOICEVOX Core DLL & LIB to core/lib - cd download/voicevox_core_source - mkdir -p core/lib - mv example/python/core.dll core/lib/ - mv example/python/core.lib core/lib/ - cp core/src/core.h core/lib/ - cd - - - # Copy ONNX Runtime DLLs - cp download/onnxruntime/lib/*.dll download/voicevox_core_source/core/lib/ - - # Install VOICEVOX Core Python package with core.dll & onnxruntime*.dll - cd download/voicevox_core_source - pip install . - - name: Generate licenses.json shell: bash run: python generate_licenses.py > licenses.json @@ -785,17 +716,14 @@ jobs: run: | set -eux - # Workaround: Move core.dll to run.dist/core/lib/ - # Nuitka copies core.dll to run.dist/core.dll - # but core Python module will load core.dll from run.dist/core/lib/core.dll. - mkdir -p run.dist/core/lib - mv run.dist/core.dll run.dist/core/lib/ - mv run.dist/onnxruntime.dll run.dist/core/lib/ - # Build artifact directory mkdir -p artifact ln -sf "$(pwd)/run.dist"/* artifact/ + # Copy DLL of core and onnxruntime + ln -sf "$(pwd)/download/onnxruntime/lib"/onnxruntime.dll artifact/core/lib/ + ln -sf "$(pwd)/download/core/${{ matrix.voicevox_core_dll_name }}" artifact/core/lib/ + # Copy DLL dependencies if [ -f "download/onnxruntime/lib/onnxruntime_providers_cuda.dll" ]; then diff --git a/Dockerfile b/Dockerfile index 885b2401a..438a33d5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,13 +35,6 @@ RUN < SpeakerInfo: parser.add_argument("--use_gpu", action="store_true") parser.add_argument("--voicevox_dir", type=Path, default=None) parser.add_argument("--voicelib_dir", type=Path, default=None) + parser.add_argument("--model_lib_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("--old_voicelib_dir", type=Path, default=None) @@ -664,6 +665,7 @@ def speaker_info(speaker_uuid: str) -> SpeakerInfo: use_gpu=args.use_gpu, voicelib_dir=voicelib_dir, voicevox_dir=args.voicevox_dir, + model_lib_dir=args.model_lib_dir, ) ), host=args.host,