diff --git a/voicevox_nemo_engine/.gitattributes b/voicevox_nemo_engine/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..537137ab59fb5d5533a3ec7795351e487a7c85af --- /dev/null +++ b/voicevox_nemo_engine/.gitattributes @@ -0,0 +1,3 @@ +* text=auto +*.png -text +*.wav -text \ No newline at end of file diff --git a/voicevox_nemo_engine/.github/CODEOWNERS b/voicevox_nemo_engine/.github/CODEOWNERS new file mode 100644 index 0000000000000000000000000000000000000000..b464501716974ebb060357196f6797e938767d35 --- /dev/null +++ b/voicevox_nemo_engine/.github/CODEOWNERS @@ -0,0 +1 @@ +* @VOICEVOX/maintainer diff --git a/voicevox_nemo_engine/.github/ISSUE_TEMPLATE/bugreport.md b/voicevox_nemo_engine/.github/ISSUE_TEMPLATE/bugreport.md new file mode 100644 index 0000000000000000000000000000000000000000..28337b5ae64eb44750f1912b58d47d1adbdcb359 --- /dev/null +++ b/voicevox_nemo_engine/.github/ISSUE_TEMPLATE/bugreport.md @@ -0,0 +1,47 @@ +--- +name: Bug Report +about: 不具合の報告 +labels: バグ +--- + +## 不具合の内容 + + + +### 現象・ログ + + + +### 再現手順 + + + +### 期待動作 + + + +## VOICEVOXのバージョン + +0.?.0 + + + +## OSの種類/ディストリ/バージョン + + + +- [ ] Windows +- [ ] macOS +- [ ] Linux + + + +## その他 + + diff --git a/voicevox_nemo_engine/.github/ISSUE_TEMPLATE/featurerequest.md b/voicevox_nemo_engine/.github/ISSUE_TEMPLATE/featurerequest.md new file mode 100644 index 0000000000000000000000000000000000000000..78a3af90c9b5ef4dd6eb145cb18ef08a9ae37904 --- /dev/null +++ b/voicevox_nemo_engine/.github/ISSUE_TEMPLATE/featurerequest.md @@ -0,0 +1,48 @@ +--- +name: Feature Request +about: 機能要望・改善提案 +labels: 機能向上 +--- + +## 内容 + + + + +### Pros 良くなる点 + + + +### Cons 悪くなる点 + + + +### 実現方法 + + + +## VOICEVOXのバージョン + +0.?.0 + + + +## OSの種類/ディストリ/バージョン + + + +- [ ] Windows +- [ ] macOS +- [ ] Linux + + + +## その他 + + diff --git a/voicevox_nemo_engine/.github/ISSUE_TEMPLATE/question.md b/voicevox_nemo_engine/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000000000000000000000000000000000000..856a031e1ed10ef80b45a683c42c998dc5d341cd --- /dev/null +++ b/voicevox_nemo_engine/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,35 @@ +--- +name: Question +about: 質問 (既存のIssueや一般事例を良く調べてからしてください) +labels: 要議論 +--- + +## 質問の内容 + + + +## VOICEVOXのバージョン + +0.?.0 + + + +## OSの種類/ディストリ/バージョン + + + +- [ ] Windows +- [ ] macOS +- [ ] Linux + + + +## その他 + + diff --git a/voicevox_nemo_engine/.github/PULL_REQUEST_TEMPLATE.md b/voicevox_nemo_engine/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000000000000000000000000000000000..74557f83eb10bf696c8670545723b270b743d5b4 --- /dev/null +++ b/voicevox_nemo_engine/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,24 @@ +## 内容 + + + +## 関連 Issue + + + +## スクリーンショット・動画など + + + +## その他 diff --git a/voicevox_nemo_engine/.github/labeler.yml b/voicevox_nemo_engine/.github/labeler.yml new file mode 100644 index 0000000000000000000000000000000000000000..d1e7f8ac8324c32ab8d43e054b99be131310723c --- /dev/null +++ b/voicevox_nemo_engine/.github/labeler.yml @@ -0,0 +1,6 @@ +'OS:mac': + - '\[x\] macOS' +'OS:linux': + - '\[x\] Linux' +'OS:win': + - '\[x\] Windows' diff --git a/voicevox_nemo_engine/.github/workflows/build-docker.yml b/voicevox_nemo_engine/.github/workflows/build-docker.yml new file mode 100644 index 0000000000000000000000000000000000000000..77ab9da938e54d2d7ed916fd00b7a28f2c3d4f4a --- /dev/null +++ b/voicevox_nemo_engine/.github/workflows/build-docker.yml @@ -0,0 +1,174 @@ +name: build-docker +on: + push: + branches: + - master + release: + types: + - created + workflow_dispatch: + inputs: + version: + description: "バージョン情報(A.BB.C / A.BB.C-preview.D)" + required: true + +env: + IMAGE_NAME: ${{ vars.DOCKERHUB_USERNAME }}/voicevox_nemo_engine + PYTHON_VERSION: "3.11.3" + VOICEVOX_RESOURCE_VERSION: "0.14.0" + VOICEVOX_CORE_VERSION: "0.14.0" + +defaults: + run: + shell: bash + +jobs: + config: # 全 jobs で利用する定数の定義. `env` が利用できないコンテキストでも利用できる. + runs-on: ubuntu-latest + outputs: + version_or_latest: ${{ steps.vars.outputs.version_or_latest }} + steps: + - name: declare variables + id: vars + run: | + : # releaseタグ名か、workflow_dispatchでのバージョン名か、latestが入る + echo "version_or_latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> $GITHUB_OUTPUT + + build-docker: + needs: [config] + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + tag: + - "" + - cpu + - cpu-ubuntu20.04 + - nvidia + - nvidia-ubuntu20.04 + include: + # Ubuntu 20.04 + - tag: "" + target: runtime-env + base_image: ubuntu:20.04 + base_runtime_image: ubuntu:20.04 + onnxruntime_version: 1.13.1 + platforms: linux/amd64,linux/arm64/v8 + - tag: cpu + target: runtime-env + base_image: ubuntu:20.04 + base_runtime_image: ubuntu:20.04 + onnxruntime_version: 1.13.1 + platforms: linux/amd64,linux/arm64/v8 + - tag: cpu-ubuntu20.04 + target: runtime-env + base_image: ubuntu:20.04 + base_runtime_image: ubuntu:20.04 + onnxruntime_version: 1.13.1 + platforms: linux/amd64,linux/arm64/v8 + - tag: nvidia + target: runtime-nvidia-env + base_image: ubuntu:20.04 + base_runtime_image: nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04 + onnxruntime_version: 1.13.1 + platforms: linux/amd64 + - tag: nvidia-ubuntu20.04 + target: runtime-nvidia-env + base_image: ubuntu:20.04 + base_runtime_image: nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04 + onnxruntime_version: 1.13.1 + platforms: linux/amd64 + + steps: + - uses: actions/checkout@v3 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v2 + + - name: Setup Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # Download VOICEVOX RESOURCE + - name: Prepare VOICEVOX RESOURCE cache + uses: actions/cache@v3 + id: voicevox-resource-cache + with: + key: voicevox-resource-${{ env.VOICEVOX_RESOURCE_VERSION }} + path: download/resource + + - name: Checkout VOICEVOX RESOURCE + if: steps.voicevox-resource-cache.outputs.cache-hit != 'true' + uses: actions/checkout@v3 + with: + repository: VOICEVOX/voicevox_nemo_resource + ref: ${{ env.VOICEVOX_RESOURCE_VERSION }} + path: download/resource + + # Merge VOICEVOX RESOURCE + - name: Merge VOICEVOX RESOURCE + env: + DOWNLOAD_RESOURCE_PATH: download/resource + run: bash build_util/process_voicevox_resource.bash + + - name: Build and Deploy Docker image + uses: docker/build-push-action@v3 + env: + IMAGE_TAG: + |- # If it's a release, add the version, otherwise add the `latest` + ${{ ( + matrix.tag != '' && ( + format('{0}:{1}-{2}', env.IMAGE_NAME, matrix.tag, needs.config.outputs.version_or_latest) + ) || format('{0}:{1}', env.IMAGE_NAME, needs.config.outputs.version_or_latest) + ) }} + IMAGE_CACHE_FROM: + |- # Always use the `latest` buildcache. :latest-buildcache or :{tag}-latest-buildcache + ${{ ( + matrix.tag != '' && ( + format('type=registry,ref={0}:{1}-latest-buildcache', env.IMAGE_NAME, matrix.tag) + ) || format('type=registry,ref={0}:latest-buildcache', env.IMAGE_NAME) + ) }} + IMAGE_CACHE_TO: + |- # If it's a release, do not create buildcache, otherwise create the `latest` buildcache. :latest-buildcache or :{tag}-latest-buildcache + ${{ ( + needs.config.outputs.version_or_latest == 'latest' && ( + matrix.tag != '' && ( + format('type=registry,ref={0}:{1}-latest-buildcache,mode=max', env.IMAGE_NAME, matrix.tag) + ) || format('type=registry,ref={0}:latest-buildcache,mode=max', env.IMAGE_NAME) + ) || '' + ) }} + with: + context: . + builder: ${{ steps.buildx.outputs.name }} + file: ./Dockerfile + build-args: | + BASE_IMAGE=${{ matrix.base_image }} + BASE_RUNTIME_IMAGE=${{ matrix.base_runtime_image }} + PYTHON_VERSION=${{ env.PYTHON_VERSION }} + VOICEVOX_ENGINE_VERSION=${{ needs.config.outputs.version_or_latest }} + VOICEVOX_CORE_VERSION=${{ env.VOICEVOX_CORE_VERSION }} + VOICEVOX_RESOURCE_VERSION=${{ env.VOICEVOX_RESOURCE_VERSION }} + USE_GPU=${{ matrix.target == 'runtime-nvidia-env' }} + ONNXRUNTIME_VERSION=${{ matrix.onnxruntime_version }} + target: ${{ matrix.target }} + push: true + tags: ${{ env.IMAGE_TAG }} + cache-from: ${{ env.IMAGE_CACHE_FROM }} + cache-to: ${{ env.IMAGE_CACHE_TO }} + platforms: ${{ matrix.platforms }} + + run-release-test-workflow: + # version が指定されている場合のみ実行する + if: needs.config.outputs.version_or_latest != 'latest' + needs: [config, build-docker] + uses: ./.github/workflows/release-test-docker.yml + with: + version: ${{ needs.config.outputs.version_or_latest }} + repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL diff --git a/voicevox_nemo_engine/.github/workflows/build.yml b/voicevox_nemo_engine/.github/workflows/build.yml new file mode 100644 index 0000000000000000000000000000000000000000..a03b3314521c9bbf22fd0a707a64bc6d5428c9cd --- /dev/null +++ b/voicevox_nemo_engine/.github/workflows/build.yml @@ -0,0 +1,642 @@ +name: build +on: + push: + branches: + - master + release: + types: + - created + workflow_dispatch: + inputs: + version: + description: "バージョン情報(A.BB.C / A.BB.C-preview.D)" + required: true + prerelease: + description: "プレリリースかどうか" + type: boolean + default: true + code_signing: + description: "コード署名する" + type: boolean + upload_artifact: + description: "デバッグ用に成果物をartifactにアップロードするか" + type: boolean + default: false + +env: + PYTHON_VERSION: "3.11.3" + VOICEVOX_RESOURCE_VERSION: "0.14.0" + VOICEVOX_CORE_VERSION: "0.14.0" + +defaults: + run: + shell: bash + +jobs: + config: # 全 jobs で利用する定数の定義. `env` が利用できないコンテキストでも利用できる. + runs-on: ubuntu-latest + outputs: + version: ${{ steps.vars.outputs.version }} + version_or_latest: ${{ steps.vars.outputs.version_or_latest }} + steps: + - name: declare variables + id: vars + run: | + : # release タグ名, または workflow_dispatch でのバージョン名. リリースでない (push event) 場合は空文字列 + echo "version=${{ github.event.release.tag_name || github.event.inputs.version }}" >> $GITHUB_OUTPUT + : # release タグ名, または workflow_dispatch でのバージョン名, または 'latest' + echo "version_or_latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> $GITHUB_OUTPUT + + build-and-upload: + needs: [config] + environment: ${{ github.event.inputs.code_signing == 'true' && 'code_signing' || '' }} # コード署名用のenvironment + strategy: + matrix: + include: + # Windows CPU + - os: windows-2019 + architecture: "x64" + voicevox_core_asset_prefix: voicevox_core-windows-x64-cpu + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-win-x64-1.13.1.zip + target: windows-cpu + # Windows DirectML + - os: windows-2019 + architecture: "x64" + voicevox_core_asset_prefix: voicevox_core-windows-x64-directml + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/Microsoft.ML.OnnxRuntime.DirectML.1.13.1.zip + directml_url: https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.10.0 + target: windows-directml + # Windows NVIDIA GPU + - os: windows-2019 + architecture: "x64" + voicevox_core_asset_prefix: voicevox_core-windows-x64-cuda + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-win-x64-gpu-1.13.1.zip + cuda_version: "11.8.0" + cudnn_url: https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.2.26_cuda11-archive.zip + zlib_url: http://www.winimage.com/zLibDll/zlib123dllx64.zip + target: windows-nvidia + # Mac CPU (x64 arch only) + - os: macos-11 + architecture: "x64" + voicevox_core_asset_prefix: voicevox_core-osx-x64-cpu + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-osx-x86_64-1.13.1.tgz + target: macos-x64 + # Linux CPU + - os: ubuntu-20.04 + architecture: "x64" + voicevox_core_asset_prefix: voicevox_core-linux-x64-cpu + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-1.13.1.tgz + target: linux-cpu + # Linux NVIDIA GPU + - os: ubuntu-20.04 + architecture: "x64" + voicevox_core_asset_prefix: voicevox_core-linux-x64-gpu + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-gpu-1.13.1.tgz + cuda_version: "11.8.0" + cudnn_url: https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.2.26_cuda11-archive.tar.xz + target: linux-nvidia + + runs-on: ${{ matrix.os }} + + env: + # GNUコマンド + sed: ${{ startsWith(matrix.os, 'macos-') && 'gsed' || 'sed' }} + split: ${{ startsWith(matrix.os, 'macos-') && 'gsplit' || 'split' }} + + steps: + - name: declare variables + id: vars + run: | + echo "package_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version }}" >> $GITHUB_OUTPUT + + - uses: actions/checkout@v3 + + # NOTE: The default 'sed' and 'split' of macOS is BSD 'sed' and 'split'. + # There is a difference in specification between BSD 'sed' and 'split' and GNU 'sed' and 'split', + # so you need to install GNU 'sed' and 'split'. + - name: Install GNU sed on macOS + if: startsWith(matrix.os, 'macos-') + run: | + brew install gnu-sed coreutils + + # ONNX Runtime providersとCUDA周りをリンクするために使う + - name: Install patchelf + if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.target, 'nvidia') + run: | + sudo apt-get update + sudo apt-get install -y patchelf + + # Download CUDA + - name: Restore cached CUDA + if: matrix.cuda_version != '' + uses: actions/cache/restore@v3 + id: cuda-dll-cache-restore + with: + # update this key when ONNX Runtime CUDA dependency changed + key: ${{ matrix.os }}-cuda-dll-${{ matrix.cuda_version }}-v1 + path: download/cuda + + - name: Setup CUDA + if: matrix.cuda_version != '' && steps.cuda-dll-cache-restore.outputs.cache-hit != 'true' + uses: Jimver/cuda-toolkit@v0.2.10 + id: cuda-toolkit + with: + method: network + cuda: ${{ matrix.cuda_version }} + + - name: Extract CUDA Dynamic Libraries + if: matrix.cuda_version != '' && steps.cuda-dll-cache-restore.outputs.cache-hit != 'true' + run: | + set -eux + + CUDA_ROOT=$( echo "${{ steps.cuda-toolkit.outputs.CUDA_PATH }}" | tr '\\' '/' ) + + mkdir -p download/cuda/bin + if [[ ${{ matrix.os }} == windows-* ]]; then + mv "${CUDA_ROOT}/bin/"*.dll download/cuda/bin/ + + # remove CUDA to reduce disk usage + rm -rf "${CUDA_ROOT}" + else + cp "${CUDA_ROOT}/lib64/"libcublas.so.* download/cuda/bin/ + cp "${CUDA_ROOT}/lib64/"libcublasLt.so.* download/cuda/bin/ + cp "${CUDA_ROOT}/lib64/"libcudart.so.* download/cuda/bin/ + cp "${CUDA_ROOT}/lib64/"libcufft.so.* download/cuda/bin/ + cp "${CUDA_ROOT}/lib64/"libcurand.so.* download/cuda/bin/ + + # remove unneed full version libraries + rm -f download/cuda/bin/libcublas.so.*.* + rm -f download/cuda/bin/libcublasLt.so.*.* + rm -f download/cuda/bin/libcufft.so.*.* + rm -f download/cuda/bin/libcurand.so.*.* + rm -f download/cuda/bin/libcudart.so.*.*.* + + # remove CUDA to reduce disk usage + sudo rm -rf "${CUDA_ROOT}" + fi + + - name: Save CUDA cache + if: matrix.cuda_version != '' + uses: actions/cache/save@v3 + with: + key: ${{ steps.cuda-dll-cache-restore.outputs.cache-primary-key }} + path: download/cuda + + # Download cuDNN + - name: Export cuDNN url to calc hash + if: matrix.cudnn_url != '' + run: echo "${{ matrix.cudnn_url }}" > download/cudnn_url.txt + + - name: Restore cached cuDNN + if: matrix.cudnn_url != '' + uses: actions/cache/restore@v3 + id: cudnn-dll-cache-restore + with: + # update this key when ONNX Runtime cuDNN dependency changed + key: ${{ matrix.os }}-cudnn-dll-${{ hashFiles('download/cudnn_url.txt') }}-v1 + path: download/cudnn + + - name: Download and extract cuDNN Dynamic Libraries + if: matrix.cudnn_url != '' && steps.cudnn-dll-cache-restore.outputs.cache-hit != 'true' + run: | + set -eux + + if [[ ${{ matrix.os }} == windows-* ]]; then + curl -L "${{ matrix.cudnn_url }}" > download/cudnn.zip + + unzip download/cudnn.zip cudnn-*/bin/*.dll -d download/cudnn_tmp + + mkdir -p download/cudnn/bin + mv download/cudnn_tmp/cudnn-*/bin/*.dll download/cudnn/bin/ + rm -rf download/cudnn_tmp + + rm download/cudnn.zip + else + curl -L "${{ matrix.cudnn_url }}" > download/cudnn.tar.xz + + tar -Jxf download/cudnn.tar.xz -C download/ + + mkdir -p download/cudnn/bin + cp download/cudnn-*/lib/libcudnn.so.* download/cudnn/bin/ + cp download/cudnn-*/lib/libcudnn_*_infer.so.* download/cudnn/bin/ + + # remove unneed full version libraries + rm -f download/cudnn/bin/libcudnn.so.*.* + rm -f download/cudnn/bin/libcudnn_*_infer.so.*.* + + rm download/cudnn.tar.xz + fi + + - name: Save cuDNN cache + if: matrix.cudnn_url != '' + uses: actions/cache/save@v3 + with: + key: ${{ steps.cudnn-dll-cache-restore.outputs.cache-primary-key }} + path: download/cudnn + + # Donwload zlib + - name: Export zlib url to calc hash + if: matrix.zlib_url != '' + run: echo "${{ matrix.zlib_url }}" >> download/zlib_url.txt + + - name: Restore cached zlib + if: matrix.zlib_url != '' + uses: actions/cache/restore@v3 + id: zlib-cache-restore + with: + key: zlib-cache-v1-${{ hashFiles('download/zlib_url.txt') }} + path: download/zlib + + - name: Download zlib + if: steps.zlib-cache-restore.outputs.cache-hit != 'true' && matrix.zlib_url != '' + run: | + curl -L "${{ matrix.zlib_url }}" -o download/zlib.zip + mkdir -p download/zlib + + # extract only dlls + unzip download/zlib.zip dll_${{ matrix.architecture }}/zlibwapi.dll -d download/zlib + rm download/zlib.zip + mv download/zlib/dll_${{ matrix.architecture }}/zlibwapi.dll download/zlib/zlibwapi.dll + rm -r download/zlib/dll_${{ matrix.architecture }} + + - name: Save zlib cache + if: matrix.zlib_url != '' + uses: actions/cache/save@v3 + with: + key: ${{ steps.zlib-cache-restore.outputs.cache-primary-key }} + path: download/zlib + + - name: Setup MSVC + if: startsWith(matrix.os, 'windows-') + uses: ilammy/msvc-dev-cmd@v1 + + # Python install path of windows: C:/hostedtoolcache/windows/Python + - name: Setup Python + id: setup-python + uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + architecture: ${{ matrix.architecture }} + cache: pip + + - name: Install Python dependencies + run: | + python -m pip install -r requirements-dev.txt + + if [ "$RUNNER_OS" = Windows ]; then + # Modify PyInstaller to enable NvOptimusEnablement and AmdPowerXpressRequestHighPerformance + ./build_util/modify_pyinstaller.bash + fi + + # Download pyopenjtalk dictionary + # try 5 times, sleep 5 seconds before retry + for i in $(seq 5); do + EXIT_CODE=0 + python3 -c "import pyopenjtalk; pyopenjtalk._lazy_init()" || EXIT_CODE=$? + + if [ "$EXIT_CODE" = "0" ]; then + break + fi + + sleep 5 + done + + if [ "$EXIT_CODE" != "0" ]; then + exit "$EXIT_CODE" + fi + + - name: Create download directory + run: mkdir -p download/ + + # Donwload DirectML + - name: Export DirectML url to calc hash + if: endswith(matrix.target, '-directml') + run: echo "${{ matrix.directml_url }}" >> download/directml_url.txt + + - name: Restore cached DirectML + if: endswith(matrix.target, '-directml') + uses: actions/cache/restore@v3 + id: directml-cache-restore + with: + key: directml-cache-v1-${{ hashFiles('download/directml_url.txt') }} + path: download/directml + + - name: Download DirectML + if: steps.directml-cache-restore.outputs.cache-hit != 'true' && endswith(matrix.target, '-directml') + run: | + curl -L "${{ matrix.directml_url }}" -o download/directml.zip + mkdir -p download/directml + + # extract only dlls + unzip download/directml.zip bin/${{ matrix.architecture }}-win/DirectML.dll -d download/directml + rm download/directml.zip + mv download/directml/bin/${{ matrix.architecture }}-win/DirectML.dll download/directml/DirectML.dll + rm -r download/directml/bin + + - name: Save DirectML cache + if: endswith(matrix.target, '-directml') + uses: actions/cache/save@v3 + with: + key: ${{ steps.directml-cache-restore.outputs.cache-primary-key }} + path: download/directml + + # Download ONNX Runtime + - name: Export ONNX Runtime url to calc hash + run: echo "${{ matrix.onnxruntime_url }}" > download/onnxruntime_url.txt + + - name: Restore cached ONNX Runtime + uses: actions/cache/restore@v3 + id: onnxruntime-cache-restore + with: + key: ${{ matrix.os }}-onnxruntime-${{ hashFiles('download/onnxruntime_url.txt') }}-v1 + path: download/onnxruntime + + - name: Download ONNX Runtime (Windows) + if: steps.onnxruntime-cache-restore.outputs.cache-hit != 'true' && startsWith(matrix.os, 'windows-') + run: | + curl -L "${{ matrix.onnxruntime_url }}" > download/onnxruntime.zip + + # extract only dlls + if [[ ${{ matrix.target }} != *-directml ]]; then + unzip download/onnxruntime.zip onnxruntime-*/lib/*.dll -d download/ + mv download/onnxruntime-* download/onnxruntime + else + mkdir -p download/onnxruntime/lib + unzip download/onnxruntime.zip runtimes/win-${{ matrix.architecture }}/native/*.dll -d download/onnxruntime + mv download/onnxruntime/runtimes/win-${{ matrix.architecture }}/native/*.dll download/onnxruntime/lib/ + rm -r download/onnxruntime/runtimes + fi + + rm download/onnxruntime.zip + + - name: Download ONNX Runtime (Mac/Linux) + if: steps.onnxruntime-cache-restore.outputs.cache-hit != 'true' && startsWith(matrix.os, 'windows-') != true + run: | + curl -L "${{ matrix.onnxruntime_url }}" > download/onnxruntime.tgz + mkdir -p download/onnxruntime + tar xf "download/onnxruntime.tgz" -C "download/onnxruntime" --strip-components 1 + rm download/onnxruntime.tgz + + - name: Save ONNX Runtime cache + uses: actions/cache/save@v3 + with: + key: ${{ steps.onnxruntime-cache-restore.outputs.cache-primary-key }} + path: download/onnxruntime + + # Download VOICEVOX RESOURCE + - name: Prepare VOICEVOX RESOURCE cache + uses: actions/cache@v3 + id: voicevox-resource-cache + with: + key: voicevox-resource-${{ env.VOICEVOX_RESOURCE_VERSION }} + path: download/resource + + - name: Checkout VOICEVOX RESOURCE + if: steps.voicevox-resource-cache.outputs.cache-hit != 'true' + uses: actions/checkout@v3 + with: + repository: VOICEVOX/voicevox_nemo_resource + ref: ${{ env.VOICEVOX_RESOURCE_VERSION }} + path: download/resource + + # Merge VOICEVOX RESOURCE + - name: Merge VOICEVOX RESOURCE + env: + DOWNLOAD_RESOURCE_PATH: download/resource + run: bash build_util/process_voicevox_resource.bash + + # Download VOICEVOX Core + - name: Prepare VOICEVOX Core cache + uses: actions/cache@v3 + id: voicevox-core-cache + with: + key: ${{ matrix.os }}-voicevox-core-${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }} + path: download/core + + - name: Download VOICEVOX Core + if: steps.voicevox-core-cache.outputs.cache-hit != 'true' + env: + VOICEVOX_CORE_ASSET_NAME: ${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }} + run: | + curl -L "https://github.com/VOICEVOX/voicevox_nemo_core/releases/download/${{ env.VOICEVOX_CORE_VERSION }}/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip" > download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip + # NOTE: Windows 版コアのみ PowerShell の Compress-Archive コマンドレットを用いて zip を作成している(デフォルト状態では zip コマンドが存在していないため)。 + # このコマンドはバージョンによっては作成した zip 内のパスの区切り文字がバックスラッシュになる。 (cf. https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/48) + # unzip コマンドはこのような zip ファイルを解凍できるものの、終了コード 1 を報告して CI が落ちてしまう。 + # 回避策として、unzip コマンドの代わりに 7z コマンドを用いて zip ファイルを解凍する。 + # unzip download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip -d download/ + if [[ ${{ matrix.os }} == windows-* ]]; then + 7z x -o"download" download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip + elif [[ ${{ matrix.os }} == mac-* ]]; then + ditto -x -k --sequesterRsrc --rsrc download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip download/ + else + unzip download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip -d download/ + fi + mkdir -p download/core + mv download/${{ env.VOICEVOX_CORE_ASSET_NAME }}/* download/core + rm -rf download/${{ env.VOICEVOX_CORE_ASSET_NAME }} + rm download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip + + - name: Generate licenses.json + run: | + OUTPUT_LICENSE_JSON_PATH=engine_manifest_assets/dependency_licenses.json \ + bash build_util/create_venv_and_generate_licenses.bash + # FIXME: VOICEVOX (editor) cannot build without licenses.json + cp engine_manifest_assets/dependency_licenses.json licenses.json + + - name: Build run.py with PyInstaller + run: | + set -eux + + jq '.version = "${{ needs.config.outputs.version_or_latest }}"' engine_manifest.json > engine_manifest.json.tmp + mv -f engine_manifest.json.tmp engine_manifest.json + + # Replace version & specify dynamic libraries + $sed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.version_or_latest }}\"/" voicevox_engine/__init__.py + if [[ ${{ matrix.os }} == windows-* ]]; then + LIBCORE_PATH=download/core/voicevox_core.dll + LIBONNXRUNTIME_PATH=download/onnxruntime/lib/onnxruntime.dll + elif [[ ${{ matrix.os }} == macos-* ]]; then + LIBCORE_PATH=download/core/libvoicevox_core.dylib + LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.dylib + else + LIBCORE_PATH=download/core/libvoicevox_core.so + LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.so + fi + + CORE_MODEL_DIR_PATH="download/core/model" \ + LIBCORE_PATH="$LIBCORE_PATH" \ + LIBONNXRUNTIME_PATH="$LIBONNXRUNTIME_PATH" \ + pyinstaller --noconfirm run.spec + + - name: Gather DLL dependencies to dist/run/ (Windows) + if: startsWith(matrix.os, 'windows-') + run: | + set -eux + + # Move DLL dependencies (cache already saved) + + if [ -f "download/onnxruntime/lib/onnxruntime_providers_cuda.dll" ]; then + # ONNX Runtime providers (PyInstaller does not copy dynamic loaded libraries) + mv download/onnxruntime/lib/onnxruntime_*.dll dist/run/ + + # CUDA + mv download/cuda/bin/cublas64_*.dll dist/run/ + mv download/cuda/bin/cublasLt64_*.dll dist/run/ + mv download/cuda/bin/cudart64_*.dll dist/run/ + mv download/cuda/bin/cufft64_*.dll dist/run/ + mv download/cuda/bin/curand64_*.dll dist/run/ + + # cuDNN + mv download/cudnn/bin/cudnn64_*.dll dist/run/ + mv download/cudnn/bin/cudnn_*_infer64*.dll dist/run/ + + # zlib + mv download/zlib/zlibwapi.dll dist/run/ + + # Remove source directories to reduce disk usage (already cached) + rm -rf download/onnxruntime + rm -rf download/cuda + rm -rf download/cudnn + rm -rf download/zlib + fi + + if [[ ${{ matrix.target }} == *-directml ]]; then + # DirectML + mv download/directml/DirectML.dll dist/run/ + + # Remove source directory (already cached) + rm -rf download/directml + fi + + - name: Gather DLL dependencies to dist/run/ (Linux CUDA) + if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.target, 'nvidia') + run: | + set -eux + + # Move DLL dependencies (cache already saved) + + # ONNX Runtime providers (PyInstaller does not copy dynamic loaded libraries) + patchelf --set-rpath '$ORIGIN' "$(pwd)/download/onnxruntime/lib"/libonnxruntime_providers_*.so + mv download/onnxruntime/lib/libonnxruntime_*.so dist/run/ + + # CUDA + mv download/cuda/bin/libcublas.so.* dist/run/ + mv download/cuda/bin/libcublasLt.so.* dist/run/ + mv download/cuda/bin/libcudart.so.* dist/run/ + mv download/cuda/bin/libcufft.so.* dist/run/ + mv download/cuda/bin/libcurand.so.* dist/run/ + + # cuDNN + mv download/cudnn/bin/libcudnn.so.* dist/run/ + mv download/cudnn/bin/libcudnn_*_infer.so.* dist/run/ + + # Remove source directories to reduce disk usage (already cached) + rm -rf download/onnxruntime + rm -rf download/cuda + rm -rf download/cudnn + + - name: Set @rpath to @executable_path + if: startsWith(matrix.os, 'macos-') + run: | + install_name_tool -add_rpath @executable_path/. dist/run/run + + - name: Code signing + if: github.event.inputs.code_signing == 'true' && startsWith(matrix.os, 'windows-') + run: | + bash build_util/codesign.bash "dist/run/run.exe" + env: + ESIGNERCKA_USERNAME: ${{ secrets.ESIGNERCKA_USERNAME }} + ESIGNERCKA_PASSWORD: ${{ secrets.ESIGNERCKA_PASSWORD }} + ESIGNERCKA_TOTP_SECRET: ${{ secrets.ESIGNERCKA_TOTP_SECRET }} + + - name: Rename artifact directory to archive + run: | + mv dist/run/ "${{ matrix.target }}/" + + # 7z archives + - name: Create 7z archives + run: | + # Compress to artifact.7z.001, artifact.7z.002, ... + 7z -r -v1900m a "${{ steps.vars.outputs.package_name }}.7z" "${{ matrix.target }}/" + + # Output splitted archive list + ls ${{ steps.vars.outputs.package_name }}.7z.* > archives_7z.txt + mv archives_7z.txt "${{ steps.vars.outputs.package_name }}.7z.txt" + + - name: Upload 7z archives to artifact + if: github.event.inputs.upload_artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.vars.outputs.package_name }} + path: | + ${{ steps.vars.outputs.package_name }}.7z.* + + - name: Upload 7z archives to Release assets + if: needs.config.outputs.version != '' + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + prerelease: ${{ github.event.inputs.prerelease }} + token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ needs.config.outputs.version }} + artifacts: > + ${{ steps.vars.outputs.package_name }}.7z.* + commit: ${{ github.sha }} + + - name: Clean 7z archives to reduce disk usage + run: | + rm -f ${{ steps.vars.outputs.package_name }}.7z.* + + # VVPP archives + - name: Create VVPP archives + run: | + # Compress to compressed.zip.001, compressed.zip.002, ... + # NOTE: 1000th archive will be "compressed.zip.1000" after "compressed.zip.999". This is unconsidered as an extreme case. + (cd "${{ matrix.target }}" && 7z -r -v1900M a "../compressed.zip") + + # Rename to artifact.001.vvppp, artifact.002.vvppp, ... + for FILE in $(ls "compressed.zip."*); do + NUMBER=${FILE##*.} # 001 + mv "${FILE}" "${{ steps.vars.outputs.package_name }}.${NUMBER}.vvppp" + done + + # Rename to artifact.vvpp if there are only artifact.001.vvppp + if [ "$(ls ${{ steps.vars.outputs.package_name }}.*.vvppp | wc -l)" == 1 ]; then + mv ${{ steps.vars.outputs.package_name }}.001.vvppp ${{ steps.vars.outputs.package_name }}.vvpp + fi + + # Output splitted archive list + ls ${{ steps.vars.outputs.package_name }}*.vvppp ${{ steps.vars.outputs.package_name }}.vvpp > archives_vvpp.txt || true + mv archives_vvpp.txt "${{ steps.vars.outputs.package_name }}.vvpp.txt" + + - name: Upload VVPP archives to artifact + if: github.event.inputs.upload_artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.vars.outputs.package_name }} + path: | + ${{ steps.vars.outputs.package_name }}.vvpp + ${{ steps.vars.outputs.package_name }}*.vvppp + ${{ steps.vars.outputs.package_name }}.vvpp.txt + + - name: Upload VVPP archives to Release assets + if: needs.config.outputs.version != '' + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + prerelease: ${{ github.event.inputs.prerelease }} + token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ needs.config.outputs.version }} + artifacts: > + ${{ steps.vars.outputs.package_name }}.vvpp, + ${{ steps.vars.outputs.package_name }}*.vvppp, + ${{ steps.vars.outputs.package_name }}.vvpp.txt + commit: ${{ github.sha }} + + run-release-test-workflow: + if: needs.config.outputs.version != '' + needs: [config, build-and-upload] + uses: ./.github/workflows/release-test.yml + with: + version: ${{ needs.config.outputs.version }} + repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL diff --git a/voicevox_nemo_engine/.github/workflows/coverage-comment.yml b/voicevox_nemo_engine/.github/workflows/coverage-comment.yml new file mode 100644 index 0000000000000000000000000000000000000000..e8b84315dbc407447f575018a322833355aa5655 --- /dev/null +++ b/voicevox_nemo_engine/.github/workflows/coverage-comment.yml @@ -0,0 +1,100 @@ +name: Coverage Report Comment + +on: + workflow_run: + workflows: + - test + types: + - completed + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + comment: + runs-on: ubuntu-latest + if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' + steps: + - name: Download coverage report + uses: actions/github-script@v5.0.0 + with: + script: | + const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{ github.event.workflow_run.id }}, + }) + const matchArtifact = artifacts.data.artifacts.filter((artifact) => { + return artifact.name == 'report' + })[0] + const download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }) + const fs = require('fs') + fs.writeFileSync('${{github.workspace}}/report.zip', Buffer.from(download.data)) + + - name: Unzip report + run: unzip report.zip + + - name: Comment coverage result to Pull Requests + uses: actions/github-script@v5.0.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const fs = require('fs') + const baseReport = fs.readFileSync('report.txt', 'utf8').toString().split('\n') + let report = '' + for (let i = 0; i < baseReport.length; i++) { + const line = baseReport[i].split(' ').filter(v => v) + if (i === 1 && line.length === 1) { + report += "|:---|---:|---:|---:|\n" + } else if (line.length === 1) { + continue + } else { + if (i !== 0 && line.length === 4) { + const parcent = Number(line[3].replace("%", "")) + let color = 'green' + if (parcent < 50) { + color = 'red' + } else if (parcent < 90) { + color = 'orange' + } + line[3] = `![coverage-${parcent}%](https://img.shields.io/badge/coverage-${parcent}%25-${color}.svg)` + } + report += "|" + line.join("|") + "|\n" + } + if (line[0] === 'TOTAL') break + } + + const issue_number = Number(fs.readFileSync('pr_num.txt')) + const body = `## Coverage Result\n\n\nResultを開く\n\n${report}\n` + + let listComments = await github.rest.issues.listComments({ + issue_number, + owner: context.repo.owner, + repo: context.repo.repo, + }) + listComments = listComments.data.filter((comment) => { + return comment.body.includes('Coverage Result') && comment.user.login.includes('github-actions') + }) + + if (listComments.length === 0) { + github.rest.issues.createComment({ + issue_number, + owner: context.repo.owner, + repo: context.repo.repo, + body, + }) + } else { + github.rest.issues.updateComment({ + comment_id: listComments[0].id, + owner: context.repo.owner, + repo: context.repo.repo, + body, + }) + } diff --git a/voicevox_nemo_engine/.github/workflows/labeler.yml b/voicevox_nemo_engine/.github/workflows/labeler.yml new file mode 100644 index 0000000000000000000000000000000000000000..27c17d669ad9426ade6472dfef4ed6a26b87a2c4 --- /dev/null +++ b/voicevox_nemo_engine/.github/workflows/labeler.yml @@ -0,0 +1,17 @@ +name: Issue Labeler +on: + issues: + types: [opened] +defaults: + run: + shell: bash + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: github/issue-labeler@v2.0 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler.yml + enable-versioned-regex: 0 diff --git a/voicevox_nemo_engine/.github/workflows/release-test-docker.yml b/voicevox_nemo_engine/.github/workflows/release-test-docker.yml new file mode 100644 index 0000000000000000000000000000000000000000..386edd484fe00566724abc4ee27cb404212700d3 --- /dev/null +++ b/voicevox_nemo_engine/.github/workflows/release-test-docker.yml @@ -0,0 +1,97 @@ +name: Test Docker Release Build + +on: + workflow_call: + inputs: + version: + type: string + required: true + repo_url: + type: string + required: false + workflow_dispatch: + inputs: + version: + type: string + description: "テストしたいタグ名" + required: true + +env: + IMAGE_NAME: ${{ vars.DOCKERHUB_USERNAME }}/voicevox_engine + VERSION: |- # version指定時はversionを、それ以外はタグ名を使用 + ${{ (github.event.inputs || inputs).version }} + +defaults: + run: + shell: bash + +jobs: + test: + runs-on: [ ubuntu-20.04 ] + strategy: + fail-fast: false + matrix: + tag: + - "" + - cpu + - cpu-ubuntu20.04 + + steps: + - uses: actions/checkout@v3 + + # + # Setup Python Environment + # + - uses: actions/setup-python@v4 + with: + python-version: "3.11.3" + cache: pip + + - name: Install requirements + run: | + pip install -r requirements-test.txt + + # + # Setup Docker Environment + # + - name: Declare variables + id: docker_vars + run: | + if [ "${{ matrix.tag }}" != "" ]; then + echo "image_tag=${{ env.IMAGE_NAME }}:${{ matrix.tag }}-${{ env.VERSION }}" >> $GITHUB_OUTPUT + else + echo "image_tag=${{ env.IMAGE_NAME }}:${{ env.VERSION }}" >> $GITHUB_OUTPUT + fi + + - name: Docker pull + run: docker pull "${{ steps.docker_vars.outputs.image_tag }}" + + - name: Docker run + run: docker run -d -p 50021:50021 "${{ steps.docker_vars.outputs.image_tag }}" + + # Docker コンテナが起動してから、レスポンスが返ってくるまで待機する + # リトライは10回まで `/version` にアクセスしてレスポンスのステータスコードをチェック + # - ステータスコードが `200` の場合は正常終了します + # - ステータスコードが `200` 以外の場合は、5秒間スリープしてリトライします + - name: Wait for container to start + run: | + set +e # curlのエラーを無視する + + url="http://127.0.0.1:50021/version" + max_attempts=10 + sleep_interval=5 + + for i in $(seq 1 $max_attempts); do + status=$(curl -o /dev/null -s -w '%{http_code}\n' $url) + if [ $status -eq 200 ]; then + echo "Container is ready! Response status code: $status" + exit 0 + else + echo "Attempt $i/$max_attempts: Response status code $status" + sleep $sleep_interval + fi + done + exit 1 + + - name: Test + run: python build_util/check_release_build.py --skip_run_process --dist_dir dist/ diff --git a/voicevox_nemo_engine/.github/workflows/release-test.yml b/voicevox_nemo_engine/.github/workflows/release-test.yml new file mode 100644 index 0000000000000000000000000000000000000000..0f9883c8038a8979b08f13b3c610b995c52aacc8 --- /dev/null +++ b/voicevox_nemo_engine/.github/workflows/release-test.yml @@ -0,0 +1,86 @@ +name: Test Release Build + +on: + workflow_call: + inputs: + version: + type: string + required: true + repo_url: + type: string + required: false + workflow_dispatch: + inputs: + version: + type: string + description: "テストしたいタグ名" + required: true + repo_url: + type: string + description: "リポジトリのURL(省略可能)" + required: false + +env: + REPO_URL: + |- # repo_url指定時はrepo_urlを、それ以外はgithubのリポジトリURLを使用 + ${{ (github.event.inputs || inputs).repo_url || format('{0}/{1}', github.server_url, github.repository) }} + VERSION: |- # version指定時はversionを、それ以外はタグ名を使用 + ${{ (github.event.inputs || inputs).version }} + +defaults: + run: + shell: bash + +jobs: + test: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-20.04 + target: linux-cpu + - os: ubuntu-20.04 + target: linux-nvidia + - os: macos-11 + target: macos-x64 + - os: windows-2019 + target: windows-cpu + - os: windows-2019 + target: windows-nvidia + - os: windows-2019 + target: windows-directml + + runs-on: ${{ matrix.os }} + + steps: + - name: declare variables + id: vars + run: | + echo "release_url=${{ env.REPO_URL }}/releases/download/${{ env.VERSION }}" >> $GITHUB_OUTPUT + echo "package_name=voicevox_engine-${{ matrix.target }}-${{ env.VERSION }}" >> $GITHUB_OUTPUT + + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + with: + python-version: "3.11.3" + cache: pip + + - name: Download + run: | + mkdir -p download + curl -L -o "download/list.txt" "${{ steps.vars.outputs.release_url }}/${{ steps.vars.outputs.package_name }}.7z.txt" + cat "download/list.txt" | xargs -I '%' curl -L -o "download/%" "${{ steps.vars.outputs.release_url }}/%" + 7z x "download/$(head -n1 download/list.txt)" + mv ${{ matrix.target }} dist/ + + - name: chmod +x + if: startsWith(matrix.target, 'linux') || startsWith(matrix.target, 'macos') + run: chmod +x dist/run + + - name: Install requirements + run: | + pip install -r requirements-test.txt + + - name: Test + run: python build_util/check_release_build.py --dist_dir dist/ diff --git a/voicevox_nemo_engine/.github/workflows/test.yml b/voicevox_nemo_engine/.github/workflows/test.yml new file mode 100644 index 0000000000000000000000000000000000000000..25d2f259c3caa937c5692a827fe7e2312312aecc --- /dev/null +++ b/voicevox_nemo_engine/.github/workflows/test.yml @@ -0,0 +1,82 @@ +name: test + +on: + push: + pull_request: + branches: + - "**" + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, windows-latest] # [ubuntu-20.04, macos-latest, windows-latest] + python: ["3.11.3"] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + cache: pip + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install -r requirements-test.txt + + - name: Run poetry and check + run: | + poetry export --without-hashes -o requirements.txt.check + poetry export --without-hashes --with dev -o requirements-dev.txt.check + poetry export --without-hashes --with test -o requirements-test.txt.check + poetry export --without-hashes --with license -o requirements-license.txt.check + + diff -q requirements.txt requirements.txt.check || \ + diff -q requirements-dev.txt requirements-dev.txt.check || \ + diff -q requirements-test.txt requirements-test.txt.check || \ + diff -q requirements-license.txt requirements-license.txt.check > /dev/null + if [ $? = 1 ]; then + echo "poetry export has some diff" + exit 1 + fi + + - run: pysen run lint + + - name: Run pytest and get coverage + run: | + coverage run --omit=test/* -m pytest + + - name: Submit coverage to Coveralls + if: matrix.os == 'ubuntu-20.04' + run: coveralls --service=github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create coverage result + if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-20.04' + run: | + mkdir report + coverage report > report/report.txt + echo ${{ github.event.number }} > report/pr_num.txt + + - name: Upload coverage result + if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-20.04' + uses: actions/upload-artifact@v3 + with: + name: report + path: report/ + + - name: Check licenses + shell: bash + run: | + OUTPUT_LICENSE_JSON_PATH=/dev/null \ + bash build_util/create_venv_and_generate_licenses.bash diff --git a/voicevox_nemo_engine/.github/workflows/typos.yml b/voicevox_nemo_engine/.github/workflows/typos.yml new file mode 100644 index 0000000000000000000000000000000000000000..a42e05dcf5abd1e25178e3832f7040747ee6ad4e --- /dev/null +++ b/voicevox_nemo_engine/.github/workflows/typos.yml @@ -0,0 +1,22 @@ +name: Check typos + +on: + push: + pull_request: + branches: + - "**" + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + typos: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: typos-action + uses: crate-ci/typos@v1.12.12 diff --git a/voicevox_nemo_engine/.github/workflows/upload-gh-pages.yml b/voicevox_nemo_engine/.github/workflows/upload-gh-pages.yml new file mode 100644 index 0000000000000000000000000000000000000000..1abd9e9cf3c2a14bc62eebcbff56d62fb68c847b --- /dev/null +++ b/voicevox_nemo_engine/.github/workflows/upload-gh-pages.yml @@ -0,0 +1,45 @@ +name: upload-docs + +on: + push: + branches: + - "master" + +env: + PYTHON_VERSION: "3.11.3" + PUBLISH_DIR: "./docs/api" + PUBLISH_BRANCH: "gh-pages" + DESTINATION_DIR: "api" + +defaults: + run: + shell: bash + +jobs: + upload-doc: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + + - name: Setup Python + id: setup-python + uses: actions/setup-python@v2 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: pip + + - name: Install Python dependencies + run: | + pip install -r requirements.txt + + - name: Make documents + run: | + python make_docs.py + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ${{ env.PUBLISH_DIR }} + publish_branch: ${{ env.PUBLISH_BRANCH }} + destination_dir: ${{ env.DESTINATION_DIR }} diff --git a/voicevox_nemo_engine/.gitignore b/voicevox_nemo_engine/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..9a668c56d9436459ef05a0033977417eed8fc31c --- /dev/null +++ b/voicevox_nemo_engine/.gitignore @@ -0,0 +1,157 @@ +# VOICEVOX specifics +## Artifacts of nuitka +*.dist +*.build +/build +/cache +## Artifact of generating licenses +/licenses.json +licenses_venv/ + +# Copied from `https://github.com/github/gitignore/blob/main/Python.gitignore` @2022-01-10 +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +# poetry.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +.idea/ diff --git a/voicevox_nemo_engine/.pre-commit-config.yaml b/voicevox_nemo_engine/.pre-commit-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..86ef0cba98c10ef31992e5a84e715560a522d6a8 --- /dev/null +++ b/voicevox_nemo_engine/.pre-commit-config.yaml @@ -0,0 +1,36 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: local + hooks: + - id: pysen-lint + name: pysen-lint + entry: pysen run lint + language: python + types: [file, python] + stages: [push] + pass_filenames: false + - id: poetry-export + name: poetry-export + entry: poetry export --without-hashes -o requirements.txt + language: python + stages: [push] + pass_filenames: false + - id: poetry-export-dev + name: poetry-export-dev + entry: poetry export --without-hashes --with dev -o requirements-dev.txt + language: python + stages: [push] + pass_filenames: false + - id: poetry-export-test + name: poetry-export-test + entry: poetry export --without-hashes --with test -o requirements-test.txt + language: python + stages: [push] + pass_filenames: false + - id: poetry-export-license + name: poetry-export-license + entry: poetry export --without-hashes --with license -o requirements-license.txt + language: python + stages: [push] + pass_filenames: false diff --git a/voicevox_nemo_engine/Dockerfile b/voicevox_nemo_engine/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f4dd019a414fbb679425f982c902ff8c108a6bd8 --- /dev/null +++ b/voicevox_nemo_engine/Dockerfile @@ -0,0 +1,298 @@ +# syntax=docker/dockerfile:1.4 + +ARG BASE_IMAGE=ubuntu:20.04 +ARG BASE_RUNTIME_IMAGE=$BASE_IMAGE + +# Download VOICEVOX Core shared object +FROM ${BASE_IMAGE} AS download-core-env +ARG DEBIAN_FRONTEND=noninteractive + +WORKDIR /work + +RUN <= 0.11.0 (ONNX) +ARG TARGETPLATFORM +ARG USE_GPU=false +ARG VOICEVOX_CORE_VERSION=0.14.0 + +RUN < /etc/ld.so.conf.d/voicevox_core.conf + + # Update dynamic library search cache + ldconfig +EOF + + +# Download ONNX Runtime +FROM ${BASE_IMAGE} AS download-onnxruntime-env +ARG DEBIAN_FRONTEND=noninteractive + +WORKDIR /work + +RUN < /etc/ld.so.conf.d/onnxruntime.conf + + # Update dynamic library search cache + ldconfig +EOF + + +# Compile Python (version locked) +FROM ${BASE_IMAGE} AS compile-python-env + +ARG DEBIAN_FRONTEND=noninteractive + +RUN < /etc/profile.d/python-path.sh +# echo "export LD_LIBRARY_PATH=/opt/python/lib:\$LD_LIBRARY_PATH" >> /etc/profile.d/python-path.sh +# echo "export C_INCLUDE_PATH=/opt/python/include:\$C_INCLUDE_PATH" >> /etc/profile.d/python-path.sh +# +# rm -f /etc/ld.so.cache +# ldconfig +# EOF + + +# Runtime +FROM ${BASE_RUNTIME_IMAGE} AS runtime-env +ARG DEBIAN_FRONTEND=noninteractive + +WORKDIR /opt/voicevox_engine + +# ca-certificates: pyopenjtalk dictionary download +# build-essential: pyopenjtalk local build +RUN < /opt/voicevox_engine/engine_manifest_assets/dependency_licenses.json + cp /opt/voicevox_engine/engine_manifest_assets/dependency_licenses.json /opt/voicevox_engine/licenses.json +EOF + +# Keep this layer separated to use layer cache on download failed in local build +RUN < /dev/stderr + +exec "\$@" +EOF + +ENTRYPOINT [ "/entrypoint.sh" ] +CMD [ "gosu", "user", "/opt/python/bin/python3", "./run.py", "--voicelib_dir", "/opt/voicevox_core/", "--runtime_dir", "/opt/onnxruntime/lib", "--host", "0.0.0.0" ] + +# Enable use_gpu +FROM runtime-env AS runtime-nvidia-env +CMD [ "gosu", "user", "/opt/python/bin/python3", "./run.py", "--use_gpu", "--voicelib_dir", "/opt/voicevox_core/", "--runtime_dir", "/opt/onnxruntime/lib", "--host", "0.0.0.0" ] diff --git a/voicevox_nemo_engine/LGPL_LICENSE b/voicevox_nemo_engine/LGPL_LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..153d416dc8d2d60076698ec3cbfce34d91436a03 --- /dev/null +++ b/voicevox_nemo_engine/LGPL_LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/voicevox_nemo_engine/LICENSE b/voicevox_nemo_engine/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..2eaac841f2f3bd2b16ef482eb75b14507d050f87 --- /dev/null +++ b/voicevox_nemo_engine/LICENSE @@ -0,0 +1,9 @@ +LGPL v3 と、ソースコードの公開が不要な別ライセンスのデュアルライセンスです。 + +1. LGPL v3 + +LGPL_LICENSEを参照してください。 + +2. ソースコードの公開が不要な別ライセンス + +別ライセンスを取得したい場合は、ヒホ(twitter: @hiho_karuta)に求めてください。 diff --git a/voicevox_nemo_engine/Makefile b/voicevox_nemo_engine/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..f09bfcafe5647db43481e91b0fbf1ad9e9a06ca2 --- /dev/null +++ b/voicevox_nemo_engine/Makefile @@ -0,0 +1,125 @@ +CMD= +NOCACHE= + +ARGS:= +ifeq ($(NOCACHE),1) + ARGS:=$(ARGS) --no-cache +endif + +# Ubuntu 20.04 +.PHONY: build-linux-docker-ubuntu20.04 +build-linux-docker-ubuntu20.04: + docker buildx build . \ + -t voicevox/voicevox_engine:cpu-ubuntu20.04-latest \ + --target runtime-env \ + --progress plain \ + --build-arg BASE_IMAGE=ubuntu:20.04 \ + --build-arg BASE_RUNTIME_IMAGE=ubuntu:20.04 \ + --build-arg ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-1.13.1.tgz \ + --build-arg VOICEVOX_CORE_LIBRARY_NAME=libcore_cpu_x64.so $(ARGS) + +.PHONY: run-linux-docker-ubuntu20.04 +run-linux-docker-ubuntu20.04: + docker run --rm -it \ + -p '127.0.0.1:50021:50021' $(ARGS) \ + voicevox/voicevox_engine:cpu-ubuntu20.04-latest $(CMD) + +.PHONY: build-linux-docker-nvidia-ubuntu20.04 +build-linux-docker-nvidia-ubuntu20.04: + docker buildx build . \ + -t voicevox/voicevox_engine:nvidia-ubuntu20.04-latest \ + --target runtime-nvidia-env \ + --progress plain \ + --build-arg BASE_IMAGE=ubuntu:20.04 \ + --build-arg BASE_RUNTIME_IMAGE=nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04 \ + --build-arg ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-gpu-1.13.1.tgz \ + --build-arg VOICEVOX_CORE_LIBRARY_NAME=libcore_gpu_x64_nvidia.so $(ARGS) + +.PHONY: run-linux-docker-nvidia-ubuntu20.04 +run-linux-docker-nvidia-ubuntu20.04: + docker run --rm -it \ + --gpus all \ + -p '127.0.0.1:50021:50021' $(ARGS) \ + voicevox/voicevox_engine:nvidia-ubuntu20.04-latest $(CMD) + + +# Ubuntu 18.04 +.PHONY: build-linux-docker-ubuntu18.04 +build-linux-docker-ubuntu18.04: + docker buildx build . \ + -t voicevox/voicevox_engine:cpu-ubuntu18.04-latest \ + --target runtime-env \ + --progress plain \ + --build-arg BASE_IMAGE=ubuntu:18.04 \ + --build-arg BASE_RUNTIME_IMAGE=ubuntu:18.04 \ + --build-arg ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-1.13.1.tgz \ + --build-arg VOICEVOX_CORE_LIBRARY_NAME=libcore_cpu_x64.so $(ARGS) + +.PHONY: run-linux-docker-ubuntu18.04 +run-linux-docker-ubuntu18.04: + docker run --rm -it \ + -p '127.0.0.1:50021:50021' $(ARGS) \ + voicevox/voicevox_engine:cpu-ubuntu18.04-latest $(CMD) + +.PHONY: build-linux-docker-nvidia-ubuntu18.04 +build-linux-docker-nvidia-ubuntu18.04: + docker buildx build . \ + -t voicevox/voicevox_engine:nvidia-ubuntu18.04-latest \ + --target runtime-nvidia-env \ + --progress plain \ + --build-arg BASE_IMAGE=ubuntu:18.04 \ + --build-arg BASE_RUNTIME_IMAGE=nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu18.04 \ + --build-arg ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-gpu-1.13.1.tgz \ + --build-arg VOICEVOX_CORE_LIBRARY_NAME=libcore_gpu_x64_nvidia.so $(ARGS) + +.PHONY: run-linux-docker-nvidia-ubuntu18.04 +run-linux-docker-nvidia-ubuntu18.04: + docker run --rm -it \ + --gpus all \ + -p '127.0.0.1:50021:50021' $(ARGS) \ + voicevox/voicevox_engine:nvidia-ubuntu18.04-latest $(CMD) + + +# VOICEVOX Core env for test +.PHONY: build-linux-docker-download-core-env-ubuntu18.04 +build-linux-docker-download-core-env-ubuntu18.04: + docker buildx build . \ + -t voicevox/voicevox_engine:download-core-env-ubuntu18.04 \ + --target download-core-env \ + --progress plain \ + --build-arg BASE_IMAGE=ubuntu:18.04 $(ARGS) + +.PHONY: run-linux-docker-download-core-env-ubuntu18.04 +run-linux-docker-download-core-env-ubuntu18.04: + docker run --rm -it $(ARGS) \ + voicevox/voicevox_engine:download-core-env-ubuntu18.04 $(CMD) + + +# ONNX Runtime env for test +.PHONY: build-linux-docker-download-onnxruntime-env-ubuntu18.04 +build-linux-docker-download-onnxruntime-env-ubuntu18.04: + docker buildx build . \ + -t voicevox/voicevox_engine:download-onnxruntime-env-ubuntu18.04 \ + --target download-onnxruntime-env \ + --progress plain \ + --build-arg BASE_IMAGE=ubuntu:18.04 $(ARGS) + +.PHONY: run-linux-docker-download-onnxruntime-env-ubuntu18.04 +run-linux-docker-download-onnxruntime-env-ubuntu18.04: + docker run --rm -it $(ARGS) \ + voicevox/voicevox_engine:download-onnxruntime-env-ubuntu18.04 $(CMD) + + +# Python env for test +.PHONY: build-linux-docker-compile-python-env +build-linux-docker-compile-python-env: + docker buildx build . \ + -t voicevox/voicevox_engine:compile-python-env \ + --target compile-python-env \ + --progress plain \ + --build-arg BASE_IMAGE=ubuntu:20.04 $(ARGS) + +.PHONY: run-linux-docker-compile-python-env +run-linux-docker-compile-python-env: + docker run --rm -it $(ARGS) \ + voicevox/voicevox_engine:compile-python-env $(CMD) diff --git a/voicevox_nemo_engine/README.md b/voicevox_nemo_engine/README.md new file mode 100644 index 0000000000000000000000000000000000000000..07cea940be3cca9d6077decd3bb0b849906ab54c --- /dev/null +++ b/voicevox_nemo_engine/README.md @@ -0,0 +1,671 @@ +# VOICEVOX NEMO ENGINE + +[VOICEVOX Nemo](https://voicevox.hiroshiba.jp/nemo/) のエンジンです。 +実態は HTTP サーバーなので、リクエストを送信すればテキスト音声合成できます。 + +(エディターは [VOICEVOX](https://github.com/VOICEVOX/voicevox/) のマルチエンジン機能を利用、 +コアは [VOICEVOX NEMO CORE](https://github.com/VOICEVOX/voicevox_nemo_core/) に詳細があります。) + +## ダウンロード + +[こちら](https://github.com/VOICEVOX/voicevox_nemo_engine/releases/latest)から対応するエンジンをダウンロードしてください。 + +## API ドキュメント・サンプル + +サーバーのデフォルトのポート番号は `50121` です。それ以外は [VOICEVOX ENGINE](https://github.com/VOICEVOX/voicevox_engine/) と同じです。 + +## Docker イメージ + +### CPU + +```bash +docker pull voicevox/voicevox_nemo_engine:cpu-ubuntu20.04-latest +docker run --rm -it -p '127.0.0.1:50021:50021' voicevox/voicevox_nemo_engine:cpu-ubuntu20.04-latest +``` + +### GPU + +```bash +docker pull voicevox/voicevox_nemo_engine:nvidia-ubuntu20.04-latest +docker run --rm --gpus all -p '127.0.0.1:50021:50021' voicevox/voicevox_nemo_engine:nvidia-ubuntu20.04-latest +``` + +Fork元のVOICEVOX ENGINEのREADME + +# VOICEVOX ENGINE + +[![build](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build.yml/badge.svg)](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build.yml) +[![releases](https://img.shields.io/github/v/release/VOICEVOX/voicevox_engine)](https://github.com/VOICEVOX/voicevox_engine/releases) +[![discord](https://img.shields.io/discord/879570910208733277?color=5865f2&label=&logo=discord&logoColor=ffffff)](https://discord.gg/WMwWetrzuh) + +[![test](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/test.yml/badge.svg)](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/test.yml) +[![Coverage Status](https://coveralls.io/repos/github/VOICEVOX/voicevox_engine/badge.svg)](https://coveralls.io/github/VOICEVOX/voicevox_engine) + +[![build-docker](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build-docker.yml/badge.svg)](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build-docker.yml) +[![docker](https://img.shields.io/docker/pulls/voicevox/voicevox_engine)](https://hub.docker.com/r/voicevox/voicevox_engine) + +[VOICEVOX](https://voicevox.hiroshiba.jp/) のエンジンです。 +実態は HTTP サーバーなので、リクエストを送信すればテキスト音声合成できます。 + +(エディターは [VOICEVOX](https://github.com/VOICEVOX/voicevox/) 、 +コアは [VOICEVOX CORE](https://github.com/VOICEVOX/voicevox_core/) 、 +全体構成は [こちら](https://github.com/VOICEVOX/voicevox/blob/main/docs/%E5%85%A8%E4%BD%93%E6%A7%8B%E6%88%90.md) に詳細があります。) + +## ダウンロード + +[こちら](https://github.com/VOICEVOX/voicevox_engine/releases/latest)から対応するエンジンをダウンロードしてください。 + +## API ドキュメント + +[API ドキュメント](https://voicevox.github.io/voicevox_engine/api/)をご参照ください。 + +VOICEVOX エンジンもしくはエディタを起動した状態で http://127.0.0.1:50021/docs にアクセスすると、起動中のエンジンのドキュメントも確認できます。 +今後の方針などについては [VOICEVOX 音声合成エンジンとの連携](./docs/VOICEVOX音声合成エンジンとの連携.md) も参考になるかもしれません。 + +リクエスト・レスポンスの文字コードはすべて UTF-8 です。 + +### HTTP リクエストで音声合成するサンプルコード + +```bash +echo -n "こんにちは、音声合成の世界へようこそ" >text.txt + +curl -s \ + -X POST \ + "127.0.0.1:50021/audio_query?style_id=1"\ + --get --data-urlencode text@text.txt \ + > query.json + +curl -s \ + -H "Content-Type: application/json" \ + -X POST \ + -d @query.json \ + "127.0.0.1:50021/synthesis?style_id=1" \ + > audio.wav +``` + +生成される音声はサンプリングレートが 24000Hz と少し特殊なため、音声プレーヤーによっては再生できない場合があります。 + +`speaker` に指定する値は `/speakers` エンドポイントで得られる `style_id` です。互換性のために `speaker` という名前になっています。 + +### 読み方を AquesTalk 記法で取得・修正するサンプルコード + +`/audio_query`のレスポンスにはエンジンが判断した読み方が AquesTalk ライクな記法([本家の記法](https://www.a-quest.com/archive/manual/siyo_onseikigou.pdf)とは一部異なります)で記録されています。 +記法は次のルールに従います。 + +- 全てのカナはカタカナで記述される +- アクセント句は`/`または`、`で区切る。`、`で区切った場合に限り無音区間が挿入される。 +- カナの手前に`_`を入れるとそのカナは無声化される +- アクセント位置を`'`で指定する。全てのアクセント句にはアクセント位置を 1 つ指定する必要がある。 +- アクセント句末に`?`(全角)を入れることにより疑問文の発音ができる + +```bash +# 読ませたい文章をutf-8でtext.txtに書き出す +echo -n "ディープラーニングは万能薬ではありません" >text.txt + +curl -s \ + -X POST \ + "127.0.0.1:50021/audio_query?style_id=1" \ + --get --data-urlencode text@text.txt \ + > query.json + +cat query.json | grep -o -E "\"kana\":\".*\"" +# 結果... "kana":"ディ'イプ/ラ'アニングワ/バンノオヤクデワアリマセ'ン" + +# "ディイプラ'アニングワ/バンノ'オヤクデワ/アリマセ'ン"と読ませたいので、 +# is_kana=trueをつけてイントネーションを取得しnewphrases.jsonに保存 +echo -n "ディイプラ'アニングワ/バンノ'オヤクデワ/アリマセ'ン" > kana.txt +curl -s \ + -X POST \ + "127.0.0.1:50021/accent_phrases?style_id=1&is_kana=true" \ + --get --data-urlencode text@kana.txt \ + > newphrases.json + +# query.jsonの"accent_phrases"の内容をnewphrases.jsonの内容に置き換える +cat query.json | sed -e "s/\[{.*}\]/$(cat newphrases.json)/g" > newquery.json + +curl -s \ + -H "Content-Type: application/json" \ + -X POST \ + -d @newquery.json \ + "127.0.0.1:50021/synthesis?style_id=1" \ + > audio.wav +``` + +### ユーザー辞書機能について + +API からユーザー辞書の参照、単語の追加、編集、削除を行うことができます。 + +#### 参照 + +`/user_dict`に GET リクエストを投げることでユーザー辞書の一覧を取得することができます。 + +```bash +curl -s -X GET "127.0.0.1:50021/user_dict" +``` + +#### 単語追加 + +`/user_dict_word`に POST リクエストを投げる事でユーザー辞書に単語を追加することができます。 +URL パラメータとして、以下が必要です。 + +- surface (辞書に登録する単語) +- pronunciation (カタカナでの読み方) +- accent_type (アクセント核位置、整数) + +アクセント核位置については、こちらの文章が参考になるかと思います。 +〇型となっている数字の部分がアクセント核位置になります。 +https://tdmelodic.readthedocs.io/ja/latest/pages/introduction.html + +成功した場合の返り値は単語に割り当てられる UUID の文字列になります。 + +```bash +surface="test" +pronunciation="テスト" +accent_type="1" + +curl -s -X POST "127.0.0.1:50021/user_dict_word" \ + --get \ + --data-urlencode "surface=$surface" \ + --data-urlencode "pronunciation=$pronunciation" \ + --data-urlencode "accent_type=$accent_type" +``` + +#### 単語修正 + +`/user_dict_word/{word_uuid}`に PUT リクエストを投げる事でユーザー辞書の単語を修正することができます。 +URL パラメータとして、以下が必要です。 + +- surface (辞書に登録するワード) +- pronunciation (カタカナでの読み方) +- accent_type (アクセント核位置、整数) + +word_uuid は単語追加時に確認できるほか、ユーザー辞書を参照することでも確認できます。 +成功した場合の返り値は`204 No Content`になります。 + +```bash +surface="test2" +pronunciation="テストツー" +accent_type="2" +# 環境によってword_uuidは適宜書き換えてください +word_uuid="cce59b5f-86ab-42b9-bb75-9fd3407f1e2d" + +curl -s -X PUT "127.0.0.1:50021/user_dict_word/$word_uuid" \ + --get \ + --data-urlencode "surface=$surface" \ + --data-urlencode "pronunciation=$pronunciation" \ + --data-urlencode "accent_type=$accent_type" +``` + +#### 単語削除 + +`/user_dict_word/{word_uuid}`に DELETE リクエストを投げる事でユーザー辞書の単語を削除することができます。 + +word_uuid は単語追加時に確認できるほか、ユーザー辞書を参照することでも確認できます。 +成功した場合の返り値は`204 No Content`になります。 + +```bash +# 環境によってword_uuidは適宜書き換えてください +word_uuid="cce59b5f-86ab-42b9-bb75-9fd3407f1e2d" + +curl -s -X DELETE "127.0.0.1:50021/user_dict_word/$word_uuid" +``` + +### プリセット機能について + +`presets.yaml`を編集することで話者や話速などのプリセットを使うことができます。 + +```bash +echo -n "プリセットをうまく活用すれば、サードパーティ間で同じ設定を使うことができます" >text.txt + +# プリセット情報を取得 +curl -s -X GET "127.0.0.1:50021/presets" > presets.json + +preset_id=$(cat presets.json | sed -r 's/^.+"id"\:\s?([0-9]+?).+$/\1/g') +style_id=$(cat presets.json | sed -r 's/^.+"style_id"\:\s?([0-9]+?).+$/\1/g') + +# AudioQueryの取得 +curl -s \ + -X POST \ + "127.0.0.1:50021/audio_query_from_preset?preset_id=$preset_id"\ + --get --data-urlencode text@text.txt \ + > query.json + +# 音声合成 +curl -s \ + -H "Content-Type: application/json" \ + -X POST \ + -d @query.json \ + "127.0.0.1:50021/synthesis?style_id=$style_id" \ + > audio.wav +``` + +- `speaker_uuid`は、`/speakers`で確認できます +- `id`は重複してはいけません +- エンジン起動後にファイルを書き換えるとエンジンに反映されます + +### 2 人の話者でモーフィングするサンプルコード + +`/synthesis_morphing`では、2 人の話者でそれぞれ合成された音声を元に、モーフィングした音声を生成します。 + +```bash +echo -n "モーフィングを利用することで、2つの声を混ぜることができます。" > text.txt + +curl -s \ + -X POST \ + "127.0.0.1:50021/audio_query?style_id=0"\ + --get --data-urlencode text@text.txt \ + > query.json + +# 元の話者での合成結果 +curl -s \ + -H "Content-Type: application/json" \ + -X POST \ + -d @query.json \ + "127.0.0.1:50021/synthesis?style_id=0" \ + > audio.wav + +export MORPH_RATE=0.5 + +# 話者2人分の音声合成+WORLDによる音声分析が入るため時間が掛かるので注意 +curl -s \ + -H "Content-Type: application/json" \ + -X POST \ + -d @query.json \ + "127.0.0.1:50021/synthesis_morphing?base_speaker=0&target_speaker=1&morph_rate=$MORPH_RATE" \ + > audio.wav + +export MORPH_RATE=0.9 + +# query、base_speaker、target_speakerが同じ場合はキャッシュが使用されるため比較的高速に生成される +curl -s \ + -H "Content-Type: application/json" \ + -X POST \ + -d @query.json \ + "127.0.0.1:50021/synthesis_morphing?base_speaker=0&target_speaker=1&morph_rate=$MORPH_RATE" \ + > audio.wav +``` + +### 話者の追加情報を取得するサンプルコード + +追加情報の中の portrait.png を取得するコードです。 +([jq](https://stedolan.github.io/jq/)を使用して json をパースしています。) + +```bash +curl -s -X GET "127.0.0.1:50021/speaker_info?speaker_uuid=7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff" \ + | jq -r ".portrait" \ + | base64 -d \ + > portrait.png +``` + +### キャンセル可能な音声合成 + +`/cancellable_synthesis`では通信を切断した場合に即座に計算リソースが開放されます。 +(`/synthesis`では通信を切断しても最後まで音声合成の計算が行われます) +この API は実験的機能であり、エンジン起動時に引数で`--enable_cancellable_synthesis`を指定しないと有効化されません。 +音声合成に必要なパラメータは`/synthesis`と同様です。 + +### CORS 設定 + +VOICEVOX ではセキュリティ保護のため`localhost`・`127.0.0.1`・`app://`・Origin なし以外の Origin からリクエストを受け入れないようになっています。 +そのため、一部のサードパーティアプリからのレスポンスを受け取れない可能性があります。 +これを回避する方法として、エンジンから設定できる UI を用意しています。 + +#### 設定方法 + +1. にアクセスします。 +2. 利用するアプリに合わせて設定を変更、追加してください。 +3. 保存ボタンを押して、変更を確定してください。 +4. 設定の適用にはエンジンの再起動が必要です。必要に応じて再起動をしてください。 + +### その他の引数 + +エンジン起動時に引数を指定できます。詳しいことは`-h`引数でヘルプを確認してください。 + +```bash +$ python run.py -h + +usage: run.py [-h] [--host HOST] [--port PORT] [--use_gpu] [--voicevox_dir VOICEVOX_DIR] [--voicelib_dir VOICELIB_DIR] [--runtime_dir RUNTIME_DIR] [--enable_mock] [--enable_cancellable_synthesis] + [--init_processes INIT_PROCESSES] [--load_all_models] [--cpu_num_threads CPU_NUM_THREADS] [--output_log_utf8] [--cors_policy_mode {CorsPolicyMode.all,CorsPolicyMode.localapps}] + [--allow_origin [ALLOW_ORIGIN ...]] [--setting_file SETTING_FILE] [--preset_file PRESET_FILE] + +VOICEVOX のエンジンです。 + +options: + -h, --help show this help message and exit + --host HOST 接続を受け付けるホストアドレスです。 + --port PORT 接続を受け付けるポート番号です。 + --use_gpu 指定するとGPUを使って音声合成するようになります。 + --voicevox_dir VOICEVOX_DIR + VOICEVOXのディレクトリパスです。 + --voicelib_dir VOICELIB_DIR + VOICEVOX COREのディレクトリパスです。 + --runtime_dir RUNTIME_DIR + VOICEVOX COREで使用するライブラリのディレクトリパスです。 + --enable_mock 指定するとVOICEVOX COREを使わずモックで音声合成を行います。 + --enable_cancellable_synthesis + 指定すると音声合成を途中でキャンセルできるようになります。 + --init_processes INIT_PROCESSES + cancellable_synthesis機能の初期化時に生成するプロセス数です。 + --load_all_models 指定すると起動時に全ての音声合成モデルを読み込みます。 + --cpu_num_threads CPU_NUM_THREADS + 音声合成を行うスレッド数です。指定しないと、代わりに環境変数VV_CPU_NUM_THREADSの値が使われます。VV_CPU_NUM_THREADSが空文字列でなく数値でもない場合はエラー終了します。 + --output_log_utf8 指定するとログ出力をUTF-8でおこないます。指定しないと、代わりに環境変数 VV_OUTPUT_LOG_UTF8 の値が使われます。VV_OUTPUT_LOG_UTF8 の値が1の場合はUTF-8で、0または空文字、値がない場合は環境によって自動的に決定されます。 + --cors_policy_mode {CorsPolicyMode.all,CorsPolicyMode.localapps} + CORSの許可モード。allまたはlocalappsが指定できます。allはすべてを許可します。localappsはオリジン間リソース共有ポリシーを、app://.とlocalhost関連に限定します。その他のオリジンはallow_originオプションで追加できます。デフォルトはlocalapps。 + --allow_origin [ALLOW_ORIGIN ...] + 許可するオリジンを指定します。スペースで区切ることで複数指定できます。 + --setting_file SETTING_FILE + 設定ファイルを指定できます。 + --preset_file PRESET_FILE + プリセットファイルを指定できます。指定がない場合、環境変数 VV_PRESET_FILE、--voicevox_dirのpresets.yaml、実行ファイルのディレクトリのpresets.yamlを順に探します。 +``` + +## アップデート + +エンジンディレクトリ内にあるファイルを全て消去し、新しいものに置き換えてください。 + +## Docker イメージ + +### CPU + +```bash +docker pull voicevox/voicevox_engine:cpu-ubuntu20.04-latest +docker run --rm -p '127.0.0.1:50021:50021' voicevox/voicevox_engine:cpu-ubuntu20.04-latest +``` + +### GPU + +```bash +docker pull voicevox/voicevox_engine:nvidia-ubuntu20.04-latest +docker run --rm --gpus all -p '127.0.0.1:50021:50021' voicevox/voicevox_engine:nvidia-ubuntu20.04-latest +``` + +#### トラブルシューティング + +GPU 版を利用する場合、環境によってエラーが発生することがあります。その場合、`--runtime=nvidia`を`docker run`につけて実行すると解決できることがあります。 + +## 貢献者の方へ + +Issue を解決するプルリクエストを作成される際は、別の方と同じ Issue に取り組むことを避けるため、 +Issue 側で取り組み始めたことを伝えるか、最初に Draft プルリクエストを作成してください。 + +[VOICEVOX 非公式 Discord サーバー](https://discord.gg/WMwWetrzuh)にて、開発の議論や雑談を行っています。気軽にご参加ください。 + +## 環境構築 + +`Python 3.11.3` を用いて開発されています。 +インストールするには、各 OS ごとの C/C++ コンパイラ、CMake が必要になります。 + +```bash +# 開発に必要なライブラリのインストール +python -m pip install -r requirements-dev.txt -r requirements-test.txt + +# とりあえず実行したいだけなら代わりにこちら +python -m pip install -r requirements.txt +``` + +## 実行 + +コマンドライン引数の詳細は以下のコマンドで確認してください。 + +```bash +python run.py --help +``` + +```bash +# 製品版 VOICEVOX でサーバーを起動 +VOICEVOX_DIR="C:/path/to/voicevox" # 製品版 VOICEVOX ディレクトリのパス +python run.py --voicevox_dir=$VOICEVOX_DIR +``` + + + +```bash +# モックでサーバー起動 +python run.py --enable_mock +``` + +```bash +# ログをUTF8に変更 +python run.py --output_log_utf8 +# もしくは VV_OUTPUT_LOG_UTF8=1 python run.py +``` + +### CPU スレッド数を指定する + +CPU スレッド数が未指定の場合は、論理コア数の半分か物理コア数が使われます。(殆どの CPU で、これは全体の処理能力の半分です) +もし IaaS 上で実行していたり、専用サーバーで実行している場合など、 +エンジンが使う処理能力を調節したい場合は、CPU スレッド数を指定することで実現できます。 + +- 実行時引数で指定する + + ```bash + python run.py --voicevox_dir=$VOICEVOX_DIR --cpu_num_threads=4 + ``` + +- 環境変数で指定する + ```bash + export VV_CPU_NUM_THREADS=4 + python run.py --voicevox_dir=$VOICEVOX_DIR + ``` + +### 過去のバージョンのコアを使う + +VOICEVOX Core 0.5.4 以降のコアを使用する事が可能です。 +Mac での libtorch 版コアのサポートはしていません。 + +#### 過去のバイナリを指定する + +製品版 VOICEVOX もしくはコンパイル済みエンジンのディレクトリを`--voicevox_dir`引数で指定すると、そのバージョンのコアが使用されます。 + +```bash +python run.py --voicevox_dir="/path/to/voicevox" +``` + +Mac では、`DYLD_LIBRARY_PATH`の指定が必要です。 + +```bash +DYLD_LIBRARY_PATH="/path/to/voicevox" python run.py --voicevox_dir="/path/to/voicevox" +``` + +#### 音声ライブラリを直接指定する + +[VOICEVOX Core の zip ファイル](https://github.com/VOICEVOX/voicevox_core/releases)を解凍したディレクトリを`--voicelib_dir`引数で指定します。 +また、コアのバージョンに合わせて、[libtorch](https://pytorch.org/)や[onnxruntime](https://github.com/microsoft/onnxruntime)のディレクトリを`--runtime_dir`引数で指定します。 +ただし、システムの探索パス上に libtorch、onnxruntime がある場合、`--runtime_dir`引数の指定は不要です。 +`--voicelib_dir`引数、`--runtime_dir`引数は複数回使用可能です。 +API エンドポイントでコアのバージョンを指定する場合は`core_version`引数を指定してください。(未指定の場合は最新のコアが使用されます) + +```bash +python run.py --voicelib_dir="/path/to/voicevox_core" --runtime_dir="/path/to/libtorch_or_onnx" +``` + +Mac では、`--runtime_dir`引数の代わりに`DYLD_LIBRARY_PATH`の指定が必要です。 + +```bash +DYLD_LIBRARY_PATH="/path/to/onnx" python run.py --voicelib_dir="/path/to/voicevox_core" +``` + +## コードフォーマット + +このソフトウェアでは、リモートにプッシュする前にコードフォーマットを確認する仕組み(静的解析ツール)を利用できます。 +利用するには、開発に必要なライブラリのインストールに加えて、以下のコマンドを実行してください。 +プルリクエストを作成する際は、利用することを推奨します。 + +```bash +pre-commit install -t pre-push +``` + +エラーが出た際は、以下のコマンドで修正することが可能です。なお、完全に修正できるわけではないので注意してください。 + +```bash +pysen run format lint +``` + +## テスト + +```bash +python -m pytest +``` + +## タイポチェック + +[typos](https://github.com/crate-ci/typos) を使ってタイポのチェックを行っています。 +[typos をインストール](https://github.com/crate-ci/typos#install) した後 + +```bash +typos +``` + +でタイポチェックを行えます。 +もし誤判定やチェックから除外すべきファイルがあれば +[設定ファイルの説明](https://github.com/crate-ci/typos#false-positives) に従って`_typos.toml`を編集してください。 + +## API ドキュメントの確認 + +[API ドキュメント](https://voicevox.github.io/voicevox_engine/api/)(実体は`docs/api/index.html`)は自動で更新されます。 +次のコマンドで API ドキュメントを手動で作成することができます。 + +```bash +python make_docs.py +``` + +## ビルド + +この方法でビルドしたものは、リリースで公開されているものとは異なります。 +また、GPU で利用するには cuDNN や CUDA、DirectML などのライブラリが追加で必要となります。 + +```bash +python -m pip install -r requirements-dev.txt + +OUTPUT_LICENSE_JSON_PATH=licenses.json \ +bash build_util/create_venv_and_generate_licenses.bash + +# モックでビルドする場合 +pyinstaller --noconfirm run.spec + +# 製品版でビルドする場合 +CORE_MODEL_DIR_PATH="/path/to/core_model" \ +LIBCORE_PATH="/path/to/libcore" \ +LIBONNXRUNTIME_PATH="/path/to/libonnxruntime" \ +pyinstaller --noconfirm run.spec +``` + +## 依存関係 + +### 更新 + +[Poetry](https://python-poetry.org/) を用いて依存ライブラリのバージョンを固定しています。 +以下のコマンドで操作できます: + +```bash +# パッケージを追加する場合 +poetry add `パッケージ名` +poetry add --group dev `パッケージ名` # 開発依存の追加 +poetry add --group test `パッケージ名` # テスト依存の追加 + +# パッケージをアップデートする場合 +poetry update `パッケージ名` +poetry update # 全部更新 + +# requirements.txtの更新 +poetry export --without-hashes -o requirements.txt # こちらを更新する場合は下3つも更新する必要があります。 +poetry export --without-hashes --with dev -o requirements-dev.txt +poetry export --without-hashes --with test -o requirements-test.txt +poetry export --without-hashes --with license -o requirements-license.txt +``` + +### ライセンス + +依存ライブラリは「コアビルド時にリンクして一体化しても、コア部のコード非公開 OK」なライセンスを持つ必要があります。 +主要ライセンスの可否は以下の通りです。 + +- MIT/Apache/BSD-3: OK +- LGPL: OK (コアと動的分離されているため) +- GPL: NG (全関連コードの公開が必要なため) + +## ユーザー辞書の更新について + +以下のコマンドで openjtalk のユーザー辞書をコンパイルできます。 + +```bash +python -c "import pyopenjtalk; pyopenjtalk.create_user_dict('default.csv','user.dic')" +``` + +## マルチエンジン機能に関して + +VOICEVOX エディターでは、複数のエンジンを同時に起動することができます。 +この機能を利用することで、自作の音声合成エンジンや既存の音声合成エンジンを VOICEVOX エディター上で動かすことが可能です。 + + + + + +### マルチエンジン機能の仕組み + +VOICEVOX API に準拠した複数のエンジンの Web API をポートを分けて起動し、統一的に扱うことでマルチエンジン機能を実現しています。 +エディターがそれぞれのエンジンを実行バイナリ経由で起動し、EngineID と結びつけて設定や状態を個別管理します。 + +### マルチエンジン機能への対応方法 + +VOICEVOX API 準拠エンジンを起動する実行バイナリを作ることで対応が可能です。 +VOICEVOX ENGINE リポジトリを fork し、一部の機能を改造するのが簡単です。 + +改造すべき点はエンジン情報・キャラクター情報・音声合成の3点です。 + +エンジンの情報はエンジンマニフェスト(`engine_manifest.json`)で管理されています。 +マニフェストファイル内の情報を見て適宜変更してください。 +音声合成手法によっては、例えばモーフィング機能など、VOICEVOX と同じ機能を持つことができない場合があります。 +その場合はマニフェストファイル内の`supported_features`内の情報を適宜変更してください。 + +キャラクター情報は`speaker_info`ディレクトリ内のファイルで管理されています。 +ダミーのアイコンなどが用意されているので適宜変更してください。 + +音声合成は`voicevox_engine/synthesis_engine/synthesis_engine.py`で行われています。 +VOICEVOX API での音声合成は、エンジン側で音声合成クエリ`AudioQuery`の初期値を作成してユーザーに返し、ユーザーが必要に応じてクエリを編集したあと、エンジンがクエリに従って音声合成することで実現しています。 +クエリ作成は`/audio_query`エンドポイントで、音声合成は`/synthesis`エンドポイントで行っており、最低この2つに対応すれば VOICEVOX API に準拠したことになります。 + +### マルチエンジン機能対応エンジンの配布方法 + +VVPP ファイルとして配布するのがおすすめです。 +VVPP は「VOICEVOX プラグインパッケージ」の略で、中身はビルドしたエンジンなどを含んだディレクトリの Zip ファイルです。 +拡張子を`.vvpp`にすると、ダブルクリックで VOICEVOX エディターにインストールできます。 + +エディター側は受け取った VVPP ファイルをローカルディスク上に Zip 展開したあと、ルートの直下にある`engine_manifest.json`に従ってファイルを探査します。 +VOICEVOX エディターにうまく読み込ませられないときは、エディターのエラーログを参照してください。 + +また、`xxx.vvpp`は分割して連番を付けた`xxx.0.vvppp`ファイルとして配布することも可能です。 +これはファイル容量が大きくて配布が困難な場合に有用です。 + + + +## GitHub Actions + +### Variables + +| name | description | +| :----------------- | :------------------ | +| DOCKERHUB_USERNAME | Docker Hub ユーザ名 | + +### Secrets + +| name | description | +| :-------------- | :---------------------------------------------------------------------- | +| DOCKERHUB_TOKEN | [Docker Hub アクセストークン](https://hub.docker.com/settings/security) | + +## 事例紹介 + +**[voicevox-client](https://github.com/tuna2134/voicevox-client) [@tuna2134](https://github.com/tuna2134)** ・・・ VOICEVOX ENGINE のための Python ラッパー + + + +## ライセンス + +LGPL v3 と、ソースコードの公開が不要な別ライセンスのデュアルライセンスです。 +別ライセンスを取得したい場合は、ヒホ(twitter: @hiho_karuta)に求めてください。 diff --git a/voicevox_nemo_engine/_typos.toml b/voicevox_nemo_engine/_typos.toml new file mode 100644 index 0000000000000000000000000000000000000000..e02a7b5e32629181d0edce9223c94eccd59e7ec5 --- /dev/null +++ b/voicevox_nemo_engine/_typos.toml @@ -0,0 +1,11 @@ +# Files for typos +# Instruction: https://github.com/marketplace/actions/typos-action#getting-started + +[default.extend-identifiers] + +[default.extend-words] +ba="ba" # 7zコマンドの-baオプション +datas="datas" # PyInstallerの引数 + +[files] +extend-exclude = ["package-lock.json", "src/store/project.ts", "*.svg"] diff --git a/voicevox_nemo_engine/build_util/check_release_build.py b/voicevox_nemo_engine/build_util/check_release_build.py new file mode 100644 index 0000000000000000000000000000000000000000..b1df1977f1e5d6daf00909f68c70cc64c273fc61 --- /dev/null +++ b/voicevox_nemo_engine/build_util/check_release_build.py @@ -0,0 +1,70 @@ +""" +ビルド結果をテストする +""" +import argparse +import json +import time +from io import BytesIO +from pathlib import Path +from subprocess import Popen +from urllib.parse import urlencode +from urllib.request import Request, urlopen + +import soundfile + +base_url = "http://localhost:50121/" + + +def test_release_build(dist_dir: Path, skip_run_process: bool) -> None: + run_file = dist_dir / "run" + if not run_file.exists(): + run_file = dist_dir / "run.exe" + + # 起動 + process = None + if not skip_run_process: + process = Popen([run_file.absolute()], cwd=dist_dir) + time.sleep(60) # 待機 + + # バージョン取得テスト + req = Request(base_url + "version") + with urlopen(req) as res: + assert len(res.read()) > 0 + + # テキスト -> クエリ + text = "こんにちは、音声合成の世界へようこそ" + req = Request( + base_url + "audio_query?" + urlencode({"style_id": "10001", "text": text}), + method="POST", + ) + with urlopen(req) as res: + query = json.loads(res.read().decode("utf-8")) + + # クエリ -> 音声 + req = Request(base_url + "synthesis?speaker=10001", method="POST") + req.add_header("Content-Type", "application/json") + req.data = json.dumps(query).encode("utf-8") + with urlopen(req) as res: + wave = res.read() + soundfile.read(BytesIO(wave)) + + # エンジンマニフェスト + req = Request(base_url + "engine_manifest", method="GET") + with urlopen(req) as res: + manifest = json.loads(res.read().decode("utf-8")) + assert "uuid" in manifest + + if not skip_run_process: + # プロセスが稼働中であることを確認 + assert process.poll() is None + + # 停止 + process.terminate() + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--dist_dir", type=Path, default=Path("dist/")) + parser.add_argument("--skip_run_process", action="store_true") + args = parser.parse_args() + test_release_build(dist_dir=args.dist_dir, skip_run_process=args.skip_run_process) diff --git a/voicevox_nemo_engine/build_util/codesign.bash b/voicevox_nemo_engine/build_util/codesign.bash new file mode 100644 index 0000000000000000000000000000000000000000..5c80cf55f586b9178b9b1e2bf3769e5b117f93d0 --- /dev/null +++ b/voicevox_nemo_engine/build_util/codesign.bash @@ -0,0 +1,79 @@ +#!/usr/bin/env bash +# !!! コードサイニング証明書を取り扱うので取り扱い注意 !!! + +# eSignerCKAを使ってコード署名する + +set -eu + +if [ ! -v ESIGNERCKA_USERNAME ]; then # eSignerCKAのユーザー名 + echo "ESIGNERCKA_USERNAMEが未定義です" + exit 1 +fi +if [ ! -v ESIGNERCKA_PASSWORD ]; then # eSignerCKAのパスワード + echo "ESIGNERCKA_PASSWORDが未定義です" + exit 1 +fi +if [ ! -v ESIGNERCKA_TOTP_SECRET ]; then # eSignerCKAのTOTP Secret + echo "ESIGNERCKA_TOTP_SECRETが未定義です" + exit 1 +fi + +if [ $# -ne 1 ]; then + echo "引数の数が一致しません" + exit 1 +fi +target_file_glob="$1" + +# eSignerCKAのセットアップ +INSTALL_DIR='..\eSignerCKA' +if [ ! -d "$INSTALL_DIR" ]; then + curl -LO "https://github.com/SSLcom/eSignerCKA/releases/download/v1.0.6/SSL.COM-eSigner-CKA_1.0.6.zip" + unzip -o SSL.COM-eSigner-CKA_1.0.6.zip + mv ./*eSigner*CKA_*.exe eSigner_CKA_Installer.exe + powershell " + & ./eSigner_CKA_Installer.exe /CURRENTUSER /VERYSILENT /SUPPRESSMSGBOXES /DIR='$INSTALL_DIR' | Out-Null + & '$INSTALL_DIR\eSignerCKATool.exe' config -mode product -user '$ESIGNERCKA_USERNAME' -pass '$ESIGNERCKA_PASSWORD' -totp '$ESIGNERCKA_TOTP_SECRET' -key '$INSTALL_DIR\master.key' -r + & '$INSTALL_DIR\eSignerCKATool.exe' unload + " + rm SSL.COM-eSigner-CKA_1.0.6.zip eSigner_CKA_Installer.exe +fi + +# 証明書を読み込む +powershell "& '$INSTALL_DIR\eSignerCKATool.exe' load" + +# shellcheck disable=SC2016 +THUMBPRINT=$( + powershell ' + $CodeSigningCert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert | Select-Object -First 1 + echo "$($CodeSigningCert.Thumbprint)" + ' +) + +# 指定ファイルに署名する +function codesign() { + TARGET="$1" + # shellcheck disable=SC2012 + SIGNTOOL=$(ls "C:/Program Files (x86)/Windows Kits/"10/bin/*/x86/signtool.exe | sort -V | tail -n 1) # なぜかこれじゃないと動かない + powershell "& '$SIGNTOOL' sign /fd SHA256 /td SHA256 /tr http://timestamp.digicert.com /sha1 '$THUMBPRINT' '$TARGET'" +} + +# 指定ファイルが署名されているか +function is_signed() { + TARGET="$1" + SIGNTOOL=$(find "C:/Program Files (x86)/Windows Kits/10/App Certification Kit" -name "signtool.exe" | sort -V | tail -n 1) + powershell "& '$SIGNTOOL' verify /pa '$TARGET'" >/dev/null 2>&1 || return 1 +} + +# 署名されていなければ署名 +# shellcheck disable=SC2012,SC2086 +ls $target_file_glob | while read -r target_file; do + if is_signed "$target_file"; then + echo "署名済み: $target_file" + else + echo "署名開始: $target_file" + codesign "$target_file" + fi +done + +# 証明書を破棄 +powershell "& '$INSTALL_DIR\eSignerCKATool.exe' unload" diff --git a/voicevox_nemo_engine/build_util/create_venv_and_generate_licenses.bash b/voicevox_nemo_engine/build_util/create_venv_and_generate_licenses.bash new file mode 100644 index 0000000000000000000000000000000000000000..d2c837dbfad2f66bf1c3d73f19199e6fa93910dd --- /dev/null +++ b/voicevox_nemo_engine/build_util/create_venv_and_generate_licenses.bash @@ -0,0 +1,24 @@ +# 仮想環境を作ってrequirements.txtをインストールし、ライセンス一覧を生成する + +set -eux + +if [ ! -v OUTPUT_LICENSE_JSON_PATH ]; then + echo "OUTPUT_LICENSE_JSON_PATHが未定義です" + exit 1 +fi + +VENV_PATH="licenses_venv" + +python -m venv $VENV_PATH +if [ -d "$VENV_PATH/Scripts" ]; then + source $VENV_PATH/Scripts/activate +else + source $VENV_PATH/bin/activate +fi + +pip install -r requirements-license.txt +python generate_licenses.py >$OUTPUT_LICENSE_JSON_PATH + +deactivate + +rm -rf $VENV_PATH diff --git a/voicevox_nemo_engine/build_util/merge_update_infos.py b/voicevox_nemo_engine/build_util/merge_update_infos.py new file mode 100644 index 0000000000000000000000000000000000000000..d3a5bb3a820afc805c5b039b7c3786855ad29d4f --- /dev/null +++ b/voicevox_nemo_engine/build_util/merge_update_infos.py @@ -0,0 +1,57 @@ +""" +更新履歴をマージする。 +""" + +import argparse +import json +from collections import OrderedDict +from pathlib import Path +from typing import Dict, List, Union + + +def merge_json_string(src: str, dst: str) -> str: + """ + バージョンが同じ場合は要素を結合する + >>> src = '[{"version": "0.0.1", "a": ["a1"], "b": ["b1", "b2"]}]' + >>> dst = '[{"version": "0.0.1", "a": ["a2"], "b": ["b1", "b3"]}]' + >>> merge_json_string(src, dst) + '[{"version": "0.0.1", "a": ["a1", "a2"], "b": ["b1", "b2", "b3"]}]' + + バージョンが無かった場合は無視される + >>> src = '[{"version": "1"}]' + >>> dst = '[{"version": "1"}, {"version": "2"}]' + >>> merge_json_string(src, dst) + '[{"version": "1"}]' + """ + src_json: List[Dict[str, Union[str, List[str]]]] = json.loads(src) + dst_json: List[Dict[str, Union[str, List[str]]]] = json.loads(dst) + + for src_item in src_json: + for dst_item in dst_json: + if src_item["version"] == dst_item["version"]: + for key in src_item: + if key == "version": + continue + + # 異なるものがあった場合だけ後ろに付け足す + src_item[key] = list( + OrderedDict.fromkeys(src_item[key] + dst_item[key]) + ) + + return json.dumps(src_json) + + +def merge_update_infos(src_path: Path, dst_path: Path, output_path: Path) -> None: + src = src_path.read_text(encoding="utf-8") + dst = dst_path.read_text(encoding="utf-8") + merged = merge_json_string(src, dst) + output_path.write_text(merged) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("src_path", type=Path) + parser.add_argument("dst_path", type=Path) + parser.add_argument("output_path", type=Path) + args = parser.parse_args() + merge_update_infos(args.src_path, args.dst_path, args.output_path) diff --git a/voicevox_nemo_engine/build_util/modify_pyinstaller.bash b/voicevox_nemo_engine/build_util/modify_pyinstaller.bash new file mode 100644 index 0000000000000000000000000000000000000000..a38e1656f7cd244815d4cc131dc6793370e87f17 --- /dev/null +++ b/voicevox_nemo_engine/build_util/modify_pyinstaller.bash @@ -0,0 +1,25 @@ +#!/bin/bash + +# PyInstallerをカスタマイズしてから再インストールする +# 良いGPUが自動的に選択されるようにしている +# https://github.com/VOICEVOX/voicevox_engine/issues/502 + +set -eux + +pyinstaller_version=$(pyinstaller -v) +tempdir=$(mktemp -dt modify_pyinstaller.XXXXXXXX) +trap 'rm -rf "$tempdir"' EXIT +git clone https://github.com/pyinstaller/pyinstaller.git "$tempdir" -b "v$pyinstaller_version" --depth 1 +cat > "$tempdir/bootloader/src/symbols.c" << EOF +#ifdef _WIN32 +#include + +// https://docs.nvidia.com/gameworks/content/technologies/desktop/optimus.htm +__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; + +// https://gpuopen.com/learn/amdpowerxpressrequesthighperformance/ +__declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001; +#endif +EOF +(cd "$tempdir/bootloader" && python ./waf all --msvc_targets="x64") +pip install -U "$tempdir" diff --git a/voicevox_nemo_engine/build_util/process_voicevox_resource.bash b/voicevox_nemo_engine/build_util/process_voicevox_resource.bash new file mode 100644 index 0000000000000000000000000000000000000000..d856e91ab26d63e59a7b62031557e366fc1a2950 --- /dev/null +++ b/voicevox_nemo_engine/build_util/process_voicevox_resource.bash @@ -0,0 +1,27 @@ +set -eux + +if [ ! -v DOWNLOAD_RESOURCE_PATH ]; then + echo "DOWNLOAD_RESOURCE_PATHが未定義です" + exit 1 +fi + +rm -r speaker_info +cp -r $DOWNLOAD_RESOURCE_PATH/voicevox_nemo/character_info speaker_info + +# キャラクター情報の前処理をする +python $DOWNLOAD_RESOURCE_PATH/scripts/clean_character_info.py \ + --character_info_dir speaker_info/ + +# マニフェスト +jq -s '.[0] * .[1]' engine_manifest.json $DOWNLOAD_RESOURCE_PATH/voicevox_nemo/engine/engine_manifest.json \ + > engine_manifest.json.tmp +mv engine_manifest.json.tmp engine_manifest.json + +python build_util/merge_update_infos.py \ + engine_manifest_assets/update_infos.json \ + $DOWNLOAD_RESOURCE_PATH/voicevox_nemo/engine/engine_manifest_assets/update_infos.json \ + engine_manifest_assets/update_infos.json + +for f in $(ls $DOWNLOAD_RESOURCE_PATH/voicevox_nemo/engine/engine_manifest_assets/* | grep -v update_infos.json); do + cp $f ./engine_manifest_assets/ +done diff --git a/voicevox_nemo_engine/default.csv b/voicevox_nemo_engine/default.csv new file mode 100644 index 0000000000000000000000000000000000000000..8038e411c0249a6d2f7e13d5fb06d690e13afa19 --- /dev/null +++ b/voicevox_nemo_engine/default.csv @@ -0,0 +1,75 @@ +あいえるたん,1351,1351,0,名詞,固有名詞,人名,名,*,*,*,アイエルタン,アイエルタン,0/6,C1 +藍田,1350,1350,5000,名詞,固有名詞,人名,姓,*,*,*,アイダ,アイダ,0/3,C1 +朱司,1351,1351,0,名詞,固有名詞,人名,名,*,*,*,アカシ,アカシ,1/3,C1 +青山,1350,1350,5000,名詞,固有名詞,人名,姓,*,*,*,アオヤマ,アオヤマ,2/4,C1 +雨晴,1350,1350,7000,名詞,固有名詞,人名,姓,*,*,*,アメハレ,アメハレ,2/4,C1 +アル,1351,1351,7000,名詞,固有名詞,人名,名,*,*,*,アル,アル,1/2,C1 +うさぎ,1351,1351,7000,名詞,固有名詞,人名,名,*,*,*,ウサギ,ウサギ,0/3,C1 +櫻歌,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,オウカ,オーカ,1/3,C1 +音街,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,オトマチ,オトマチ,2/4,C1 +春日部,1350,1350,8600,名詞,固有名詞,人名,姓,*,*,*,カスカベ,カスカベ,0/4,C1 +麒ヶ島,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,キガシマ,キガシマ,2/4,C1 +紲星,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,キズナ,キズナ,1/3,C1 +九州,1350,1350,8600,名詞,固有名詞,人名,姓,*,*,*,キュウシュウ,キュウシュウ,1/4,C1 +キョウコ,1351,1351,0,名詞,固有名詞,人名,名,*,*,*,キョオコ,キョオコ,1/3,C1 +栗田,1350,1350,5000,名詞,固有名詞,人名,姓,*,*,*,クリタ,クリタ,1/3,C1 +玄野,1350,1350,5000,名詞,固有名詞,人名,姓,*,*,*,クロノ,クロノ,1/3,C1 +剣崎,1350,1350,5000,名詞,固有名詞,人名,姓,*,*,*,ケンザキ,ケンザキ,1/4,C1 +後鬼,1351,1351,0,名詞,固有名詞,人名,名,*,*,*,ゴキ,ゴキ,1/2,C1 +虎太郎,1351,1351,5000,名詞,固有名詞,人名,名,*,*,*,コタロウ,コタロー,4/4,C1 +琴葉,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,コトノハ,コトノハ,0/4,C1 +琴詠,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,コトヨミ,コトヨミ,0/4,C1 +小夜,1351,1351,2200,名詞,固有名詞,人名,名,*,*,*,サヨ,サヨ,1/2,C1 +四国,1350,1350,2200,名詞,固有名詞,人名,姓,*,*,*,シコク,シコク,1/3,C1 +白上,1350,1350,5000,名詞,固有名詞,人名,姓,*,*,*,シラカミ,シラカミ,4/4,C1 +ずんだもん,1351,1351,0,名詞,固有名詞,人名,名,*,*,*,ズンダモン,ズンダモン,1/5,C1 +そら,1351,1351,7000,名詞,固有名詞,人名,名,*,*,*,ソラ,ソラ,1/2,C1 +宗麟,1351,1351,0,名詞,固有名詞,人名,名,*,*,*,ソウリン,ソウリン,1/4,C1 +タイプT,1351,1351,5000,名詞,固有名詞,人名,名,*,*,*,タイプティー,タイプティー,4/5,C1 +中国,1350,1350,8600,名詞,固有名詞,人名,姓,*,*,*,チュウゴク,チュウゴク,1/4,C1 +波音,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,ナミネ,ナミネ,0/3,C1 +武宏,1351,1351,5000,名詞,固有名詞,人名,名,*,*,*,タケヒロ,タケヒロ,2/4,C1 +ちび式じい,1351,1351,0,名詞,固有名詞,人名,名,*,*,*,チビシキジー,チビシキジー,5/6,C1 +月読,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,ツクヨミ,ツクヨミ,0/4,C1 +つむぎ,1351,1351,7450,名詞,固有名詞,人名,名,*,*,*,ツムギ,ツムギ,0/3,C1 +ナースロボ,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,ナースロボ,ナースロボ,4/5,C1 +ナナ,1351,1351,8600,名詞,固有名詞,人名,名,*,*,*,ナナ,ナナ,1/2,C1 +No.7,1351,1351,0,名詞,固有名詞,人名,名,*,*,*,ナンバーセブン,ナンバーセブン,5/7,C1 +ニア,1351,1351,5000,名詞,固有名詞,人名,名,*,*,*,ニア,ニア,1/2,C1 +猫使,1350,1350,2200,名詞,固有名詞,人名,姓,*,*,*,ネコツカ,ネコツカ,2/4,C1 +ノエル,1351,1351,7450,名詞,固有名詞,人名,名,*,*,*,ノエル,ノエル,1/3,C1 +はう,1351,1351,5000,名詞,固有名詞,人名,名,*,*,*,ハウ,ハウ,1/2,C1 +花丸,1351,1351,8600,名詞,固有名詞,人名,名,*,*,*,ハナマル,ハナマル,0/4,C1 +春歌,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,ハルカ,ハルカ,1/3,C1 +桜乃,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,ハルノ,ハルノ,1/3,C1 +ビィ,1351,1351,7000,名詞,固有名詞,人名,名,*,*,*,ビー,ビー,1/2,C1 +ひまり,1351,1351,7000,名詞,固有名詞,人名,名,*,*,*,ヒマリ,ヒマリ,0/3,C1 +紅桜,1351,1351,7000,名詞,固有名詞,人名,名,*,*,*,ベニザクラ,ベニザクラ,3/5,C1 +聖騎士,1350,1350,8600,名詞,固有名詞,人名,姓,*,*,*,ホーリーナイト,ホーリーナイト,5/7,C1 +WhiteCUL,1351,1351,0,名詞,固有名詞,人名,名,*,*,*,ホワイトカル,ホワイトカル,5/6,C1 +まろん,1351,1351,7450,名詞,固有名詞,人名,名,*,*,*,マロン,マロン,1/3,C1 +満別,1350,1350,8600,名詞,固有名詞,人名,姓,*,*,*,マンベツ,マンベツ,1/4,C1 +ミコ,1351,1351,3900,名詞,固有名詞,人名,名,*,*,*,ミコ,ミコ,1/2,C1 +水奈瀬,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,ミナセ,ミナセ,2/3,C1 +冥鳴,1350,1350,5000,名詞,固有名詞,人名,姓,*,*,*,メイメイ,メイメイ,1/4,C1 +鳴花,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,メイカ,メイカ,1/3,C1 +めたん,1351,1351,7000,名詞,固有名詞,人名,名,*,*,*,メタン,メタン,1/3,C1 +雌雄,1351,1351,8600,名詞,固有名詞,人名,名,*,*,*,メスオ,メスオ,0/3,C1 +もち子さん,1351,1351,0,名詞,固有名詞,人名,名,*,*,*,モチコサン,モチコサン,1/5,C1 +モチノ,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,モチノ,モチノ,0/3,C1 +結月,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,ユヅキ,ユヅキ,1/3,C1 +弓鶴,1351,1351,0,名詞,固有名詞,人名,名,*,*,*,ユヅル,ユヅル,0/3,C1 +リツ,1351,1351,3900,名詞,固有名詞,人名,名,*,*,*,リツ,リツ,1/2,C1 +六花,1351,1351,4900,名詞,固有名詞,人名,名,*,*,*,リッカ,リッカ,1/3,C1 +龍星,1351,1351,5000,名詞,固有名詞,人名,名,*,*,*,リュウセイ,リュウセイ,1/4,C1 +雀松,1350,1350,0,名詞,固有名詞,人名,姓,*,*,*,ワカマツ,ワカマツ,2/4,C1 +COEIROINK,1348,1348,0,名詞,固有名詞,一般,*,*,*,*,コエイロインク,コエイロインク,5/7,C1 +coeiroink,1348,1348,0,名詞,固有名詞,一般,*,*,*,*,コエイロインク,コエイロインク,5/7,C1 +CoeFont,1348,1348,0,名詞,固有名詞,一般,*,*,*,*,コエフォント,コエフォント,3/5,C1 +coefont,1348,1348,0,名詞,固有名詞,一般,*,*,*,*,コエフォント,コエフォント,3/5,C1 +Nemo,1348,1348,0,名詞,固有名詞,一般,*,*,*,*,ネモ,ネモ,1/2,C1 +nemo,1348,1348,0,名詞,固有名詞,一般,*,*,*,*,ネモ,ネモ,1/2,C1 +TALQu,1348,1348,0,名詞,固有名詞,一般,*,*,*,*,トーク,トーク,0/3,C1 +talqu,1348,1348,0,名詞,固有名詞,一般,*,*,*,*,トーク,トーク,0/3,C1 +VOICEVOX,1348,1348,0,名詞,固有名詞,一般,*,*,*,*,ボイスボックス,ボイスボックス,4/7,C1 +voicevox,1348,1348,0,名詞,固有名詞,一般,*,*,*,*,ボイスボックス,ボイスボックス,4/7,C1 \ No newline at end of file diff --git a/voicevox_nemo_engine/default_setting.yml b/voicevox_nemo_engine/default_setting.yml new file mode 100644 index 0000000000000000000000000000000000000000..3421e7a6a32073e3413444495b3bb37d80d4d351 --- /dev/null +++ b/voicevox_nemo_engine/default_setting.yml @@ -0,0 +1,2 @@ +allow_origin: null +cors_policy_mode: localapps diff --git "a/voicevox_nemo_engine/docs/VOICEVOX\351\237\263\345\243\260\345\220\210\346\210\220\343\202\250\343\203\263\343\202\270\343\203\263\343\201\250\343\201\256\351\200\243\346\220\272.md" "b/voicevox_nemo_engine/docs/VOICEVOX\351\237\263\345\243\260\345\220\210\346\210\220\343\202\250\343\203\263\343\202\270\343\203\263\343\201\250\343\201\256\351\200\243\346\220\272.md" new file mode 100644 index 0000000000000000000000000000000000000000..540173be1b280ce5c3593b8aed02fd42ef633f65 --- /dev/null +++ "b/voicevox_nemo_engine/docs/VOICEVOX\351\237\263\345\243\260\345\220\210\346\210\220\343\202\250\343\203\263\343\202\270\343\203\263\343\201\250\343\201\256\351\200\243\346\220\272.md" @@ -0,0 +1,7 @@ +メモ書き程度ですが、どういう方針で開発を進めているかを紹介します。 + +- バージョンが上がっても、`/audio_query`で返ってくる値をそのまま`/synthesis`に POST すれば音声合成できるようにする予定です + - `AudioQuery`のパラメータは増えますが、なるべくデフォルト値で以前と変わらない音声が生成されるようにします +- バージョン 0.7 から音声スタイルが実装されました。スタイルの情報は`/speakers`から取得できます + - スタイルの情報にある`style_id`を`speaker`に指定することで、今まで通り音声合成ができます + - style_id の指定先が speaker なのは互換性のためです diff --git a/voicevox_nemo_engine/docs/api/.gitkeep b/voicevox_nemo_engine/docs/api/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/voicevox_nemo_engine/docs/licenses/cuda/EULA.txt b/voicevox_nemo_engine/docs/licenses/cuda/EULA.txt new file mode 100644 index 0000000000000000000000000000000000000000..b1c1f891b53aebccfb4bae04dbcd53c048a7ce85 --- /dev/null +++ b/voicevox_nemo_engine/docs/licenses/cuda/EULA.txt @@ -0,0 +1,1598 @@ +End User License Agreement +-------------------------- + +NVIDIA Software License Agreement and CUDA Supplement to +Software License Agreement. Last updated: October 8, 2021 + +The CUDA Toolkit End User License Agreement applies to the +NVIDIA CUDA Toolkit, the NVIDIA CUDA Samples, the NVIDIA +Display Driver, NVIDIA Nsight tools (Visual Studio Edition), +and the associated documentation on CUDA APIs, programming +model and development tools. If you do not agree with the +terms and conditions of the license agreement, then do not +download or use the software. + +Last updated: October 8, 2021. + + +Preface +------- + +The Software License Agreement in Chapter 1 and the Supplement +in Chapter 2 contain license terms and conditions that govern +the use of NVIDIA software. By accepting this agreement, you +agree to comply with all the terms and conditions applicable +to the product(s) included herein. + + +NVIDIA Driver + + +Description + +This package contains the operating system driver and +fundamental system software components for NVIDIA GPUs. + + +NVIDIA CUDA Toolkit + + +Description + +The NVIDIA CUDA Toolkit provides command-line and graphical +tools for building, debugging and optimizing the performance +of applications accelerated by NVIDIA GPUs, runtime and math +libraries, and documentation including programming guides, +user manuals, and API references. + + +Default Install Location of CUDA Toolkit + +Windows platform: + +%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v#.# + +Linux platform: + +/usr/local/cuda-#.# + +Mac platform: + +/Developer/NVIDIA/CUDA-#.# + + +NVIDIA CUDA Samples + + +Description + +CUDA Samples are now located in +https://github.com/nvidia/cuda-samples, which includes +instructions for obtaining, building, and running the samples. +They are no longer included in the CUDA toolkit. + + +NVIDIA Nsight Visual Studio Edition (Windows only) + + +Description + +NVIDIA Nsight Development Platform, Visual Studio Edition is a +development environment integrated into Microsoft Visual +Studio that provides tools for debugging, profiling, analyzing +and optimizing your GPU computing and graphics applications. + + +Default Install Location of Nsight Visual Studio Edition + +Windows platform: + +%ProgramFiles(x86)%\NVIDIA Corporation\Nsight Visual Studio Edition #.# + + +1. License Agreement for NVIDIA Software Development Kits +--------------------------------------------------------- + + +Important Notice—Read before downloading, installing, +copying or using the licensed software: +------------------------------------------------------- + +This license agreement, including exhibits attached +("Agreement”) is a legal agreement between you and NVIDIA +Corporation ("NVIDIA") and governs your use of a NVIDIA +software development kit (“SDK”). + +Each SDK has its own set of software and materials, but here +is a description of the types of items that may be included in +a SDK: source code, header files, APIs, data sets and assets +(examples include images, textures, models, scenes, videos, +native API input/output files), binary software, sample code, +libraries, utility programs, programming code and +documentation. + +This Agreement can be accepted only by an adult of legal age +of majority in the country in which the SDK is used. + +If you are entering into this Agreement on behalf of a company +or other legal entity, you represent that you have the legal +authority to bind the entity to this Agreement, in which case +“you” will mean the entity you represent. + +If you don’t have the required age or authority to accept +this Agreement, or if you don’t accept all the terms and +conditions of this Agreement, do not download, install or use +the SDK. + +You agree to use the SDK only for purposes that are permitted +by (a) this Agreement, and (b) any applicable law, regulation +or generally accepted practices or guidelines in the relevant +jurisdictions. + + +1.1. License + + +1.1.1. License Grant + +Subject to the terms of this Agreement, NVIDIA hereby grants +you a non-exclusive, non-transferable license, without the +right to sublicense (except as expressly provided in this +Agreement) to: + + 1. Install and use the SDK, + + 2. Modify and create derivative works of sample source code + delivered in the SDK, and + + 3. Distribute those portions of the SDK that are identified + in this Agreement as distributable, as incorporated in + object code format into a software application that meets + the distribution requirements indicated in this Agreement. + + +1.1.2. Distribution Requirements + +These are the distribution requirements for you to exercise +the distribution grant: + + 1. Your application must have material additional + functionality, beyond the included portions of the SDK. + + 2. The distributable portions of the SDK shall only be + accessed by your application. + + 3. The following notice shall be included in modifications + and derivative works of sample source code distributed: + “This software contains source code provided by NVIDIA + Corporation.” + + 4. Unless a developer tool is identified in this Agreement + as distributable, it is delivered for your internal use + only. + + 5. The terms under which you distribute your application + must be consistent with the terms of this Agreement, + including (without limitation) terms relating to the + license grant and license restrictions and protection of + NVIDIA’s intellectual property rights. Additionally, you + agree that you will protect the privacy, security and + legal rights of your application users. + + 6. You agree to notify NVIDIA in writing of any known or + suspected distribution or use of the SDK not in compliance + with the requirements of this Agreement, and to enforce + the terms of your agreements with respect to distributed + SDK. + + +1.1.3. Authorized Users + +You may allow employees and contractors of your entity or of +your subsidiary(ies) to access and use the SDK from your +secure network to perform work on your behalf. + +If you are an academic institution you may allow users +enrolled or employed by the academic institution to access and +use the SDK from your secure network. + +You are responsible for the compliance with the terms of this +Agreement by your authorized users. If you become aware that +your authorized users didn’t follow the terms of this +Agreement, you agree to take reasonable steps to resolve the +non-compliance and prevent new occurrences. + + +1.1.4. Pre-Release SDK + +The SDK versions identified as alpha, beta, preview or +otherwise as pre-release, may not be fully functional, may +contain errors or design flaws, and may have reduced or +different security, privacy, accessibility, availability, and +reliability standards relative to commercial versions of +NVIDIA software and materials. Use of a pre-release SDK may +result in unexpected results, loss of data, project delays or +other unpredictable damage or loss. + +You may use a pre-release SDK at your own risk, understanding +that pre-release SDKs are not intended for use in production +or business-critical systems. + +NVIDIA may choose not to make available a commercial version +of any pre-release SDK. NVIDIA may also choose to abandon +development and terminate the availability of a pre-release +SDK at any time without liability. + + +1.1.5. Updates + +NVIDIA may, at its option, make available patches, workarounds +or other updates to this SDK. Unless the updates are provided +with their separate governing terms, they are deemed part of +the SDK licensed to you as provided in this Agreement. You +agree that the form and content of the SDK that NVIDIA +provides may change without prior notice to you. While NVIDIA +generally maintains compatibility between versions, NVIDIA may +in some cases make changes that introduce incompatibilities in +future versions of the SDK. + + +1.1.6. Components Under Other Licenses + +The SDK may come bundled with, or otherwise include or be +distributed with, NVIDIA or third-party components with +separate legal notices or terms as may be described in +proprietary notices accompanying the SDK. If and to the extent +there is a conflict between the terms in this Agreement and +the license terms associated with the component, the license +terms associated with the components control only to the +extent necessary to resolve the conflict. + +Subject to the other terms of this Agreement, you may use the +SDK to develop and test applications released under Open +Source Initiative (OSI) approved open source software +licenses. + + +1.1.7. Reservation of Rights + +NVIDIA reserves all rights, title, and interest in and to the +SDK, not expressly granted to you under this Agreement. + + +1.2. Limitations + +The following license limitations apply to your use of the +SDK: + + 1. You may not reverse engineer, decompile or disassemble, + or remove copyright or other proprietary notices from any + portion of the SDK or copies of the SDK. + + 2. Except as expressly provided in this Agreement, you may + not copy, sell, rent, sublicense, transfer, distribute, + modify, or create derivative works of any portion of the + SDK. For clarity, you may not distribute or sublicense the + SDK as a stand-alone product. + + 3. Unless you have an agreement with NVIDIA for this + purpose, you may not indicate that an application created + with the SDK is sponsored or endorsed by NVIDIA. + + 4. You may not bypass, disable, or circumvent any + encryption, security, digital rights management or + authentication mechanism in the SDK. + + 5. You may not use the SDK in any manner that would cause it + to become subject to an open source software license. As + examples, licenses that require as a condition of use, + modification, and/or distribution that the SDK be: + + a. Disclosed or distributed in source code form; + + b. Licensed for the purpose of making derivative works; + or + + c. Redistributable at no charge. + + 6. You acknowledge that the SDK as delivered is not tested + or certified by NVIDIA for use in connection with the + design, construction, maintenance, and/or operation of any + system where the use or failure of such system could + result in a situation that threatens the safety of human + life or results in catastrophic damages (each, a "Critical + Application"). Examples of Critical Applications include + use in avionics, navigation, autonomous vehicle + applications, ai solutions for automotive products, + military, medical, life support or other life critical + applications. NVIDIA shall not be liable to you or any + third party, in whole or in part, for any claims or + damages arising from such uses. You are solely responsible + for ensuring that any product or service developed with + the SDK as a whole includes sufficient features to comply + with all applicable legal and regulatory standards and + requirements. + + 7. You agree to defend, indemnify and hold harmless NVIDIA + and its affiliates, and their respective employees, + contractors, agents, officers and directors, from and + against any and all claims, damages, obligations, losses, + liabilities, costs or debt, fines, restitutions and + expenses (including but not limited to attorney’s fees + and costs incident to establishing the right of + indemnification) arising out of or related to products or + services that use the SDK in or for Critical Applications, + and for use of the SDK outside of the scope of this + Agreement or not in compliance with its terms. + + 8. You may not reverse engineer, decompile or disassemble + any portion of the output generated using SDK elements for + the purpose of translating such output artifacts to target + a non-NVIDIA platform. + + +1.3. Ownership + + 1. NVIDIA or its licensors hold all rights, title and + interest in and to the SDK and its modifications and + derivative works, including their respective intellectual + property rights, subject to your rights under Section + 1.3.2. This SDK may include software and materials from + NVIDIA’s licensors, and these licensors are intended + third party beneficiaries that may enforce this Agreement + with respect to their intellectual property rights. + + 2. You hold all rights, title and interest in and to your + applications and your derivative works of the sample + source code delivered in the SDK, including their + respective intellectual property rights, subject to + NVIDIA’s rights under Section 1.3.1. + + 3. You may, but don’t have to, provide to NVIDIA + suggestions, feature requests or other feedback regarding + the SDK, including possible enhancements or modifications + to the SDK. For any feedback that you voluntarily provide, + you hereby grant NVIDIA and its affiliates a perpetual, + non-exclusive, worldwide, irrevocable license to use, + reproduce, modify, license, sublicense (through multiple + tiers of sublicensees), and distribute (through multiple + tiers of distributors) it without the payment of any + royalties or fees to you. NVIDIA will use feedback at its + choice. NVIDIA is constantly looking for ways to improve + its products, so you may send feedback to NVIDIA through + the developer portal at https://developer.nvidia.com. + + +1.4. No Warranties + +THE SDK IS PROVIDED BY NVIDIA “AS IS” AND “WITH ALL +FAULTS.” TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND +ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND +OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, +BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, OR THE +ABSENCE OF ANY DEFECTS THEREIN, WHETHER LATENT OR PATENT. NO +WARRANTY IS MADE ON THE BASIS OF TRADE USAGE, COURSE OF +DEALING OR COURSE OF TRADE. + + +1.5. Limitation of Liability + +TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS +AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, +PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, LOSS +OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF +PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION +WITH THIS AGREEMENT OR THE USE OR PERFORMANCE OF THE SDK, +WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH +OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), +PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF +LIABILITY. IN NO EVENT WILL NVIDIA’S AND ITS AFFILIATES +TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS +AGREEMENT EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE +NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS +LIMIT. + +These exclusions and limitations of liability shall apply +regardless if NVIDIA or its affiliates have been advised of +the possibility of such damages, and regardless of whether a +remedy fails its essential purpose. These exclusions and +limitations of liability form an essential basis of the +bargain between the parties, and, absent any of these +exclusions or limitations of liability, the provisions of this +Agreement, including, without limitation, the economic terms, +would be substantially different. + + +1.6. Termination + + 1. This Agreement will continue to apply until terminated by + either you or NVIDIA as described below. + + 2. If you want to terminate this Agreement, you may do so by + stopping to use the SDK. + + 3. NVIDIA may, at any time, terminate this Agreement if: + + a. (i) you fail to comply with any term of this + Agreement and the non-compliance is not fixed within + thirty (30) days following notice from NVIDIA (or + immediately if you violate NVIDIA’s intellectual + property rights); + + b. (ii) you commence or participate in any legal + proceeding against NVIDIA with respect to the SDK; or + + c. (iii) NVIDIA decides to no longer provide the SDK in + a country or, in NVIDIA’s sole discretion, the + continued use of it is no longer commercially viable. + + 4. Upon any termination of this Agreement, you agree to + promptly discontinue use of the SDK and destroy all copies + in your possession or control. Your prior distributions in + accordance with this Agreement are not affected by the + termination of this Agreement. Upon written request, you + will certify in writing that you have complied with your + commitments under this section. Upon any termination of + this Agreement all provisions survive except for the + license grant provisions. + + +1.7. General + +If you wish to assign this Agreement or your rights and +obligations, including by merger, consolidation, dissolution +or operation of law, contact NVIDIA to ask for permission. Any +attempted assignment not approved by NVIDIA in writing shall +be void and of no effect. NVIDIA may assign, delegate or +transfer this Agreement and its rights and obligations, and if +to a non-affiliate you will be notified. + +You agree to cooperate with NVIDIA and provide reasonably +requested information to verify your compliance with this +Agreement. + +This Agreement will be governed in all respects by the laws of +the United States and of the State of Delaware as those laws +are applied to contracts entered into and performed entirely +within Delaware by Delaware residents, without regard to the +conflicts of laws principles. The United Nations Convention on +Contracts for the International Sale of Goods is specifically +disclaimed. You agree to all terms of this Agreement in the +English language. + +The state or federal courts residing in Santa Clara County, +California shall have exclusive jurisdiction over any dispute +or claim arising out of this Agreement. Notwithstanding this, +you agree that NVIDIA shall still be allowed to apply for +injunctive remedies or an equivalent type of urgent legal +relief in any jurisdiction. + +If any court of competent jurisdiction determines that any +provision of this Agreement is illegal, invalid or +unenforceable, such provision will be construed as limited to +the extent necessary to be consistent with and fully +enforceable under the law and the remaining provisions will +remain in full force and effect. Unless otherwise specified, +remedies are cumulative. + +Each party acknowledges and agrees that the other is an +independent contractor in the performance of this Agreement. + +The SDK has been developed entirely at private expense and is +“commercial items” consisting of “commercial computer +software” and “commercial computer software +documentation” provided with RESTRICTED RIGHTS. Use, +duplication or disclosure by the U.S. Government or a U.S. +Government subcontractor is subject to the restrictions in +this Agreement pursuant to DFARS 227.7202-3(a) or as set forth +in subparagraphs (c)(1) and (2) of the Commercial Computer +Software - Restricted Rights clause at FAR 52.227-19, as +applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas +Expressway, Santa Clara, CA 95051. + +The SDK is subject to United States export laws and +regulations. You agree that you will not ship, transfer or +export the SDK into any country, or use the SDK in any manner, +prohibited by the United States Bureau of Industry and +Security or economic sanctions regulations administered by the +U.S. Department of Treasury’s Office of Foreign Assets +Control (OFAC), or any applicable export laws, restrictions or +regulations. These laws include restrictions on destinations, +end users and end use. By accepting this Agreement, you +confirm that you are not a resident or citizen of any country +currently embargoed by the U.S. and that you are not otherwise +prohibited from receiving the SDK. + +Any notice delivered by NVIDIA to you under this Agreement +will be delivered via mail, email or fax. You agree that any +notices that NVIDIA sends you electronically will satisfy any +legal communication requirements. Please direct your legal +notices or other correspondence to NVIDIA Corporation, 2788 +San Tomas Expressway, Santa Clara, California 95051, United +States of America, Attention: Legal Department. + +This Agreement and any exhibits incorporated into this +Agreement constitute the entire agreement of the parties with +respect to the subject matter of this Agreement and supersede +all prior negotiations or documentation exchanged between the +parties relating to this SDK license. Any additional and/or +conflicting terms on documents issued by you are null, void, +and invalid. Any amendment or waiver under this Agreement +shall be in writing and signed by representatives of both +parties. + + +2. CUDA Toolkit Supplement to Software License Agreement for +NVIDIA Software Development Kits +------------------------------------------------------------ + +The terms in this supplement govern your use of the NVIDIA +CUDA Toolkit SDK under the terms of your license agreement +(“Agreement”) as modified by this supplement. Capitalized +terms used but not defined below have the meaning assigned to +them in the Agreement. + +This supplement is an exhibit to the Agreement and is +incorporated as an integral part of the Agreement. In the +event of conflict between the terms in this supplement and the +terms in the Agreement, the terms in this supplement govern. + + +2.1. License Scope + +The SDK is licensed for you to develop applications only for +use in systems with NVIDIA GPUs. + + +2.2. Distribution + +The portions of the SDK that are distributable under the +Agreement are listed in Attachment A. + + +2.3. Operating Systems + +Those portions of the SDK designed exclusively for use on the +Linux or FreeBSD operating systems, or other operating systems +derived from the source code to these operating systems, may +be copied and redistributed for use in accordance with this +Agreement, provided that the object code files are not +modified in any way (except for unzipping of compressed +files). + + +2.4. Audio and Video Encoders and Decoders + +You acknowledge and agree that it is your sole responsibility +to obtain any additional third-party licenses required to +make, have made, use, have used, sell, import, and offer for +sale your products or services that include or incorporate any +third-party software and content relating to audio and/or +video encoders and decoders from, including but not limited +to, Microsoft, Thomson, Fraunhofer IIS, Sisvel S.p.A., +MPEG-LA, and Coding Technologies. NVIDIA does not grant to you +under this Agreement any necessary patent or other rights with +respect to any audio and/or video encoders and decoders. + + +2.5. Licensing + +If the distribution terms in this Agreement are not suitable +for your organization, or for any questions regarding this +Agreement, please contact NVIDIA at +nvidia-compute-license-questions@nvidia.com. + + +2.6. Attachment A + +The following CUDA Toolkit files may be distributed with +Licensee Applications developed by you, including certain +variations of these files that have version number or +architecture specific information embedded in the file name - +as an example only, for release version 9.0 of the 64-bit +Windows software, the file cudart64_90.dll is redistributable. + +Component + +CUDA Runtime + +Windows + +cudart.dll, cudart_static.lib, cudadevrt.lib + +Mac OSX + +libcudart.dylib, libcudart_static.a, libcudadevrt.a + +Linux + +libcudart.so, libcudart_static.a, libcudadevrt.a + +Android + +libcudart.so, libcudart_static.a, libcudadevrt.a + +Component + +CUDA FFT Library + +Windows + +cufft.dll, cufftw.dll, cufft.lib, cufftw.lib + +Mac OSX + +libcufft.dylib, libcufft_static.a, libcufftw.dylib, +libcufftw_static.a + +Linux + +libcufft.so, libcufft_static.a, libcufftw.so, +libcufftw_static.a + +Android + +libcufft.so, libcufft_static.a, libcufftw.so, +libcufftw_static.a + +Component + +CUDA BLAS Library + +Windows + +cublas.dll, cublasLt.dll + +Mac OSX + +libcublas.dylib, libcublasLt.dylib, libcublas_static.a, +libcublasLt_static.a + +Linux + +libcublas.so, libcublasLt.so, libcublas_static.a, +libcublasLt_static.a + +Android + +libcublas.so, libcublasLt.so, libcublas_static.a, +libcublasLt_static.a + +Component + +NVIDIA "Drop-in" BLAS Library + +Windows + +nvblas.dll + +Mac OSX + +libnvblas.dylib + +Linux + +libnvblas.so + +Component + +CUDA Sparse Matrix Library + +Windows + +cusparse.dll, cusparse.lib + +Mac OSX + +libcusparse.dylib, libcusparse_static.a + +Linux + +libcusparse.so, libcusparse_static.a + +Android + +libcusparse.so, libcusparse_static.a + +Component + +CUDA Linear Solver Library + +Windows + +cusolver.dll, cusolver.lib + +Mac OSX + +libcusolver.dylib, libcusolver_static.a + +Linux + +libcusolver.so, libcusolver_static.a + +Android + +libcusolver.so, libcusolver_static.a + +Component + +CUDA Random Number Generation Library + +Windows + +curand.dll, curand.lib + +Mac OSX + +libcurand.dylib, libcurand_static.a + +Linux + +libcurand.so, libcurand_static.a + +Android + +libcurand.so, libcurand_static.a + +Component + +NVIDIA Performance Primitives Library + +Windows + +nppc.dll, nppc.lib, nppial.dll, nppial.lib, nppicc.dll, +nppicc.lib, nppicom.dll, nppicom.lib, nppidei.dll, +nppidei.lib, nppif.dll, nppif.lib, nppig.dll, nppig.lib, +nppim.dll, nppim.lib, nppist.dll, nppist.lib, nppisu.dll, +nppisu.lib, nppitc.dll, nppitc.lib, npps.dll, npps.lib + +Mac OSX + +libnppc.dylib, libnppc_static.a, libnppial.dylib, +libnppial_static.a, libnppicc.dylib, libnppicc_static.a, +libnppicom.dylib, libnppicom_static.a, libnppidei.dylib, +libnppidei_static.a, libnppif.dylib, libnppif_static.a, +libnppig.dylib, libnppig_static.a, libnppim.dylib, +libnppisu_static.a, libnppitc.dylib, libnppitc_static.a, +libnpps.dylib, libnpps_static.a + +Linux + +libnppc.so, libnppc_static.a, libnppial.so, +libnppial_static.a, libnppicc.so, libnppicc_static.a, +libnppicom.so, libnppicom_static.a, libnppidei.so, +libnppidei_static.a, libnppif.so, libnppif_static.a +libnppig.so, libnppig_static.a, libnppim.so, +libnppim_static.a, libnppist.so, libnppist_static.a, +libnppisu.so, libnppisu_static.a, libnppitc.so +libnppitc_static.a, libnpps.so, libnpps_static.a + +Android + +libnppc.so, libnppc_static.a, libnppial.so, +libnppial_static.a, libnppicc.so, libnppicc_static.a, +libnppicom.so, libnppicom_static.a, libnppidei.so, +libnppidei_static.a, libnppif.so, libnppif_static.a +libnppig.so, libnppig_static.a, libnppim.so, +libnppim_static.a, libnppist.so, libnppist_static.a, +libnppisu.so, libnppisu_static.a, libnppitc.so +libnppitc_static.a, libnpps.so, libnpps_static.a + +Component + +NVIDIA JPEG Library + +Windows + +nvjpeg.lib, nvjpeg.dll + +Linux + +libnvjpeg.so, libnvjpeg_static.a + +Component + +Internal common library required for statically linking to +cuBLAS, cuSPARSE, cuFFT, cuRAND, nvJPEG and NPP + +Mac OSX + +libculibos.a + +Linux + +libculibos.a + +Component + +NVIDIA Runtime Compilation Library and Header + +All + +nvrtc.h + +Windows + +nvrtc.dll, nvrtc-builtins.dll + +Mac OSX + +libnvrtc.dylib, libnvrtc-builtins.dylib + +Linux + +libnvrtc.so, libnvrtc-builtins.so + +Component + +NVIDIA Optimizing Compiler Library + +Windows + +nvvm.dll + +Mac OSX + +libnvvm.dylib + +Linux + +libnvvm.so + +Component + +NVIDIA Common Device Math Functions Library + +Windows + +libdevice.10.bc + +Mac OSX + +libdevice.10.bc + +Linux + +libdevice.10.bc + +Component + +CUDA Occupancy Calculation Header Library + +All + +cuda_occupancy.h + +Component + +CUDA Half Precision Headers + +All + +cuda_fp16.h, cuda_fp16.hpp + +Component + +CUDA Profiling Tools Interface (CUPTI) Library + +Windows + +cupti.dll + +Mac OSX + +libcupti.dylib + +Linux + +libcupti.so + +Component + +NVIDIA Tools Extension Library + +Windows + +nvToolsExt.dll, nvToolsExt.lib + +Mac OSX + +libnvToolsExt.dylib + +Linux + +libnvToolsExt.so + +Component + +NVIDIA CUDA Driver Libraries + +Linux + +libcuda.so, libnvidia-ptxjitcompiler.so + +Component + +NVIDIA CUDA File IO Libraries and Header + +All + +cufile.h + +Linux + +libcufile.so, libcufile_rdma.so, libcufile_static.a, +libcufile_rdma_static.a + +The NVIDIA CUDA Driver Libraries are only distributable in +applications that meet this criteria: + + 1. The application was developed starting from a NVIDIA CUDA + container obtained from Docker Hub or the NVIDIA GPU + Cloud, and + + 2. The resulting application is packaged as a Docker + container and distributed to users on Docker Hub or the + NVIDIA GPU Cloud only. + +In addition to the rights above, for parties that are +developing software intended solely for use on Jetson +development kits or Jetson modules, and running Linux for +Tegra software, the following shall apply: + + * The SDK may be distributed in its entirety, as provided by + NVIDIA, and without separation of its components, for you + and/or your licensees to create software development kits + for use only on the Jetson platform and running Linux for + Tegra software. + + +2.7. Attachment B + + +Additional Licensing Obligations + +The following third party components included in the SOFTWARE +are licensed to Licensee pursuant to the following terms and +conditions: + + 1. Licensee's use of the GDB third party component is + subject to the terms and conditions of GNU GPL v3: + + This product includes copyrighted third-party software licensed + under the terms of the GNU General Public License v3 ("GPL v3"). + All third-party software packages are copyright by their respective + authors. GPL v3 terms and conditions are hereby incorporated into + the Agreement by this reference: http://www.gnu.org/licenses/gpl.txt + + Consistent with these licensing requirements, the software + listed below is provided under the terms of the specified + open source software licenses. To obtain source code for + software provided under licenses that require + redistribution of source code, including the GNU General + Public License (GPL) and GNU Lesser General Public License + (LGPL), contact oss-requests@nvidia.com. This offer is + valid for a period of three (3) years from the date of the + distribution of this product by NVIDIA CORPORATION. + + Component License + CUDA-GDB GPL v3 + + 2. Licensee represents and warrants that any and all third + party licensing and/or royalty payment obligations in + connection with Licensee's use of the H.264 video codecs + are solely the responsibility of Licensee. + + 3. Licensee's use of the Thrust library is subject to the + terms and conditions of the Apache License Version 2.0. + All third-party software packages are copyright by their + respective authors. Apache License Version 2.0 terms and + conditions are hereby incorporated into the Agreement by + this reference. + http://www.apache.org/licenses/LICENSE-2.0.html + + In addition, Licensee acknowledges the following notice: + Thrust includes source code from the Boost Iterator, + Tuple, System, and Random Number libraries. + + Boost Software License - Version 1.0 - August 17th, 2003 + . . . . + + Permission is hereby granted, free of charge, to any person or + organization obtaining a copy of the software and accompanying + documentation covered by this license (the "Software") to use, + reproduce, display, distribute, execute, and transmit the Software, + and to prepare derivative works of the Software, and to permit + third-parties to whom the Software is furnished to do so, all + subject to the following: + + The copyright notices in the Software and this entire statement, + including the above license grant, this restriction and the following + disclaimer, must be included in all copies of the Software, in whole + or in part, and all derivative works of the Software, unless such + copies or derivative works are solely in the form of machine-executable + object code generated by a source language processor. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND + NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR + OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + 4. Licensee's use of the LLVM third party component is + subject to the following terms and conditions: + + ====================================================== + LLVM Release License + ====================================================== + University of Illinois/NCSA + Open Source License + + Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign. + All rights reserved. + + Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal with the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at Urbana- + Champaign, nor the names of its contributors may be used to endorse or + promote products derived from this Software without specific prior + written permission. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS WITH THE SOFTWARE. + + 5. Licensee's use of the PCRE third party component is + subject to the following terms and conditions: + + ------------ + PCRE LICENCE + ------------ + PCRE is a library of functions to support regular expressions whose syntax + and semantics are as close as possible to those of the Perl 5 language. + Release 8 of PCRE is distributed under the terms of the "BSD" licence, as + specified below. The documentation for PCRE, supplied in the "doc" + directory, is distributed under the same terms as the software itself. The + basic library functions are written in C and are freestanding. Also + included in the distribution is a set of C++ wrapper functions, and a just- + in-time compiler that can be used to optimize pattern matching. These are + both optional features that can be omitted when the library is built. + + THE BASIC LIBRARY FUNCTIONS + --------------------------- + Written by: Philip Hazel + Email local part: ph10 + Email domain: cam.ac.uk + University of Cambridge Computing Service, + Cambridge, England. + Copyright (c) 1997-2012 University of Cambridge + All rights reserved. + + PCRE JUST-IN-TIME COMPILATION SUPPORT + ------------------------------------- + Written by: Zoltan Herczeg + Email local part: hzmester + Emain domain: freemail.hu + Copyright(c) 2010-2012 Zoltan Herczeg + All rights reserved. + + STACK-LESS JUST-IN-TIME COMPILER + -------------------------------- + Written by: Zoltan Herczeg + Email local part: hzmester + Emain domain: freemail.hu + Copyright(c) 2009-2012 Zoltan Herczeg + All rights reserved. + + THE C++ WRAPPER FUNCTIONS + ------------------------- + Contributed by: Google Inc. + Copyright (c) 2007-2012, Google Inc. + All rights reserved. + + THE "BSD" LICENCE + ----------------- + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the name of Google + Inc. nor the names of their contributors may be used to endorse or + promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + 6. Some of the cuBLAS library routines were written by or + derived from code written by Vasily Volkov and are subject + to the Modified Berkeley Software Distribution License as + follows: + + Copyright (c) 2007-2009, Regents of the University of California + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the University of California, Berkeley nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + 7. Some of the cuBLAS library routines were written by or + derived from code written by Davide Barbieri and are + subject to the Modified Berkeley Software Distribution + License as follows: + + Copyright (c) 2008-2009 Davide Barbieri @ University of Rome Tor Vergata. + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * The name of the author may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + 8. Some of the cuBLAS library routines were derived from + code developed by the University of Tennessee and are + subject to the Modified Berkeley Software Distribution + License as follows: + + Copyright (c) 2010 The University of Tennessee. + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer listed in this license in the documentation and/or + other materials provided with the distribution. + * Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 9. Some of the cuBLAS library routines were written by or + derived from code written by Jonathan Hogg and are subject + to the Modified Berkeley Software Distribution License as + follows: + + Copyright (c) 2012, The Science and Technology Facilities Council (STFC). + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the STFC nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE STFC BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 10. Some of the cuBLAS library routines were written by or + derived from code written by Ahmad M. Abdelfattah, David + Keyes, and Hatem Ltaief, and are subject to the Apache + License, Version 2.0, as follows: + + -- (C) Copyright 2013 King Abdullah University of Science and Technology + Authors: + Ahmad Abdelfattah (ahmad.ahmad@kaust.edu.sa) + David Keyes (david.keyes@kaust.edu.sa) + Hatem Ltaief (hatem.ltaief@kaust.edu.sa) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the King Abdullah University of Science and + Technology nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE + + 11. Some of the cuSPARSE library routines were written by or + derived from code written by Li-Wen Chang and are subject + to the NCSA Open Source License as follows: + + Copyright (c) 2012, University of Illinois. + + All rights reserved. + + Developed by: IMPACT Group, University of Illinois, http://impact.crhc.illinois.edu + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal with the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimers in the documentation and/or other materials provided + with the distribution. + * Neither the names of IMPACT Group, University of Illinois, nor + the names of its contributors may be used to endorse or promote + products derived from this Software without specific prior + written permission. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE + SOFTWARE. + + 12. Some of the cuRAND library routines were written by or + derived from code written by Mutsuo Saito and Makoto + Matsumoto and are subject to the following license: + + Copyright (c) 2009, 2010 Mutsuo Saito, Makoto Matsumoto and Hiroshima + University. All rights reserved. + + Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima + University and University of Tokyo. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the Hiroshima University nor the names of + its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 13. Some of the cuRAND library routines were derived from + code developed by D. E. Shaw Research and are subject to + the following license: + + Copyright 2010-2011, D. E. Shaw Research. + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions, and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of D. E. Shaw Research nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 14. Some of the Math library routines were written by or + derived from code developed by Norbert Juffa and are + subject to the following license: + + Copyright (c) 2015-2017, Norbert Juffa + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 15. Licensee's use of the lz4 third party component is + subject to the following terms and conditions: + + Copyright (C) 2011-2013, Yann Collet. + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 16. The NPP library uses code from the Boost Math Toolkit, + and is subject to the following license: + + Boost Software License - Version 1.0 - August 17th, 2003 + . . . . + + Permission is hereby granted, free of charge, to any person or + organization obtaining a copy of the software and accompanying + documentation covered by this license (the "Software") to use, + reproduce, display, distribute, execute, and transmit the Software, + and to prepare derivative works of the Software, and to permit + third-parties to whom the Software is furnished to do so, all + subject to the following: + + The copyright notices in the Software and this entire statement, + including the above license grant, this restriction and the following + disclaimer, must be included in all copies of the Software, in whole + or in part, and all derivative works of the Software, unless such + copies or derivative works are solely in the form of machine-executable + object code generated by a source language processor. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND + NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR + OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + 17. Portions of the Nsight Eclipse Edition is subject to the + following license: + + The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content is provided + to you under the terms and conditions of the Eclipse Public License + Version 1.0 ("EPL"). A copy of the EPL is available at http:// + www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" + will mean the Content. + + If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may apply to your + use of any object code in the Content. Check the Redistributor's + license that was provided with the Content. If no such license exists, + contact the Redistributor. Unless otherwise indicated below, the terms + and conditions of the EPL still apply to any source code in the + Content and such source code may be obtained at http://www.eclipse.org. + + 18. Some of the cuBLAS library routines uses code from + OpenAI, which is subject to the following license: + + License URL + https://github.com/openai/openai-gemm/blob/master/LICENSE + + License Text + The MIT License + + Copyright (c) 2016 OpenAI (http://openai.com), 2016 Google Inc. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + 19. Licensee's use of the Visual Studio Setup Configuration + Samples is subject to the following license: + + The MIT License (MIT) + Copyright (C) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + 20. Licensee's use of linmath.h header for CPU functions for + GL vector/matrix operations from lunarG is subject to the + Apache License Version 2.0. + + 21. The DX12-CUDA sample uses the d3dx12.h header, which is + subject to the MIT license . + +----------------- diff --git a/voicevox_nemo_engine/docs/licenses/cudnn/LICENSE b/voicevox_nemo_engine/docs/licenses/cudnn/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..1aafb2b5ec281d18a1c3a2b04e77e2ad53eaf30d --- /dev/null +++ b/voicevox_nemo_engine/docs/licenses/cudnn/LICENSE @@ -0,0 +1,305 @@ +LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS + +This license agreement, including exhibits attached ("Agreement”) is a legal agreement between you and NVIDIA Corporation ("NVIDIA") and governs your use of a NVIDIA software development kit (“SDK”). + +Each SDK has its own set of software and materials, but here is a description of the types of items that may be included in a SDK: source code, header files, APIs, data sets and assets (examples include images, textures, models, scenes, videos, native API input/output files), binary software, sample code, libraries, utility programs, programming code and documentation. + +This Agreement can be accepted only by an adult of legal age of majority in the country in which the SDK is used. + +If you are entering into this Agreement on behalf of a company or other legal entity, you represent that you have the legal authority to bind the entity to this Agreement, in which case “you” will mean the entity you represent. + +If you don’t have the required age or authority to accept this Agreement, or if you don’t accept all the terms and conditions of this Agreement, do not download, install or use the SDK. + +You agree to use the SDK only for purposes that are permitted by (a) this Agreement, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions. + +Chapter 1. License. + +1.1. Grant + +Subject to the terms of this Agreement, NVIDIA hereby grants you a non-exclusive, non-transferable license, without the right to sublicense (except as expressly provided in this Agreement) to: + +(i) Install and use the SDK, + +(ii) Modify and create derivative works of sample source code delivered in the SDK, and + +(iii) Distribute those portions of the SDK that are identified in this Agreement as distributable, as incorporated in object code format into a software application that meets the distribution requirements indicated in this Agreement. + +1.2. Distribution Requirements + +These are the distribution requirements for you to exercise the distribution grant: + +(i) Your application must have material additional functionality, beyond the included portions of the SDK. + +(ii) The distributable portions of the SDK shall only be accessed by your application. + +(iii) The following notice shall be included in modifications and derivative works of sample source code distributed: “This software contains source code provided by NVIDIA Corporation.” + +(iv) Unless a developer tool is identified in this Agreement as distributable, it is delivered for your internal use only. + +(v) The terms under which you distribute your application must be consistent with the terms of this Agreement, including (without limitation) terms relating to the license grant and license restrictions and protection of NVIDIA’s intellectual property rights. Additionally, you agree that you will protect the privacy, security and legal rights of your application users. + +(vi) You agree to notify NVIDIA in writing of any known or suspected distribution or use of the SDK not in compliance with the requirements of this Agreement, and to enforce the terms of your agreements with respect to distributed SDK. + +1.3 Authorized Users + +You may allow employees and contractors of your entity or of your subsidiary(ies) to access and use the SDK from your secure network to perform work on your behalf. + +If you are an academic institution you may allow users enrolled or employed by the academic institution to access and use the SDK from your secure network. + +You are responsible for the compliance with the terms of this Agreement by your authorized users. If you become aware that your authorized users didn’t follow the terms of this Agreement, you agree to take reasonable steps to resolve the non-compliance and prevent new occurrences. + +1.4 Pre-Release SDK + +The SDK versions identified as alpha, beta, preview or otherwise as pre-release, may not be fully functional, may contain errors or design flaws, and may have reduced or different security, privacy, accessibility, availability, and reliability standards relative to commercial versions of NVIDIA software and materials. Use of a pre-release SDK may result in unexpected results, loss of data, project delays or other unpredictable damage or loss. + +You may use a pre-release SDK at your own risk, understanding that pre-release SDKs are not intended for use in production or business-critical systems. + +NVIDIA may choose not to make available a commercial version of any pre-release SDK. NVIDIA may also choose to abandon development and terminate the availability of a pre-release SDK at any time without liability. + +1.5 Updates + +NVIDIA may, at its option, make available patches, workarounds or other updates to this SDK. Unless the updates are provided with their separate governing terms, they are deemed part of the SDK licensed to you as provided in this Agreement. + +You agree that the form and content of the SDK that NVIDIA provides may change without prior notice to you. While NVIDIA generally maintains compatibility between versions, NVIDIA may in some cases make changes that introduce incompatibilities in future versions of the SDK. + +1.6 Components Under Other Licenses + +The SDK may come bundled with, or otherwise include or be distributed with, NVIDIA or third party software licensed with separate legal notices or terms as may be described in proprietary notices accompanying the SDK. If and to the extent there is a conflict between the terms in this Agreement and the license terms associated with the component, the license terms associated with the components control only to the extent necessary to resolve the conflict. + +1.7 Reservation of Rights + +NVIDIA reserves all rights, title and interest in and to the SDK not expressly granted to you under this Agreement. + +Chapter 2. Limitations. + +The following license limitations apply to your use of the SDK: + +2.1 You may not reverse engineer, decompile or disassemble, or remove copyright or other proprietary notices from any portion of the SDK or copies of the SDK. + +2.2 Except as expressly provided in this Agreement, you may not copy, sell, rent, sublicense, transfer, distribute, modify, or create derivative works of any portion of the SDK. + +2.3 Unless you have an agreement with NVIDIA for this purpose, you may not indicate that an application created with the SDK is sponsored or endorsed by NVIDIA. + +2.4 You may not bypass, disable, or circumvent any encryption, security, digital rights management or authentication mechanism in the SDK. + +2.5 You may not use the SDK in any manner that would cause it to become subject to an open source software license. As examples, licenses that require as a condition of use, modification, and/or distribution that the SDK be (i) disclosed or distributed in source code form; (ii) licensed for the purpose of making derivative works; or (iii) redistributable at no charge. + +2.6 You acknowledge that the SDK as delivered is not tested or certified by NVIDIA for use in connection with the design, construction, maintenance, and/or operation of any system where the use or failure of such system could result in a situation that threatens the safety of human life or results in catastrophic damages (each, a “Critical Application”). Examples of Critical Applications include use in avionics, navigation, autonomous vehicle applications, ai solutions for automotive products, military, medical, life support or other life critical applications. NVIDIA shall not be liable to you or any third party, in whole or in part, for any claims or damages arising from such uses. You are solely responsible for ensuring that any product or service developed with the SDK as a whole includes sufficient features to comply with all applicable legal and regulatory standards and requirements. + +2.7 You agree to defend, indemnify and hold harmless NVIDIA and its affiliates, and their respective employees, contractors, agents, officers and directors, from and against any and all claims, damages, obligations, losses, liabilities, costs or debt, fines, restitutions and expenses (including but not limited to attorney’s fees and costs incident to establishing the right of indemnification) arising out of or related to products or services that use the SDK in or for Critical Applications, and for use of the SDK, outside of the scope of this Agreement or not in compliance with its terms. + +Chapter 3. Ownership. + +3.1 NVIDIA or its licensors hold all rights, title and interest in and to the SDK and its modifications and derivative works, including their respective intellectual property rights, subject to your rights under Section 3.2. This SDK may include software and materials from NVIDIA’s licensors, and these licensors are intended third party beneficiaries that may enforce this Agreement with respect to their intellectual property rights. + +3.2 You hold all rights, title and interest in and to your applications and your derivative works of the sample source code delivered in the SDK, including their respective intellectual property rights, subject to NVIDIA’s rights under section 3.1. + +3.3 You may, but don’t have to, provide to NVIDIA suggestions, feature requests or other feedback regarding the SDK, including possible enhancements or modifications to the SDK. For any feedback that you voluntarily provide, you hereby grant NVIDIA and its affiliates a perpetual, non-exclusive, worldwide, irrevocable license to use, reproduce, modify, license, sublicense (through multiple tiers of sublicensees), and distribute (through multiple tiers of distributors) it without the payment of any royalties or fees to you. NVIDIA will use feedback at its choice. NVIDIA is constantly looking for ways to improve its products, so you may send feedback to NVIDIA through the developer portal at https://developer.nvidia.com. + +Chapter 4. No Warranties. + +THE SDK IS PROVIDED BY NVIDIA “AS IS” AND “WITH ALL FAULTS.” TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, OR THE ABSENCE OF ANY DEFECTS THEREIN, WHETHER LATENT OR PATENT. NO WARRANTY IS MADE ON THE BASIS OF TRADE USAGE, COURSE OF DEALING OR COURSE OF TRADE. + +Chapter 5. Limitations of Liability. + +TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT OR THE USE OR PERFORMANCE OF THE SDK, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY. IN NO EVENT WILL NVIDIA’S AND ITS AFFILIATES TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS AGREEMENT EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS LIMIT. + +These exclusions and limitations of liability shall apply regardless if NVIDIA or its affiliates have been advised of the possibility of such damages, and regardless of whether a remedy fails its essential purpose. These exclusions and limitations of liability form an essential basis of the bargain between the parties, and, absent any of these exclusions or limitations of liability, the provisions of this Agreement, including, without limitation, the economic terms, would be substantially different. + +Chapter 6. Termination. + +6.1 This Agreement will continue to apply until terminated by either you or NVIDIA as described below. + +6.2 If you want to terminate this Agreement, you may do so by stopping to use the SDK. + +6.3 NVIDIA may, at any time, terminate this Agreement if: (i) you fail to comply with any term of this Agreement and the non-compliance is not fixed within thirty (30) days following notice from NVIDIA (or immediately if you violate NVIDIA’s intellectual property rights); (ii) you commence or participate in any legal proceeding against NVIDIA with respect to the SDK; or (iii) NVIDIA decides to no longer provide the SDK in a country or, in NVIDIA’s sole discretion, the continued use of it is no longer commercially viable. + +6.4 Upon any termination of this Agreement, you agree to promptly discontinue use of the SDK and destroy all copies in your possession or control. Your prior distributions in accordance with this Agreement are not affected by the termination of this Agreement. Upon written request, you will certify in writing that you have complied with your commitments under this section. Upon any termination of this Agreement all provisions survive except for the licenses granted to you. + +Chapter 7. General. + +If you wish to assign this Agreement or your rights and obligations, including by merger, consolidation, dissolution or operation of law, contact NVIDIA to ask for permission. Any attempted assignment not approved by NVIDIA in writing shall be void and of no effect. NVIDIA may assign, delegate or transfer this Agreement and its rights and obligations, and if to a non-affiliate you will be notified. + +You agree to cooperate with NVIDIA and provide reasonably requested information to verify your compliance with this Agreement. + +This Agreement will be governed in all respects by the laws of the United States and of the State of Delaware as those laws are applied to contracts entered into and performed entirely within Delaware by Delaware residents, without regard to the conflicts of laws principles. The United Nations Convention on Contracts for the International Sale of Goods is specifically disclaimed. You agree to all terms of this Agreement in the English language. + +The state or federal courts residing in Santa Clara County, California shall have exclusive jurisdiction over any dispute or claim arising out of this Agreement. Notwithstanding this, you agree that NVIDIA shall still be allowed to apply for injunctive remedies or an equivalent type of urgent legal relief in any jurisdiction. + +If any court of competent jurisdiction determines that any provision of this Agreement is illegal, invalid or unenforceable, such provision will be construed as limited to the extent necessary to be consistent with and fully enforceable under the law and the remaining provisions will remain in full force and effect. Unless otherwise specified, remedies are cumulative. + +Each party acknowledges and agrees that the other is an independent contractor in the performance of this Agreement + +The SDK has been developed entirely at private expense and is “commercial items” consisting of “commercial computer software” and “commercial computer software documentation” provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the restrictions in this Agreement pursuant to DFARS 227.7202-3(a) or as set forth in subparagraphs (b)(1) and (2) of the Commercial Computer Software - Restricted Rights clause at FAR 52.227-19, as applicable. Contractor/ manufacturer is NVIDIA, 2788 San Tomas Expressway, Santa Clara, CA 95051 + +The SDK is subject to United States export laws and regulations. You agree that you will not ship, transfer or export the SDK into any country, or use the SDK in any manner, prohibited by the United States Bureau of Industry and Security or economic sanctions regulations administered by the U.S. Department of Treasury’s Office of Foreign Assets Control (OFAC), or any applicable export laws, restrictions or regulations. These laws include restrictions on destinations, end users and end use. By accepting this Agreement, you confirm that you are not a resident or citizen of any country currently embargoed by the U.S. and that you are not otherwise prohibited from receiving the SDK + +Any notice delivered by NVIDIA to you under this Agreement will be delivered via mail, email or fax. You agree that any notices that NVIDIA sends you electronically will satisfy any legal communication requirements. Please direct your legal notices or other correspondence to NVIDIA Corporation, 2788 San Tomas Expressway, Santa Clara, California 95051, United States of America, Attention: Legal Department. + +This Agreement and any exhibits incorporated into this Agreement constitute the entire agreement of the parties with respect to the subject matter of this Agreement and supersede all prior negotiations or documentation exchanged between the parties relating to this SDK license. Any additional and/or conflicting terms on documents issued by you are null, void, and invalid. Any amendment or waiver under this Agreement shall be in writing and signed by representatives of both parties. + +(v. February 22, 2022) + +Chapter 8. cuDNN SUPPLEMENT TO SOFTWARE LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS + +The terms in this supplement govern your use of the NVIDIA cuDNN SDK under the terms of your license agreement (“Agreement”) as modified by this supplement. Capitalized terms used but not defined below have the meaning assigned to them in the Agreement. + +This supplement is an exhibit to the Agreement and is incorporated as an integral part of the Agreement. In the event of conflict between the terms in this supplement and the terms in the Agreement, the terms in this supplement govern. + +4.1 License Scope. The SDK is licensed for you to develop applications only for use in systems with NVIDIA GPUs. + +2. Distribution. The following portions of the SDK are distributable under the Agreement: the runtime files .so and .dll. + +In addition to the rights above, for parties that are developing software intended solely for use on Jetson development kits or Jetson modules and running Linux for Tegra software the following shall apply: the SDK may be distributed in its entirety, as provided by NVIDIA and without separation of its components, for you and/or your licensees to create software development kits for use only on the Jetson platform and running Linux for Tegra software. + +3. Licensing. If the distribution terms in this Agreement are not suitable for your organization, or for any questions regarding this Agreement, please contact NVIDIA at nvidia-compute-license-questions@nvidia.com + +(v. February 22, 2022) + +Notice + +This document is provided for information purposes only and shall not be regarded as a warranty of a certain functionality, condition, or quality of a product. NVIDIA Corporation (“NVIDIA”) makes no representations or warranties, expressed or implied, as to the accuracy or completeness of the information contained in this document and assumes no responsibility for any errors contained herein. NVIDIA shall have no liability for the consequences or use of such information or for any infringement of patents or other rights of third parties that may result from its use. This document is not a commitment to develop, release, or deliver any Material (defined below), code, or functionality. + +NVIDIA reserves the right to make corrections, modifications, enhancements, improvements, and any other changes to this document, at any time without notice. + +Customer should obtain the latest relevant information before placing orders and should verify that such information is current and complete. + +NVIDIA products are sold subject to the NVIDIA standard terms and conditions of sale supplied at the time of order acknowledgement, unless otherwise agreed in an individual sales agreement signed by authorized representatives of NVIDIA and customer (“Terms of Sale”). NVIDIA hereby expressly objects to applying any customer general terms and conditions with regards to the purchase of the NVIDIA product referenced in this document. No contractual obligations are formed either directly or indirectly by this document. + +NVIDIA products are not designed, authorized, or warranted to be suitable for use in medical, military, aircraft, space, or life support equipment, nor in applications where failure or malfunction of the NVIDIA product can reasonably be expected to result in personal injury, death, or property or environmental damage. NVIDIA accepts no liability for inclusion and/or use of NVIDIA products in such equipment or applications and therefore such inclusion and/or use is at customer’s own risk. + +NVIDIA makes no representation or warranty that products based on this document will be suitable for any specified use. Testing of all parameters of each product is not necessarily performed by NVIDIA. It is customer’s sole responsibility to evaluate and determine the applicability of any information contained in this document, ensure the product is suitable and fit for the application planned by customer, and perform the necessary testing for the application in order to avoid a default of the application or the product. Weaknesses in customer’s product designs may affect the quality and reliability of the NVIDIA product and may result in additional or different conditions and/or requirements beyond those contained in this document. NVIDIA accepts no liability related to any default, damage, costs, or problem which may be based on or attributable to: (i) the use of the NVIDIA product in any manner that is contrary to this document or (ii) customer product designs. + +No license, either expressed or implied, is granted under any NVIDIA patent right, copyright, or other NVIDIA intellectual property right under this document. Information published by NVIDIA regarding third-party products or services does not constitute a license from NVIDIA to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property rights of the third party, or a license from NVIDIA under the patents or other intellectual property rights of NVIDIA. + +Reproduction of information in this document is permissible only if approved in advance by NVIDIA in writing, reproduced without alteration and in full compliance with all applicable export laws and regulations, and accompanied by all associated conditions, limitations, and notices. + +THIS DOCUMENT AND ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL NVIDIA BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF ANY USE OF THIS DOCUMENT, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Notwithstanding any damages that customer might incur for any reason whatsoever, NVIDIA’s aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the Terms of Sale for the product. + +Arm + +Arm, AMBA and Arm Powered are registered trademarks of Arm Limited. Cortex, MPCore and Mali are trademarks of Arm Limited. "Arm" is used to represent Arm Holdings plc; its operating company Arm Limited; and the regional subsidiaries Arm Inc.; Arm KK; Arm Korea Limited.; Arm Taiwan Limited; Arm France SAS; Arm Consulting (Shanghai) Co. Ltd.; Arm Germany GmbH; Arm Embedded Technologies Pvt. Ltd.; Arm Norway, AS and Arm Sweden AB. + +HDMI + +HDMI, the HDMI logo, and High-Definition Multimedia Interface are trademarks or registered trademarks of HDMI Licensing LLC. + +Blackberry/QNX + +Copyright © 2020 BlackBerry Limited. All rights reserved. + +Trademarks, including but not limited to BLACKBERRY, EMBLEM Design, QNX, AVIAGE, MOMENTICS, NEUTRINO and QNX CAR are the trademarks or registered trademarks of BlackBerry Limited, used under license, and the exclusive rights to such trademarks are expressly reserved. + +Google + +Android, Android TV, Google Play and the Google Play logo are trademarks of Google, Inc. + +Trademarks + +NVIDIA, the NVIDIA logo, and BlueField, CUDA, DALI, DRIVE, Hopper, JetPack, Jetson AGX Xavier, Jetson Nano, Maxwell, NGC, Nsight, Orin, Pascal, Quadro, Tegra, TensorRT, Triton, Turing and Volta are trademarks and/or registered trademarks of NVIDIA Corporation in the United States and other countries. Other company and product names may be trademarks of the respective companies with which they are associated. + +Copyright + +© 2014-2023 NVIDIA Corporation & affiliates. All rights reserved. + +NVIDIA Corporation | 2788 San Tomas Expressway, Santa Clara, CA 95051 + +www.nvidia.com + +THIRD PARTY LICENSES + +zlib + +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.11, January 15th, 2017 + + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +*/ + + + +mateidavid/zstr + +The MIT License (MIT) + +Copyright (c) 2015 Matei David, Ontario Institute for Cancer Research + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + +RapidJSON + +Tencent is pleased to support the open source community by making RapidJSON available. + +Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. + +Licensed under the MIT License (the "License"); you may not use this file except +in compliance with the License. You may obtain a copy of the License at + +http://opensource.org/licenses/MIT + +Unless required by applicable law or agreed to in writing, software distributed +under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. + + + +{fmt} + +Copyright (c) 2012 - present, Victor Zverovich + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- Optional exception to the license --- + +As an exception, if, as a result of your compiling your source code, portions of this Software are embedded into a machine-executable object form of such source code, you may redistribute such embedded portions in such object form without including the above copyright and permission notices. + + + +Sleef + +Copyright Naoki Shibata and contributors 2010 - 2021. +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/voicevox_nemo_engine/docs/licenses/mpg123/COPYING b/voicevox_nemo_engine/docs/licenses/mpg123/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..14e14f01cfc70ab24e95ad6be4fd7d6bbc1126de --- /dev/null +++ b/voicevox_nemo_engine/docs/licenses/mpg123/COPYING @@ -0,0 +1,772 @@ +This is the file that contains the terms of use, copying, etc. for the mpg123 distribution package. + +Main message, to include in "About ..." boxes, etc: + + Copyright (c) 1995-2020 by Michael Hipp and others, + free software under the terms of the LGPL v2.1 + +There is an attempt to cover the actual list of authors in the AUTHORS file. +Project maintainer since 2006 is Thomas Orgis and many people have contributed +since the Michael Hipp era, but he stays the initial source and it would +be impractical to count them all individually, so it's "and others". +Source files contain the phrase "the mpg123 project" to the same effect +in their license boilerplate; especially those that were added after +maintainership changed. The person mainly responsible for the first version +is usually named in the phrase "initially written by ...". + +All files in the distribution that don't carry a license note on their own are +licensed under the terms of the LGPL 2.1; exceptions may apply, especially to +files not in the official distribution but in the revision control repository. + +The formal license text follows. + +======================= +1. The LGPL version 2.1 +======================= + + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + +==================== +2. The GPL version 2 +==================== + + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/voicevox_nemo_engine/docs/licenses/open_jtalk/COPYING b/voicevox_nemo_engine/docs/licenses/open_jtalk/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..495268369d51f7794083769e3305ef108593ab94 --- /dev/null +++ b/voicevox_nemo_engine/docs/licenses/open_jtalk/COPYING @@ -0,0 +1,39 @@ +/* ----------------------------------------------------------------- */ +/* The Japanese TTS System "Open JTalk" */ +/* developed by HTS Working Group */ +/* http://open-jtalk.sourceforge.net/ */ +/* ----------------------------------------------------------------- */ +/* */ +/* Copyright (c) 2008-2016 Nagoya Institute of Technology */ +/* Department of Computer Science */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* - Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* - Redistributions in binary form must reproduce the above */ +/* copyright notice, this list of conditions and the following */ +/* disclaimer in the documentation and/or other materials provided */ +/* with the distribution. */ +/* - Neither the name of the HTS working group nor the names of its */ +/* contributors may be used to endorse or promote products derived */ +/* from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */ +/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */ +/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ +/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */ +/* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ +/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ +/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ +/* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */ +/* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */ +/* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ +/* POSSIBILITY OF SUCH DAMAGE. */ +/* ----------------------------------------------------------------- */ diff --git a/voicevox_nemo_engine/docs/licenses/open_jtalk/mecab-naist-jdic/COPYING b/voicevox_nemo_engine/docs/licenses/open_jtalk/mecab-naist-jdic/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..40bdeecb430c04ac9b463c27e7fda85699206e6c --- /dev/null +++ b/voicevox_nemo_engine/docs/licenses/open_jtalk/mecab-naist-jdic/COPYING @@ -0,0 +1,69 @@ +Copyright (c) 2009, Nara Institute of Science and Technology, Japan. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +Neither the name of the Nara Institute of Science and Technology +(NAIST) nor the names of its contributors may be used to endorse or +promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* ----------------------------------------------------------------- */ +/* The Japanese TTS System "Open JTalk" */ +/* developed by HTS Working Group */ +/* http://open-jtalk.sourceforge.net/ */ +/* ----------------------------------------------------------------- */ +/* */ +/* Copyright (c) 2008-2016 Nagoya Institute of Technology */ +/* Department of Computer Science */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* - Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* - Redistributions in binary form must reproduce the above */ +/* copyright notice, this list of conditions and the following */ +/* disclaimer in the documentation and/or other materials provided */ +/* with the distribution. */ +/* - Neither the name of the HTS working group nor the names of its */ +/* contributors may be used to endorse or promote products derived */ +/* from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */ +/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */ +/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ +/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */ +/* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ +/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ +/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ +/* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */ +/* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */ +/* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ +/* POSSIBILITY OF SUCH DAMAGE. */ +/* ----------------------------------------------------------------- */ diff --git a/voicevox_nemo_engine/docs/licenses/open_jtalk/mecab/COPYING b/voicevox_nemo_engine/docs/licenses/open_jtalk/mecab/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..8c50c6c47472d3b190177ce754c5227091040856 --- /dev/null +++ b/voicevox_nemo_engine/docs/licenses/open_jtalk/mecab/COPYING @@ -0,0 +1,69 @@ +Copyright (c) 2001-2008, Taku Kudo +Copyright (c) 2004-2008, Nippon Telegraph and Telephone Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are +permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + + * Neither the name of the Nippon Telegraph and Telegraph Corporation + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* ----------------------------------------------------------------- */ +/* The Japanese TTS System "Open JTalk" */ +/* developed by HTS Working Group */ +/* http://open-jtalk.sourceforge.net/ */ +/* ----------------------------------------------------------------- */ +/* */ +/* Copyright (c) 2008-2016 Nagoya Institute of Technology */ +/* Department of Computer Science */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* - Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* - Redistributions in binary form must reproduce the above */ +/* copyright notice, this list of conditions and the following */ +/* disclaimer in the documentation and/or other materials provided */ +/* with the distribution. */ +/* - Neither the name of the HTS working group nor the names of its */ +/* contributors may be used to endorse or promote products derived */ +/* from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */ +/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */ +/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ +/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */ +/* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ +/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ +/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ +/* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */ +/* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */ +/* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ +/* POSSIBILITY OF SUCH DAMAGE. */ +/* ----------------------------------------------------------------- */ diff --git a/voicevox_nemo_engine/docs/licenses/world/LICENSE.txt b/voicevox_nemo_engine/docs/licenses/world/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..1c12e7699545c3f2a4340f339664c6925de4d634 --- /dev/null +++ b/voicevox_nemo_engine/docs/licenses/world/LICENSE.txt @@ -0,0 +1,39 @@ +/* ----------------------------------------------------------------- */ +/* WORLD: High-quality speech analysis, */ +/* manipulation and synthesis system */ +/* developed by M. Morise */ +/* http://www.kisc.meiji.ac.jp/~mmorise/world/english/ */ +/* ----------------------------------------------------------------- */ +/* */ +/* Copyright (c) 2010 M. Morise */ +/* */ +/* All rights reserved. */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* - Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* - Redistributions in binary form must reproduce the above */ +/* copyright notice, this list of conditions and the following */ +/* disclaimer in the documentation and/or other materials provided */ +/* with the distribution. */ +/* - Neither the name of the M. Morise nor the names of its */ +/* contributors may be used to endorse or promote products derived */ +/* from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */ +/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */ +/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ +/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */ +/* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ +/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ +/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ +/* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */ +/* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */ +/* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ +/* POSSIBILITY OF SUCH DAMAGE. */ +/* ----------------------------------------------------------------- */ diff --git "a/voicevox_nemo_engine/docs/res/\343\203\236\343\203\253\343\203\201\343\202\250\343\203\263\343\202\270\343\203\263\346\246\202\345\277\265\345\233\263.svg" "b/voicevox_nemo_engine/docs/res/\343\203\236\343\203\253\343\203\201\343\202\250\343\203\263\343\202\270\343\203\263\346\246\202\345\277\265\345\233\263.svg" new file mode 100644 index 0000000000000000000000000000000000000000..479b701f0653439dbd334f252e027b18e9e4cc11 --- /dev/null +++ "b/voicevox_nemo_engine/docs/res/\343\203\236\343\203\253\343\203\201\343\202\250\343\203\263\343\202\270\343\203\263\346\246\202\345\277\265\345\233\263.svg" @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/voicevox_nemo_engine/engine_manifest.json b/voicevox_nemo_engine/engine_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..2ceaaabea513eefd51bea707c25054b371a537a5 --- /dev/null +++ b/voicevox_nemo_engine/engine_manifest.json @@ -0,0 +1,63 @@ +{ + "manifest_version": "0.13.1", + "name": "DUMMY Engine", + "brand_name": "DUMMY", + "uuid": "c7b58856-bd56-4aa1-afb7-b8415f824b06", + "version": "999.999.999", + "url": "https://github.com/VOICEVOX/voicevox_engine", + "command": "run", + "port": 50021, + "icon": "engine_manifest_assets/icon.png", + "default_sampling_rate": 24000, + "terms_of_service": "engine_manifest_assets/terms_of_service.md", + "update_infos": "engine_manifest_assets/update_infos.json", + "dependency_licenses": "engine_manifest_assets/dependency_licenses.json", + "supported_vvlib_manifest_version": "0.15.0", + "supported_features": { + "adjust_mora_pitch": { + "type": "bool", + "value": true, + "name": "モーラごとの音高の調整" + }, + "adjust_phoneme_length": { + "type": "bool", + "value": true, + "name": "音素ごとの長さの調整" + }, + "adjust_speed_scale": { + "type": "bool", + "value": true, + "name": "全体の話速の調整" + }, + "adjust_pitch_scale": { + "type": "bool", + "value": true, + "name": "全体の音高の調整" + }, + "adjust_intonation_scale": { + "type": "bool", + "value": true, + "name": "全体の抑揚の調整" + }, + "adjust_volume_scale": { + "type": "bool", + "value": true, + "name": "全体の音量の調整" + }, + "interrogative_upspeak": { + "type": "bool", + "value": true, + "name": "疑問文の自動調整" + }, + "synthesis_morphing" : { + "type": "bool", + "value": true, + "name": "2人の話者でモーフィングした音声を合成" + }, + "manage_library": { + "type": "bool", + "value": true, + "name": "音声ライブラリのインストール・アンインストール" + } + } +} diff --git a/voicevox_nemo_engine/engine_manifest_assets/dependency_licenses.json b/voicevox_nemo_engine/engine_manifest_assets/dependency_licenses.json new file mode 100644 index 0000000000000000000000000000000000000000..875de0f80d5cd0986e56248dba2a011702628c14 --- /dev/null +++ b/voicevox_nemo_engine/engine_manifest_assets/dependency_licenses.json @@ -0,0 +1,8 @@ +[ + { + "name": "dummy library", + "version": "0.0.1", + "license": "dummy license", + "text": "dummy license text" + } +] \ No newline at end of file diff --git a/voicevox_nemo_engine/engine_manifest_assets/downloadable_libraries.json b/voicevox_nemo_engine/engine_manifest_assets/downloadable_libraries.json new file mode 100644 index 0000000000000000000000000000000000000000..954786200326db91b9bbcebc794b66d993a5b2e9 --- /dev/null +++ b/voicevox_nemo_engine/engine_manifest_assets/downloadable_libraries.json @@ -0,0 +1,44 @@ +[ + { + "name": "Dummy Library", + "uuid": "2bb8bccf-1c3f-4bc9-959a-f388e37af3ad", + "version": "0.0.1", + "download_url": "https://github.com/VOICEVOX/voicevox_engine/archive/d7cf31c058bc83e1abf8e14d4231a06409c4cc2d.zip", + "bytes": 1000, + "speakers": [ + { + "speaker": { + "name": "dummy1", + "speaker_uuid": "7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff", + "styles": [ + { + "name": "style1", + "id": 0 + }, + { + "name": "style2", + "id": 2 + } + ], + "version": "0.0.1" + }, + "speaker_info": { + "policy": "", + "portrait": "", + "style_infos": [ + { + "id": 0, + "icon": "", + "voice_samples": ["", "", ""] + }, + { + "id": 2, + "icon": "", + "voice_samples": ["", "", ""] + } + ] + } + } + ] + } +] diff --git a/voicevox_nemo_engine/engine_manifest_assets/icon.png b/voicevox_nemo_engine/engine_manifest_assets/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..98064f347fdf8bd4fe42098c79ad293f291d40c8 Binary files /dev/null and b/voicevox_nemo_engine/engine_manifest_assets/icon.png differ diff --git a/voicevox_nemo_engine/engine_manifest_assets/terms_of_service.md b/voicevox_nemo_engine/engine_manifest_assets/terms_of_service.md new file mode 100644 index 0000000000000000000000000000000000000000..c97bb512c679e98b7685a3b3d7013497ca280954 --- /dev/null +++ b/voicevox_nemo_engine/engine_manifest_assets/terms_of_service.md @@ -0,0 +1 @@ +dummy teams of service \ No newline at end of file diff --git a/voicevox_nemo_engine/engine_manifest_assets/update_infos.json b/voicevox_nemo_engine/engine_manifest_assets/update_infos.json new file mode 100644 index 0000000000000000000000000000000000000000..84a1e2d284582bd9daad6fb4da280150372436a8 --- /dev/null +++ b/voicevox_nemo_engine/engine_manifest_assets/update_infos.json @@ -0,0 +1,7 @@ +[ + { + "version": "0.14.0", + "descriptions": ["VOICEVOX Nemoを追加"], + "contributors": [] + } +] diff --git a/voicevox_nemo_engine/generate_licenses.py b/voicevox_nemo_engine/generate_licenses.py new file mode 100644 index 0000000000000000000000000000000000000000..774b0193db9ccc767a526bb974310045ae99483b --- /dev/null +++ b/voicevox_nemo_engine/generate_licenses.py @@ -0,0 +1,383 @@ +import json +import os +import subprocess +import urllib.request +from dataclasses import asdict, dataclass +from pathlib import Path +from typing import List, Optional + + +@dataclass +class License: + name: str + version: Optional[str] + license: Optional[str] + text: str + + +def generate_licenses() -> List[License]: + licenses: List[License] = [] + + # openjtalk + # https://sourceforge.net/projects/open-jtalk/files/Open%20JTalk/open_jtalk-1.11/ + licenses.append( + License( + name="Open JTalk", + version="1.11", + license="Modified BSD license", + text=Path("docs/licenses/open_jtalk/COPYING").read_text(), + ) + ) + licenses.append( + License( + name="MeCab", + version=None, + license="Modified BSD license", + text=Path("docs/licenses/open_jtalk/mecab/COPYING").read_text(), + ) + ) + licenses.append( + License( + name="NAIST Japanese Dictionary", + version=None, + license="Modified BSD license", + text=Path("docs/licenses//open_jtalk/mecab-naist-jdic/COPYING").read_text(), + ) + ) + with urllib.request.urlopen( + "https://raw.githubusercontent.com/r9y9/pyopenjtalk/master/pyopenjtalk/htsvoice/LICENSE_mei_normal.htsvoice" # noqa: B950 + ) as res: + licenses.append( + License( + name='HTS Voice "Mei"', + version=None, + license="Creative Commons Attribution 3.0 license", + text=res.read().decode(), + ) + ) + + # VOICEVOX CORE + with urllib.request.urlopen( + "https://raw.githubusercontent.com/VOICEVOX/voicevox_core/main/LICENSE" + ) as res: + licenses.append( + License( + name="VOICEVOX CORE", + version=None, + license="MIT license", + text=res.read().decode(), + ) + ) + + # VOICEVOX ENGINE + with urllib.request.urlopen( + "https://raw.githubusercontent.com/VOICEVOX/voicevox_engine/master/LGPL_LICENSE" + ) as res: + licenses.append( + License( + name="VOICEVOX ENGINE", + version=None, + license="LGPL license", + text=res.read().decode(), + ) + ) + + # world + with urllib.request.urlopen( + "https://raw.githubusercontent.com/mmorise/World/master/LICENSE.txt" + ) as res: + licenses.append( + License( + name="world", + version=None, + license="Modified BSD license", + text=res.read().decode(), + ) + ) + + # pytorch + with urllib.request.urlopen( + "https://raw.githubusercontent.com/pytorch/pytorch/master/LICENSE" + ) as res: + licenses.append( + License( + name="PyTorch", + version="1.9.0", + license="BSD-style license", + text=res.read().decode(), + ) + ) + + # onnxruntime + with urllib.request.urlopen( + "https://raw.githubusercontent.com/microsoft/onnxruntime/master/LICENSE" + ) as res: + licenses.append( + License( + name="ONNX Runtime", + version="1.13.1", + license="MIT license", + text=res.read().decode(), + ) + ) + + # Python + python_version = "3.11.3" + with urllib.request.urlopen( + f"https://raw.githubusercontent.com/python/cpython/v{python_version}/LICENSE" + ) as res: + licenses.append( + License( + name="Python", + version=python_version, + license="Python Software Foundation License", + text=res.read().decode(), + ) + ) + + # pip + try: + pip_licenses_output = subprocess.run( + "pip-licenses " + "--from=mixed " + "--format=json " + "--with-urls " + "--with-license-file " + "--no-license-path ", + shell=True, + capture_output=True, + check=True, + env=os.environ, + ).stdout.decode() + except subprocess.CalledProcessError as err: + raise Exception( + f"command output:\n{err.stderr and err.stderr.decode()}" + ) from err + + licenses_json = json.loads(pip_licenses_output) + for license_json in licenses_json: + license = License( + name=license_json["Name"], + version=license_json["Version"], + license=license_json["License"], + text=license_json["LicenseText"], + ) + # FIXME: assert license type + if license.text == "UNKNOWN": + if license.name.lower() == "core" and license.version == "0.0.0": + continue + elif license.name.lower() == "future": + with urllib.request.urlopen( + "https://raw.githubusercontent.com/PythonCharmers/python-future/master/LICENSE.txt" # noqa: B950 + ) as res: + license.text = res.read().decode() + elif license.name.lower() == "pefile": + with urllib.request.urlopen( + "https://raw.githubusercontent.com/erocarrera/pefile/master/LICENSE" # noqa: B950 + ) as res: + license.text = res.read().decode() + elif license.name.lower() == "pyopenjtalk": + with urllib.request.urlopen( + "https://raw.githubusercontent.com/r9y9/pyopenjtalk/master/LICENSE.md" + ) as res: + license.text = res.read().decode() + elif license.name.lower() == "python-multipart": + with urllib.request.urlopen( + "https://raw.githubusercontent.com/andrew-d/python-multipart/master/LICENSE.txt" # noqa: B950 + ) as res: + license.text = res.read().decode() + elif license.name.lower() == "romkan": + with urllib.request.urlopen( + "https://raw.githubusercontent.com/soimort/python-romkan/master/LICENSE" + ) as res: + license.text = res.read().decode() + elif license.name.lower() == "distlib": + with urllib.request.urlopen( + "https://bitbucket.org/pypa/distlib/raw/7d93712134b28401407da27382f2b6236c87623a/LICENSE.txt" # noqa: B950 + ) as res: + license.text = res.read().decode() + elif license.name.lower() == "jsonschema": + with urllib.request.urlopen( + "https://raw.githubusercontent.com/python-jsonschema/jsonschema/dbc398245a583cb2366795dc529ae042d10c1577/COPYING" + ) as res: + license.text = res.read().decode() + elif license.name.lower() == "lockfile": + with urllib.request.urlopen( + "https://opendev.org/openstack/pylockfile/raw/tag/0.12.2/LICENSE" + ) as res: + license.text = res.read().decode() + elif license.name.lower() == "platformdirs": + with urllib.request.urlopen( + "https://raw.githubusercontent.com/platformdirs/platformdirs/aa671aaa97913c7b948567f4d9c77d4f98bfa134/LICENSE" + ) as res: + license.text = res.read().decode() + elif license.name.lower() == "webencodings": + with urllib.request.urlopen( + "https://raw.githubusercontent.com/gsnedders/python-webencodings/fa2cb5d75ab41e63ace691bc0825d3432ba7d694/LICENSE" + ) as res: + license.text = res.read().decode() + else: + # ライセンスがpypiに無い + raise Exception(f"No License info provided for {license.name}") + + # soxr + if license.name.lower() == "soxr": + with urllib.request.urlopen( + "https://raw.githubusercontent.com/dofuuz/python-soxr/v0.3.6/LICENSE.txt" + ) as res: + license.text = res.read().decode() + + licenses.append(license) + + # OpenBLAS + with urllib.request.urlopen( + "https://raw.githubusercontent.com/xianyi/OpenBLAS/develop/LICENSE" + ) as res: + licenses.append( + License( + name="OpenBLAS", + version=None, + license="BSD 3-clause license", + text=res.read().decode(), + ) + ) + + # libsndfile-binaries + with urllib.request.urlopen( + "https://raw.githubusercontent.com/bastibe/libsndfile-binaries/d9887ef926bb11cf1a2526be4ab6f9dc690234c0/COPYING" # noqa: B950 + ) as res: + licenses.append( + License( + name="libsndfile-binaries", + version="1.2.0", + license="LGPL-2.1 license", + text=res.read().decode(), + ) + ) + + # libogg + with urllib.request.urlopen( + "https://raw.githubusercontent.com/xiph/ogg/v1.3.5/COPYING" + ) as res: + licenses.append( + License( + name="libogg", + version="1.3.5", + license="BSD 3-clause license", + text=res.read().decode(), + ) + ) + + # libvorbis + with urllib.request.urlopen( + "https://raw.githubusercontent.com/xiph/vorbis/v1.3.7/COPYING" + ) as res: + licenses.append( + License( + name="libvorbis", + version="1.3.7", + license="BSD 3-clause license", + text=res.read().decode(), + ) + ) + + # libflac + with urllib.request.urlopen( + "https://raw.githubusercontent.com/xiph/flac/1.4.2/COPYING.Xiph" + ) as res: + licenses.append( + License( + name="FLAC", + version="1.4.2", + license="Xiph.org's BSD-like license", + text=res.read().decode(), + ) + ) + + # libopus + with urllib.request.urlopen( + "https://raw.githubusercontent.com/xiph/opus/v1.3.1/COPYING" + ) as res: + licenses.append( + License( + name="Opus", + version="1.3.1", + license="BSD 3-clause license", + text=res.read().decode(), + ) + ) + + # mpg123 + # https://sourceforge.net/projects/mpg123/files/mpg123/1.30.2/ + licenses.append( + License( + name="mpg123", + version="1.30.2", + license="LGPL-2.1 license", + text=Path("docs/licenses/mpg123/COPYING").read_text(encoding="utf-8"), + ) + ) + + # liblame + # https://sourceforge.net/projects/lame/files/lame/3.100/ + with urllib.request.urlopen( + "https://svn.code.sf.net/p/lame/svn/tags/RELEASE__3_100/lame/COPYING" + ) as res: + licenses.append( + License( + name="lame", + version="3.100", + license="LGPL-2.0 license", + text=res.read().decode(), + ) + ) + + # cuda + # license text from CUDA 11.8.0 + # https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local # noqa: B950 + # https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_522.06_windows.exe # noqa: B950 + # cuda_11.8.0_522.06_windows.exe (cuda_documentation/Doc/EULA.txt) + licenses.append( + License( + name="CUDA Toolkit", + version="11.8.0", + license=None, + text=Path("docs/licenses/cuda/EULA.txt").read_text(encoding="utf8"), + ) + ) + # cudnn + # license text from + # cuDNN v8.9.2 (June 1st, 2023), for CUDA 11.x, cuDNN Library for Windows + # https://developer.nvidia.com/rdp/cudnn-archive # noqa: B950 + # https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.2.26_cuda11-archive.zip # noqa: B950 + # cudnn-windows-x86_64-8.9.2.26_cuda11-archive.zip (cudnn-windows-x86_64-8.9.2.26_cuda11-archive/LICENSE) # noqa: B950 + licenses.append( + License( + name="cuDNN", + version="8.9.2", + license=None, + text=Path("docs/licenses/cudnn/LICENSE").read_text(encoding="utf8"), + ) + ) + + return licenses + + +if __name__ == "__main__": + import argparse + import sys + + parser = argparse.ArgumentParser() + parser.add_argument("-o", "--output_path", type=str) + args = parser.parse_args() + + output_path = args.output_path + + licenses = generate_licenses() + + # dump + out = Path(output_path).open("w") if output_path else sys.stdout + json.dump( + [asdict(license) for license in licenses], + out, + ) diff --git a/voicevox_nemo_engine/get_cost_candidates.py b/voicevox_nemo_engine/get_cost_candidates.py new file mode 100644 index 0000000000000000000000000000000000000000..072c4b4d57a757c957a0a1e9ab0afb0c5c989cb0 --- /dev/null +++ b/voicevox_nemo_engine/get_cost_candidates.py @@ -0,0 +1,91 @@ +""" +voicevox_engine/part_of_speech_data.pyのcost_candidatesを計算するプログラムです。 +引数のnaist_jdic_pathには、open_jtalkのsrc/mecab-naist-jdic/naist-jdic.csvを指定してください。 + +実行例: +python get_cost_candidates.py --naist_jdic_path=/path/to/naist-jdic.csv \ + --pos=名詞 \ + --pos_detail_1=固有名詞 \ + --pos_detail_2=一般 \ + --pos_detail_3=* + +cost_candidatesの値の詳細は以下の通りです。 +- 1番目の値はnaist_jdic内の同一品詞の最小コストから1を引いたもの、11番目の値は最大コストに1を足したものです。 +- 2番目の値はnaist_jdic内の同一品詞のコストの下位1%、10番目の値は99%の値です。 +- 6番目の値はnaist_jdic内の同一品詞のコストの最頻値です。 +- 2番目から6番目、6番目から10番目までの値は一定割合で増加するようになっています。 +""" + +import argparse +import statistics +from pathlib import Path +from typing import List + +import numpy as np + + +def get_candidates( + naist_jdic_path: Path, + pos: str, + pos_detail_1: str, + pos_detail_2: str, + pos_detail_3: str, +) -> List[int]: + costs = [] + with naist_jdic_path.open(encoding="utf-8") as f: + for line in f: + ( + _, + _, + _, + _cost, + _pos, + _pos_detail_1, + _pos_detail_2, + _pos_detail_3, + _, + _, + _, + _, + _, + _, + _, + ) = line.split(",") + if (_pos, _pos_detail_1, _pos_detail_2, _pos_detail_3) == ( + pos, + pos_detail_1, + pos_detail_2, + pos_detail_3, + ): + costs.append(int(_cost)) + assert len(costs) > 0 + cost_min = min(costs) - 1 + cost_1per = np.quantile(costs, 0.01).astype(np.int64) + cost_mode = statistics.mode(costs) + cost_99per = np.quantile(costs, 0.99).astype(np.int64) + cost_max = max(costs) + 1 + return ( + [cost_min] + + [int(cost_1per + (cost_mode - cost_1per) * i / 4) for i in range(5)] + + [int(cost_mode + (cost_99per - cost_mode) * i / 4) for i in range(1, 5)] + + [cost_max] + ) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--naist_jdic_path", type=Path) + parser.add_argument("--pos", type=str) + parser.add_argument("--pos_detail_1", type=str) + parser.add_argument("--pos_detail_2", type=str) + parser.add_argument("--pos_detail_3", type=str) + args = parser.parse_args() + print( + get_candidates( + naist_jdic_path=args.naist_jdic_path, + pos=args.pos, + pos_detail_1=args.pos_detail_1, + pos_detail_2=args.pos_detail_2, + pos_detail_3=args.pos_detail_3, + ) + ) diff --git a/voicevox_nemo_engine/make_docs.py b/voicevox_nemo_engine/make_docs.py new file mode 100644 index 0000000000000000000000000000000000000000..d21ba85b9498998bb121191c3068310fd69a5809 --- /dev/null +++ b/voicevox_nemo_engine/make_docs.py @@ -0,0 +1,38 @@ +import json + +from voicevox_engine.dev.core import mock as core +from voicevox_engine.dev.synthesis_engine.mock import MockSynthesisEngine +from voicevox_engine.preset import PresetManager +from voicevox_engine.setting import USER_SETTING_PATH, SettingLoader +from voicevox_engine.utility import engine_root + +if __name__ == "__main__": + import run + + app = run.generate_app( + synthesis_engines={"mock": MockSynthesisEngine(speakers=core.metas())}, + latest_core_version="mock", + setting_loader=SettingLoader(USER_SETTING_PATH), + preset_manager=PresetManager( # FIXME: impl MockPresetManager + preset_path=engine_root() / "presets.yaml", + ), + ) + with open("docs/api/index.html", "w") as f: + f.write( + """ + + + voicevox_engine API Document + + + + + + + + +""" + % json.dumps(app.openapi()) + ) diff --git a/voicevox_nemo_engine/poetry.lock b/voicevox_nemo_engine/poetry.lock new file mode 100644 index 0000000000000000000000000000000000000000..6e7957c9a4517688ed16c5cbffb9ee15513647e9 --- /dev/null +++ b/voicevox_nemo_engine/poetry.lock @@ -0,0 +1,2434 @@ +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. + +[[package]] +name = "aiofiles" +version = "0.7.0" +description = "File support for asyncio." +optional = false +python-versions = ">=3.6,<4.0" +files = [ + {file = "aiofiles-0.7.0-py3-none-any.whl", hash = "sha256:c67a6823b5f23fcab0a2595a289cec7d8c863ffcb4322fb8cd6b90400aedfdbc"}, + {file = "aiofiles-0.7.0.tar.gz", hash = "sha256:a1c4fc9b2ff81568c83e21392a82f344ea9d23da906e4f6a52662764545e19d4"}, +] + +[[package]] +name = "altgraph" +version = "0.17.3" +description = "Python graph (network) package" +optional = false +python-versions = "*" +files = [ + {file = "altgraph-0.17.3-py2.py3-none-any.whl", hash = "sha256:c8ac1ca6772207179ed8003ce7687757c04b0b71536f81e2ac5755c6226458fe"}, + {file = "altgraph-0.17.3.tar.gz", hash = "sha256:ad33358114df7c9416cdb8fa1eaa5852166c505118717021c6a8c7c7abbd03dd"}, +] + +[[package]] +name = "anyio" +version = "3.7.1" +description = "High level compatibility layer for multiple asynchronous event loop implementations" +optional = false +python-versions = ">=3.7" +files = [ + {file = "anyio-3.7.1-py3-none-any.whl", hash = "sha256:91dee416e570e92c64041bd18b900d1d6fa78dff7048769ce5ac5ddad004fbb5"}, + {file = "anyio-3.7.1.tar.gz", hash = "sha256:44a3c9aba0f5defa43261a8b3efb97891f2bd7d804e0e1f56419befa1adfc780"}, +] + +[package.dependencies] +idna = ">=2.8" +sniffio = ">=1.1" + +[package.extras] +doc = ["Sphinx", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme (>=1.2.2)", "sphinxcontrib-jquery"] +test = ["anyio[trio]", "coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "mock (>=4)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] +trio = ["trio (<0.22)"] + +[[package]] +name = "asgiref" +version = "3.7.2" +description = "ASGI specs, helper code, and adapters" +optional = false +python-versions = ">=3.7" +files = [ + {file = "asgiref-3.7.2-py3-none-any.whl", hash = "sha256:89b2ef2247e3b562a16eef663bc0e2e703ec6468e2fa8a5cd61cd449786d4f6e"}, + {file = "asgiref-3.7.2.tar.gz", hash = "sha256:9e0ce3aa93a819ba5b45120216b23878cf6e8525eb3848653452b4192b92afed"}, +] + +[package.extras] +tests = ["mypy (>=0.800)", "pytest", "pytest-asyncio"] + +[[package]] +name = "atomicwrites" +version = "1.4.1" +description = "Atomic file writes." +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "atomicwrites-1.4.1.tar.gz", hash = "sha256:81b2c9071a49367a7f770170e5eec8cb66567cfbbc8c73d20ce5ca4a8d71cf11"}, +] + +[[package]] +name = "attrs" +version = "23.1.0" +description = "Classes Without Boilerplate" +optional = false +python-versions = ">=3.7" +files = [ + {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, + {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, +] + +[package.extras] +cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] +dev = ["attrs[docs,tests]", "pre-commit"] +docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] +tests = ["attrs[tests-no-zope]", "zope-interface"] +tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] + +[[package]] +name = "black" +version = "22.12.0" +description = "The uncompromising code formatter." +optional = false +python-versions = ">=3.7" +files = [ + {file = "black-22.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9eedd20838bd5d75b80c9f5487dbcb06836a43833a37846cf1d8c1cc01cef59d"}, + {file = "black-22.12.0-cp310-cp310-win_amd64.whl", hash = "sha256:159a46a4947f73387b4d83e87ea006dbb2337eab6c879620a3ba52699b1f4351"}, + {file = "black-22.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d30b212bffeb1e252b31dd269dfae69dd17e06d92b87ad26e23890f3efea366f"}, + {file = "black-22.12.0-cp311-cp311-win_amd64.whl", hash = "sha256:7412e75863aa5c5411886804678b7d083c7c28421210180d67dfd8cf1221e1f4"}, + {file = "black-22.12.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c116eed0efb9ff870ded8b62fe9f28dd61ef6e9ddd28d83d7d264a38417dcee2"}, + {file = "black-22.12.0-cp37-cp37m-win_amd64.whl", hash = "sha256:1f58cbe16dfe8c12b7434e50ff889fa479072096d79f0a7f25e4ab8e94cd8350"}, + {file = "black-22.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:77d86c9f3db9b1bf6761244bc0b3572a546f5fe37917a044e02f3166d5aafa7d"}, + {file = "black-22.12.0-cp38-cp38-win_amd64.whl", hash = "sha256:82d9fe8fee3401e02e79767016b4907820a7dc28d70d137eb397b92ef3cc5bfc"}, + {file = "black-22.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:101c69b23df9b44247bd88e1d7e90154336ac4992502d4197bdac35dd7ee3320"}, + {file = "black-22.12.0-cp39-cp39-win_amd64.whl", hash = "sha256:559c7a1ba9a006226f09e4916060982fd27334ae1998e7a38b3f33a37f7a2148"}, + {file = "black-22.12.0-py3-none-any.whl", hash = "sha256:436cc9167dd28040ad90d3b404aec22cedf24a6e4d7de221bec2730ec0c97bcf"}, + {file = "black-22.12.0.tar.gz", hash = "sha256:229351e5a18ca30f447bf724d007f890f97e13af070bb6ad4c0a441cd7596a2f"}, +] + +[package.dependencies] +click = ">=8.0.0" +mypy-extensions = ">=0.4.3" +pathspec = ">=0.9.0" +platformdirs = ">=2" + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.7.4)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +uvloop = ["uvloop (>=0.15.2)"] + +[[package]] +name = "build" +version = "0.10.0" +description = "A simple, correct Python build frontend" +optional = false +python-versions = ">= 3.7" +files = [ + {file = "build-0.10.0-py3-none-any.whl", hash = "sha256:af266720050a66c893a6096a2f410989eeac74ff9a68ba194b3f6473e8e26171"}, + {file = "build-0.10.0.tar.gz", hash = "sha256:d5b71264afdb5951d6704482aac78de887c80691c52b88a9ad195983ca2c9269"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "os_name == \"nt\""} +packaging = ">=19.0" +pyproject_hooks = "*" + +[package.extras] +docs = ["furo (>=2021.08.31)", "sphinx (>=4.0,<5.0)", "sphinx-argparse-cli (>=1.5)", "sphinx-autodoc-typehints (>=1.10)"] +test = ["filelock (>=3)", "pytest (>=6.2.4)", "pytest-cov (>=2.12)", "pytest-mock (>=2)", "pytest-rerunfailures (>=9.1)", "pytest-xdist (>=1.34)", "setuptools (>=42.0.0)", "setuptools (>=56.0.0)", "toml (>=0.10.0)", "wheel (>=0.36.0)"] +typing = ["importlib-metadata (>=5.1)", "mypy (==0.991)", "tomli", "typing-extensions (>=3.7.4.3)"] +virtualenv = ["virtualenv (>=20.0.35)"] + +[[package]] +name = "cachecontrol" +version = "0.13.1" +description = "httplib2 caching for requests" +optional = false +python-versions = ">=3.7" +files = [ + {file = "cachecontrol-0.13.1-py3-none-any.whl", hash = "sha256:95dedbec849f46dda3137866dc28b9d133fc9af55f5b805ab1291833e4457aa4"}, + {file = "cachecontrol-0.13.1.tar.gz", hash = "sha256:f012366b79d2243a6118309ce73151bf52a38d4a5dac8ea57f09bd29087e506b"}, +] + +[package.dependencies] +filelock = {version = ">=3.8.0", optional = true, markers = "extra == \"filecache\""} +msgpack = ">=0.5.2" +requests = ">=2.16.0" + +[package.extras] +dev = ["CacheControl[filecache,redis]", "black", "build", "cherrypy", "mypy", "pytest", "pytest-cov", "sphinx", "tox", "types-redis", "types-requests"] +filecache = ["filelock (>=3.8.0)"] +redis = ["redis (>=2.10.5)"] + +[[package]] +name = "certifi" +version = "2023.7.22" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, + {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, +] + +[[package]] +name = "cffi" +version = "1.15.1" +description = "Foreign Function Interface for Python calling C code." +optional = false +python-versions = "*" +files = [ + {file = "cffi-1.15.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2"}, + {file = "cffi-1.15.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2"}, + {file = "cffi-1.15.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914"}, + {file = "cffi-1.15.1-cp27-cp27m-win32.whl", hash = "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3"}, + {file = "cffi-1.15.1-cp27-cp27m-win_amd64.whl", hash = "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e"}, + {file = "cffi-1.15.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162"}, + {file = "cffi-1.15.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b"}, + {file = "cffi-1.15.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21"}, + {file = "cffi-1.15.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4"}, + {file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01"}, + {file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e"}, + {file = "cffi-1.15.1-cp310-cp310-win32.whl", hash = "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2"}, + {file = "cffi-1.15.1-cp310-cp310-win_amd64.whl", hash = "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d"}, + {file = "cffi-1.15.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac"}, + {file = "cffi-1.15.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83"}, + {file = "cffi-1.15.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9"}, + {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c"}, + {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325"}, + {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c"}, + {file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef"}, + {file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8"}, + {file = "cffi-1.15.1-cp311-cp311-win32.whl", hash = "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d"}, + {file = "cffi-1.15.1-cp311-cp311-win_amd64.whl", hash = "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104"}, + {file = "cffi-1.15.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e"}, + {file = "cffi-1.15.1-cp36-cp36m-win32.whl", hash = "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf"}, + {file = "cffi-1.15.1-cp36-cp36m-win_amd64.whl", hash = "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497"}, + {file = "cffi-1.15.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426"}, + {file = "cffi-1.15.1-cp37-cp37m-win32.whl", hash = "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9"}, + {file = "cffi-1.15.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045"}, + {file = "cffi-1.15.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192"}, + {file = "cffi-1.15.1-cp38-cp38-win32.whl", hash = "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314"}, + {file = "cffi-1.15.1-cp38-cp38-win_amd64.whl", hash = "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5"}, + {file = "cffi-1.15.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585"}, + {file = "cffi-1.15.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27"}, + {file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76"}, + {file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3"}, + {file = "cffi-1.15.1-cp39-cp39-win32.whl", hash = "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee"}, + {file = "cffi-1.15.1-cp39-cp39-win_amd64.whl", hash = "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c"}, + {file = "cffi-1.15.1.tar.gz", hash = "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9"}, +] + +[package.dependencies] +pycparser = "*" + +[[package]] +name = "cfgv" +version = "3.4.0" +description = "Validate configuration and produce human readable error messages." +optional = false +python-versions = ">=3.8" +files = [ + {file = "cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9"}, + {file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"}, +] + +[[package]] +name = "charset-normalizer" +version = "3.2.0" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.7.0" +files = [ + {file = "charset-normalizer-3.2.0.tar.gz", hash = "sha256:3bb3d25a8e6c0aedd251753a79ae98a093c7e7b471faa3aa9a93a81431987ace"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0b87549028f680ca955556e3bd57013ab47474c3124dc069faa0b6545b6c9710"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7c70087bfee18a42b4040bb9ec1ca15a08242cf5867c58726530bdf3945672ed"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a103b3a7069b62f5d4890ae1b8f0597618f628b286b03d4bc9195230b154bfa9"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94aea8eff76ee6d1cdacb07dd2123a68283cb5569e0250feab1240058f53b623"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:db901e2ac34c931d73054d9797383d0f8009991e723dab15109740a63e7f902a"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b0dac0ff919ba34d4df1b6131f59ce95b08b9065233446be7e459f95554c0dc8"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:193cbc708ea3aca45e7221ae58f0fd63f933753a9bfb498a3b474878f12caaad"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09393e1b2a9461950b1c9a45d5fd251dc7c6f228acab64da1c9c0165d9c7765c"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:baacc6aee0b2ef6f3d308e197b5d7a81c0e70b06beae1f1fcacffdbd124fe0e3"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:bf420121d4c8dce6b889f0e8e4ec0ca34b7f40186203f06a946fa0276ba54029"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:c04a46716adde8d927adb9457bbe39cf473e1e2c2f5d0a16ceb837e5d841ad4f"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:aaf63899c94de41fe3cf934601b0f7ccb6b428c6e4eeb80da72c58eab077b19a"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d62e51710986674142526ab9f78663ca2b0726066ae26b78b22e0f5e571238dd"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-win32.whl", hash = "sha256:04e57ab9fbf9607b77f7d057974694b4f6b142da9ed4a199859d9d4d5c63fe96"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:48021783bdf96e3d6de03a6e39a1171ed5bd7e8bb93fc84cc649d11490f87cea"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4957669ef390f0e6719db3613ab3a7631e68424604a7b448f079bee145da6e09"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:46fb8c61d794b78ec7134a715a3e564aafc8f6b5e338417cb19fe9f57a5a9bf2"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f779d3ad205f108d14e99bb3859aa7dd8e9c68874617c72354d7ecaec2a054ac"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f25c229a6ba38a35ae6e25ca1264621cc25d4d38dca2942a7fce0b67a4efe918"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2efb1bd13885392adfda4614c33d3b68dee4921fd0ac1d3988f8cbb7d589e72a"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f30b48dd7fa1474554b0b0f3fdfdd4c13b5c737a3c6284d3cdc424ec0ffff3a"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:246de67b99b6851627d945db38147d1b209a899311b1305dd84916f2b88526c6"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9bd9b3b31adcb054116447ea22caa61a285d92e94d710aa5ec97992ff5eb7cf3"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8c2f5e83493748286002f9369f3e6607c565a6a90425a3a1fef5ae32a36d749d"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3170c9399da12c9dc66366e9d14da8bf7147e1e9d9ea566067bbce7bb74bd9c2"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:7a4826ad2bd6b07ca615c74ab91f32f6c96d08f6fcc3902ceeedaec8cdc3bcd6"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:3b1613dd5aee995ec6d4c69f00378bbd07614702a315a2cf6c1d21461fe17c23"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9e608aafdb55eb9f255034709e20d5a83b6d60c054df0802fa9c9883d0a937aa"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-win32.whl", hash = "sha256:f2a1d0fd4242bd8643ce6f98927cf9c04540af6efa92323e9d3124f57727bfc1"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:681eb3d7e02e3c3655d1b16059fbfb605ac464c834a0c629048a30fad2b27489"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c57921cda3a80d0f2b8aec7e25c8aa14479ea92b5b51b6876d975d925a2ea346"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41b25eaa7d15909cf3ac4c96088c1f266a9a93ec44f87f1d13d4a0e86c81b982"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f058f6963fd82eb143c692cecdc89e075fa0828db2e5b291070485390b2f1c9c"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a7647ebdfb9682b7bb97e2a5e7cb6ae735b1c25008a70b906aecca294ee96cf4"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eef9df1eefada2c09a5e7a40991b9fc6ac6ef20b1372abd48d2794a316dc0449"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e03b8895a6990c9ab2cdcd0f2fe44088ca1c65ae592b8f795c3294af00a461c3"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:ee4006268ed33370957f55bf2e6f4d263eaf4dc3cfc473d1d90baff6ed36ce4a"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c4983bf937209c57240cff65906b18bb35e64ae872da6a0db937d7b4af845dd7"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:3bb7fda7260735efe66d5107fb7e6af6a7c04c7fce9b2514e04b7a74b06bf5dd"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:72814c01533f51d68702802d74f77ea026b5ec52793c791e2da806a3844a46c3"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:70c610f6cbe4b9fce272c407dd9d07e33e6bf7b4aa1b7ffb6f6ded8e634e3592"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-win32.whl", hash = "sha256:a401b4598e5d3f4a9a811f3daf42ee2291790c7f9d74b18d75d6e21dda98a1a1"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-win_amd64.whl", hash = "sha256:c0b21078a4b56965e2b12f247467b234734491897e99c1d51cee628da9786959"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:95eb302ff792e12aba9a8b8f8474ab229a83c103d74a750ec0bd1c1eea32e669"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1a100c6d595a7f316f1b6f01d20815d916e75ff98c27a01ae817439ea7726329"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6339d047dab2780cc6220f46306628e04d9750f02f983ddb37439ca47ced7149"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4b749b9cc6ee664a3300bb3a273c1ca8068c46be705b6c31cf5d276f8628a94"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a38856a971c602f98472050165cea2cdc97709240373041b69030be15047691f"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f87f746ee241d30d6ed93969de31e5ffd09a2961a051e60ae6bddde9ec3583aa"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89f1b185a01fe560bc8ae5f619e924407efca2191b56ce749ec84982fc59a32a"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1c8a2f4c69e08e89632defbfabec2feb8a8d99edc9f89ce33c4b9e36ab63037"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2f4ac36d8e2b4cc1aa71df3dd84ff8efbe3bfb97ac41242fbcfc053c67434f46"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a386ebe437176aab38c041de1260cd3ea459c6ce5263594399880bbc398225b2"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:ccd16eb18a849fd8dcb23e23380e2f0a354e8daa0c984b8a732d9cfaba3a776d"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:e6a5bf2cba5ae1bb80b154ed68a3cfa2fa00fde979a7f50d6598d3e17d9ac20c"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:45de3f87179c1823e6d9e32156fb14c1927fcc9aba21433f088fdfb555b77c10"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-win32.whl", hash = "sha256:1000fba1057b92a65daec275aec30586c3de2401ccdcd41f8a5c1e2c87078706"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:8b2c760cfc7042b27ebdb4a43a4453bd829a5742503599144d54a032c5dc7e9e"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:855eafa5d5a2034b4621c74925d89c5efef61418570e5ef9b37717d9c796419c"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:203f0c8871d5a7987be20c72442488a0b8cfd0f43b7973771640fc593f56321f"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e857a2232ba53ae940d3456f7533ce6ca98b81917d47adc3c7fd55dad8fab858"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e86d77b090dbddbe78867a0275cb4df08ea195e660f1f7f13435a4649e954e5"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4fb39a81950ec280984b3a44f5bd12819953dc5fa3a7e6fa7a80db5ee853952"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2dee8e57f052ef5353cf608e0b4c871aee320dd1b87d351c28764fc0ca55f9f4"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8700f06d0ce6f128de3ccdbc1acaea1ee264d2caa9ca05daaf492fde7c2a7200"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1920d4ff15ce893210c1f0c0e9d19bfbecb7983c76b33f046c13a8ffbd570252"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c1c76a1743432b4b60ab3358c937a3fe1341c828ae6194108a94c69028247f22"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f7560358a6811e52e9c4d142d497f1a6e10103d3a6881f18d04dbce3729c0e2c"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:c8063cf17b19661471ecbdb3df1c84f24ad2e389e326ccaf89e3fb2484d8dd7e"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:cd6dbe0238f7743d0efe563ab46294f54f9bc8f4b9bcf57c3c666cc5bc9d1299"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1249cbbf3d3b04902ff081ffbb33ce3377fa6e4c7356f759f3cd076cc138d020"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-win32.whl", hash = "sha256:6c409c0deba34f147f77efaa67b8e4bb83d2f11c8806405f76397ae5b8c0d1c9"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:7095f6fbfaa55defb6b733cfeb14efaae7a29f0b59d8cf213be4e7ca0b857b80"}, + {file = "charset_normalizer-3.2.0-py3-none-any.whl", hash = "sha256:8e098148dd37b4ce3baca71fb394c81dc5d9c7728c95df695d2dca218edf40e6"}, +] + +[[package]] +name = "cleo" +version = "2.0.1" +description = "Cleo allows you to create beautiful and testable command-line interfaces." +optional = false +python-versions = ">=3.7,<4.0" +files = [ + {file = "cleo-2.0.1-py3-none-any.whl", hash = "sha256:6eb133670a3ed1f3b052d53789017b6e50fca66d1287e6e6696285f4cb8ea448"}, + {file = "cleo-2.0.1.tar.gz", hash = "sha256:eb4b2e1f3063c11085cebe489a6e9124163c226575a3c3be69b2e51af4a15ec5"}, +] + +[package.dependencies] +crashtest = ">=0.4.1,<0.5.0" +rapidfuzz = ">=2.2.0,<3.0.0" + +[[package]] +name = "click" +version = "8.1.7" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.7" +files = [ + {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, + {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "colorlog" +version = "4.8.0" +description = "Log formatting with colors!" +optional = false +python-versions = "*" +files = [ + {file = "colorlog-4.8.0-py2.py3-none-any.whl", hash = "sha256:3dd15cb27e8119a24c1a7b5c93f9f3b455855e0f73993b1c25921b2f646f1dcd"}, + {file = "colorlog-4.8.0.tar.gz", hash = "sha256:59b53160c60902c405cdec28d38356e09d40686659048893e026ecbd589516b1"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} + +[[package]] +name = "coverage" +version = "6.5.0" +description = "Code coverage measurement for Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "coverage-6.5.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ef8674b0ee8cc11e2d574e3e2998aea5df5ab242e012286824ea3c6970580e53"}, + {file = "coverage-6.5.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:784f53ebc9f3fd0e2a3f6a78b2be1bd1f5575d7863e10c6e12504f240fd06660"}, + {file = "coverage-6.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b4a5be1748d538a710f87542f22c2cad22f80545a847ad91ce45e77417293eb4"}, + {file = "coverage-6.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:83516205e254a0cb77d2d7bb3632ee019d93d9f4005de31dca0a8c3667d5bc04"}, + {file = "coverage-6.5.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:af4fffaffc4067232253715065e30c5a7ec6faac36f8fc8d6f64263b15f74db0"}, + {file = "coverage-6.5.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:97117225cdd992a9c2a5515db1f66b59db634f59d0679ca1fa3fe8da32749cae"}, + {file = "coverage-6.5.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a1170fa54185845505fbfa672f1c1ab175446c887cce8212c44149581cf2d466"}, + {file = "coverage-6.5.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:11b990d520ea75e7ee8dcab5bc908072aaada194a794db9f6d7d5cfd19661e5a"}, + {file = "coverage-6.5.0-cp310-cp310-win32.whl", hash = "sha256:5dbec3b9095749390c09ab7c89d314727f18800060d8d24e87f01fb9cfb40b32"}, + {file = "coverage-6.5.0-cp310-cp310-win_amd64.whl", hash = "sha256:59f53f1dc5b656cafb1badd0feb428c1e7bc19b867479ff72f7a9dd9b479f10e"}, + {file = "coverage-6.5.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4a5375e28c5191ac38cca59b38edd33ef4cc914732c916f2929029b4bfb50795"}, + {file = "coverage-6.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c4ed2820d919351f4167e52425e096af41bfabacb1857186c1ea32ff9983ed75"}, + {file = "coverage-6.5.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:33a7da4376d5977fbf0a8ed91c4dffaaa8dbf0ddbf4c8eea500a2486d8bc4d7b"}, + {file = "coverage-6.5.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8fb6cf131ac4070c9c5a3e21de0f7dc5a0fbe8bc77c9456ced896c12fcdad91"}, + {file = "coverage-6.5.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a6b7d95969b8845250586f269e81e5dfdd8ff828ddeb8567a4a2eaa7313460c4"}, + {file = "coverage-6.5.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:1ef221513e6f68b69ee9e159506d583d31aa3567e0ae84eaad9d6ec1107dddaa"}, + {file = "coverage-6.5.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cca4435eebea7962a52bdb216dec27215d0df64cf27fc1dd538415f5d2b9da6b"}, + {file = "coverage-6.5.0-cp311-cp311-win32.whl", hash = "sha256:98e8a10b7a314f454d9eff4216a9a94d143a7ee65018dd12442e898ee2310578"}, + {file = "coverage-6.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:bc8ef5e043a2af066fa8cbfc6e708d58017024dc4345a1f9757b329a249f041b"}, + {file = "coverage-6.5.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4433b90fae13f86fafff0b326453dd42fc9a639a0d9e4eec4d366436d1a41b6d"}, + {file = "coverage-6.5.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f4f05d88d9a80ad3cac6244d36dd89a3c00abc16371769f1340101d3cb899fc3"}, + {file = "coverage-6.5.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:94e2565443291bd778421856bc975d351738963071e9b8839ca1fc08b42d4bef"}, + {file = "coverage-6.5.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:027018943386e7b942fa832372ebc120155fd970837489896099f5cfa2890f79"}, + {file = "coverage-6.5.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:255758a1e3b61db372ec2736c8e2a1fdfaf563977eedbdf131de003ca5779b7d"}, + {file = "coverage-6.5.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:851cf4ff24062c6aec510a454b2584f6e998cada52d4cb58c5e233d07172e50c"}, + {file = "coverage-6.5.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:12adf310e4aafddc58afdb04d686795f33f4d7a6fa67a7a9d4ce7d6ae24d949f"}, + {file = "coverage-6.5.0-cp37-cp37m-win32.whl", hash = "sha256:b5604380f3415ba69de87a289a2b56687faa4fe04dbee0754bfcae433489316b"}, + {file = "coverage-6.5.0-cp37-cp37m-win_amd64.whl", hash = "sha256:4a8dbc1f0fbb2ae3de73eb0bdbb914180c7abfbf258e90b311dcd4f585d44bd2"}, + {file = "coverage-6.5.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d900bb429fdfd7f511f868cedd03a6bbb142f3f9118c09b99ef8dc9bf9643c3c"}, + {file = "coverage-6.5.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2198ea6fc548de52adc826f62cb18554caedfb1d26548c1b7c88d8f7faa8f6ba"}, + {file = "coverage-6.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c4459b3de97b75e3bd6b7d4b7f0db13f17f504f3d13e2a7c623786289dd670e"}, + {file = "coverage-6.5.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:20c8ac5386253717e5ccc827caad43ed66fea0efe255727b1053a8154d952398"}, + {file = "coverage-6.5.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b07130585d54fe8dff3d97b93b0e20290de974dc8177c320aeaf23459219c0b"}, + {file = "coverage-6.5.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:dbdb91cd8c048c2b09eb17713b0c12a54fbd587d79adcebad543bc0cd9a3410b"}, + {file = "coverage-6.5.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:de3001a203182842a4630e7b8d1a2c7c07ec1b45d3084a83d5d227a3806f530f"}, + {file = "coverage-6.5.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e07f4a4a9b41583d6eabec04f8b68076ab3cd44c20bd29332c6572dda36f372e"}, + {file = "coverage-6.5.0-cp38-cp38-win32.whl", hash = "sha256:6d4817234349a80dbf03640cec6109cd90cba068330703fa65ddf56b60223a6d"}, + {file = "coverage-6.5.0-cp38-cp38-win_amd64.whl", hash = "sha256:7ccf362abd726b0410bf8911c31fbf97f09f8f1061f8c1cf03dfc4b6372848f6"}, + {file = "coverage-6.5.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:633713d70ad6bfc49b34ead4060531658dc6dfc9b3eb7d8a716d5873377ab745"}, + {file = "coverage-6.5.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:95203854f974e07af96358c0b261f1048d8e1083f2de9b1c565e1be4a3a48cfc"}, + {file = "coverage-6.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b9023e237f4c02ff739581ef35969c3739445fb059b060ca51771e69101efffe"}, + {file = "coverage-6.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:265de0fa6778d07de30bcf4d9dc471c3dc4314a23a3c6603d356a3c9abc2dfcf"}, + {file = "coverage-6.5.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f830ed581b45b82451a40faabb89c84e1a998124ee4212d440e9c6cf70083e5"}, + {file = "coverage-6.5.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7b6be138d61e458e18d8e6ddcddd36dd96215edfe5f1168de0b1b32635839b62"}, + {file = "coverage-6.5.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:42eafe6778551cf006a7c43153af1211c3aaab658d4d66fa5fcc021613d02518"}, + {file = "coverage-6.5.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:723e8130d4ecc8f56e9a611e73b31219595baa3bb252d539206f7bbbab6ffc1f"}, + {file = "coverage-6.5.0-cp39-cp39-win32.whl", hash = "sha256:d9ecf0829c6a62b9b573c7bb6d4dcd6ba8b6f80be9ba4fc7ed50bf4ac9aecd72"}, + {file = "coverage-6.5.0-cp39-cp39-win_amd64.whl", hash = "sha256:fc2af30ed0d5ae0b1abdb4ebdce598eafd5b35397d4d75deb341a614d333d987"}, + {file = "coverage-6.5.0-pp36.pp37.pp38-none-any.whl", hash = "sha256:1431986dac3923c5945271f169f59c45b8802a114c8f548d611f2015133df77a"}, + {file = "coverage-6.5.0.tar.gz", hash = "sha256:f642e90754ee3e06b0e7e51bce3379590e76b7f76b708e1a71ff043f87025c84"}, +] + +[package.extras] +toml = ["tomli"] + +[[package]] +name = "coveralls" +version = "3.3.1" +description = "Show coverage stats online via coveralls.io" +optional = false +python-versions = ">= 3.5" +files = [ + {file = "coveralls-3.3.1-py2.py3-none-any.whl", hash = "sha256:f42015f31d386b351d4226389b387ae173207058832fbf5c8ec4b40e27b16026"}, + {file = "coveralls-3.3.1.tar.gz", hash = "sha256:b32a8bb5d2df585207c119d6c01567b81fba690c9c10a753bfe27a335bfc43ea"}, +] + +[package.dependencies] +coverage = ">=4.1,<6.0.dev0 || >6.1,<6.1.1 || >6.1.1,<7.0" +docopt = ">=0.6.1" +requests = ">=1.0.0" + +[package.extras] +yaml = ["PyYAML (>=3.10)"] + +[[package]] +name = "crashtest" +version = "0.4.1" +description = "Manage Python errors with ease" +optional = false +python-versions = ">=3.7,<4.0" +files = [ + {file = "crashtest-0.4.1-py3-none-any.whl", hash = "sha256:8d23eac5fa660409f57472e3851dab7ac18aba459a8d19cbbba86d3d5aecd2a5"}, + {file = "crashtest-0.4.1.tar.gz", hash = "sha256:80d7b1f316ebfbd429f648076d6275c877ba30ba48979de4191714a75266f0ce"}, +] + +[[package]] +name = "cryptography" +version = "41.0.3" +description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." +optional = false +python-versions = ">=3.7" +files = [ + {file = "cryptography-41.0.3-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:652627a055cb52a84f8c448185922241dd5217443ca194d5739b44612c5e6507"}, + {file = "cryptography-41.0.3-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:8f09daa483aedea50d249ef98ed500569841d6498aa9c9f4b0531b9964658922"}, + {file = "cryptography-41.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fd871184321100fb400d759ad0cddddf284c4b696568204d281c902fc7b0d81"}, + {file = "cryptography-41.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:84537453d57f55a50a5b6835622ee405816999a7113267739a1b4581f83535bd"}, + {file = "cryptography-41.0.3-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:3fb248989b6363906827284cd20cca63bb1a757e0a2864d4c1682a985e3dca47"}, + {file = "cryptography-41.0.3-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:42cb413e01a5d36da9929baa9d70ca90d90b969269e5a12d39c1e0d475010116"}, + {file = "cryptography-41.0.3-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:aeb57c421b34af8f9fe830e1955bf493a86a7996cc1338fe41b30047d16e962c"}, + {file = "cryptography-41.0.3-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:6af1c6387c531cd364b72c28daa29232162010d952ceb7e5ca8e2827526aceae"}, + {file = "cryptography-41.0.3-cp37-abi3-win32.whl", hash = "sha256:0d09fb5356f975974dbcb595ad2d178305e5050656affb7890a1583f5e02a306"}, + {file = "cryptography-41.0.3-cp37-abi3-win_amd64.whl", hash = "sha256:a983e441a00a9d57a4d7c91b3116a37ae602907a7618b882c8013b5762e80574"}, + {file = "cryptography-41.0.3-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5259cb659aa43005eb55a0e4ff2c825ca111a0da1814202c64d28a985d33b087"}, + {file = "cryptography-41.0.3-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:67e120e9a577c64fe1f611e53b30b3e69744e5910ff3b6e97e935aeb96005858"}, + {file = "cryptography-41.0.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:7efe8041897fe7a50863e51b77789b657a133c75c3b094e51b5e4b5cec7bf906"}, + {file = "cryptography-41.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ce785cf81a7bdade534297ef9e490ddff800d956625020ab2ec2780a556c313e"}, + {file = "cryptography-41.0.3-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:57a51b89f954f216a81c9d057bf1a24e2f36e764a1ca9a501a6964eb4a6800dd"}, + {file = "cryptography-41.0.3-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:4c2f0d35703d61002a2bbdcf15548ebb701cfdd83cdc12471d2bae80878a4207"}, + {file = "cryptography-41.0.3-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:23c2d778cf829f7d0ae180600b17e9fceea3c2ef8b31a99e3c694cbbf3a24b84"}, + {file = "cryptography-41.0.3-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:95dd7f261bb76948b52a5330ba5202b91a26fbac13ad0e9fc8a3ac04752058c7"}, + {file = "cryptography-41.0.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:41d7aa7cdfded09b3d73a47f429c298e80796c8e825ddfadc84c8a7f12df212d"}, + {file = "cryptography-41.0.3-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:d0d651aa754ef58d75cec6edfbd21259d93810b73f6ec246436a21b7841908de"}, + {file = "cryptography-41.0.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:ab8de0d091acbf778f74286f4989cf3d1528336af1b59f3e5d2ebca8b5fe49e1"}, + {file = "cryptography-41.0.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:a74fbcdb2a0d46fe00504f571a2a540532f4c188e6ccf26f1f178480117b33c4"}, + {file = "cryptography-41.0.3.tar.gz", hash = "sha256:6d192741113ef5e30d89dcb5b956ef4e1578f304708701b8b73d38e3e1461f34"}, +] + +[package.dependencies] +cffi = ">=1.12" + +[package.extras] +docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"] +docstest = ["pyenchant (>=1.6.11)", "sphinxcontrib-spelling (>=4.0.1)", "twine (>=1.12.0)"] +nox = ["nox"] +pep8test = ["black", "check-sdist", "mypy", "ruff"] +sdist = ["build"] +ssh = ["bcrypt (>=3.1.5)"] +test = ["pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] +test-randomorder = ["pytest-randomly"] + +[[package]] +name = "cython" +version = "0.29.36" +description = "The Cython compiler for writing C extensions for the Python language." +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "Cython-0.29.36-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1ea33c1c57f331f5653baa1313e445fbe80d1da56dd9a42c8611037887897b9d"}, + {file = "Cython-0.29.36-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:2fe34615c13ace29e77bf9d21c26188d23eff7ad8b3e248da70404e5f5436b95"}, + {file = "Cython-0.29.36-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ae75eac4f13cbbcb50b2097470dcea570182446a3ebd0f7e95dd425c2017a2d7"}, + {file = "Cython-0.29.36-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:847d07fc02978c4433d01b4f5ee489b75fd42fd32ccf9cc4b5fd887e8cffe822"}, + {file = "Cython-0.29.36-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:7cb44aeaf6c5c25bd6a7562ece4eadf50d606fc9b5f624fa95bd0281e8bf0a97"}, + {file = "Cython-0.29.36-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:28fb10aabd56a2e4d399273b48e106abe5a0d271728fd5eed3d36e7171000045"}, + {file = "Cython-0.29.36-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl", hash = "sha256:86b7a13c6b23ab6471d40a320f573fbc8a4e39833947eebed96661145dc34771"}, + {file = "Cython-0.29.36-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:19ccf7fc527cf556e2e6a3dfeffcadfbcabd24a59a988289117795dfed8a25ad"}, + {file = "Cython-0.29.36-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:74bddfc7dc8958526b2018d3adc1aa6dc9cf2a24095c972e5ad06758c360b261"}, + {file = "Cython-0.29.36-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:6c4d7e36fe0211e394adffd296382b435ac22762d14f2fe45c506c230f91cf2d"}, + {file = "Cython-0.29.36-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl", hash = "sha256:0bca6a7504e8cfc63a4d3c7c9b9a04e5d05501942a6c8cee177363b61a32c2d4"}, + {file = "Cython-0.29.36-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:17c74f80b06e2fa8ffc8acd41925f4f9922da8a219cd25c6901beab2f7c56cc5"}, + {file = "Cython-0.29.36-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:25ff471a459aad82146973b0b8c177175ab896051080713d3035ad4418739f66"}, + {file = "Cython-0.29.36-cp35-cp35m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a9738f23d00d99481797b155ad58f8fc1c72096926ea2554b8ccc46e1d356c27"}, + {file = "Cython-0.29.36-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:af2f333f08c4c279f3480532341bf70ec8010bcbc7d8a6daa5ca0bf4513af295"}, + {file = "Cython-0.29.36-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:cd77cedbcc13cb67aef39b8615fd50a67fc42b0c6defea6fc0a21e19d3a062ec"}, + {file = "Cython-0.29.36-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:50d506d73a46c4a522ef9fdafcbf7a827ba13907b18ff58f61a8fa0887d0bd8d"}, + {file = "Cython-0.29.36-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl", hash = "sha256:6a571d7c7b52ee12d73bc65b4855779c069545da3bac26bec06a1389ad17ade5"}, + {file = "Cython-0.29.36-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a216b2801c7d9c3babe0a10cc25da3bc92494d7047d1f732d3c47b0cceaf0941"}, + {file = "Cython-0.29.36-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:68abee3be27f21c9642a07a93f8333d491f4c52bc70068e42f51685df9ac1a57"}, + {file = "Cython-0.29.36-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:1ef90023da8a9bf84cf16f06186db0906d2ce52a09f751e2cb9d3da9d54eae46"}, + {file = "Cython-0.29.36-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:9deef0761e8c798043dbb728a1c6df97b26e5edc65b8d6c7608b3c07af3eb722"}, + {file = "Cython-0.29.36-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:69af2365de2343b4e5a61c567e7611ddf2575ae6f6e5c01968f7d4f2747324eb"}, + {file = "Cython-0.29.36-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl", hash = "sha256:fdf377b0f6e9325b73ad88933136023184afdc795caeeaaf3dca13494cffd15e"}, + {file = "Cython-0.29.36-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1ff2cc5518558c598028ae8d9a43401e0e734b74b6e598156b005328c9da3472"}, + {file = "Cython-0.29.36-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:7ca921068242cd8b52544870c807fe285c1f248b12df7b6dfae25cc9957b965e"}, + {file = "Cython-0.29.36-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:6058a6d04e04d790cda530e1ff675e9352359eb4b777920df3cac2b62a9a030f"}, + {file = "Cython-0.29.36-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:de2045ceae1857e56a72f08e0acfa48c994277a353b7bdab1f097db9f8803f19"}, + {file = "Cython-0.29.36-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:9f2a4b4587aaef08815410dc20653613ca04a120a2954a92c39e37c6b5fdf6be"}, + {file = "Cython-0.29.36-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl", hash = "sha256:2edd9f8edca69178d74cbbbc180bc3e848433c9b7dc80374a11a0bb0076c926d"}, + {file = "Cython-0.29.36-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c6c0aea8491a70f98b7496b5057c9523740e02cec21cd678eef609d2aa6c1257"}, + {file = "Cython-0.29.36-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:768f65b16d23c630d8829ce1f95520ef1531a9c0489fa872d87c8c3813f65aee"}, + {file = "Cython-0.29.36-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:568625e8274ee7288ad87b0f615ec36ab446ca9b35e77481ed010027d99c7020"}, + {file = "Cython-0.29.36-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:bdc0a4cb99f55e6878d4b67a4bfee23823484915cb6b7e9c9dd01002dd3592ea"}, + {file = "Cython-0.29.36-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:f0df6552be39853b10dfb5a10dbd08f5c49023d6b390d7ce92d4792a8b6e73ee"}, + {file = "Cython-0.29.36-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl", hash = "sha256:8894db6f5b6479a3c164e0454e13083ebffeaa9a0822668bb2319bdf1b783df1"}, + {file = "Cython-0.29.36-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:53f93a8c342e9445a8f0cb7039775294f2dbbe5241936573daeaf0afe30397e4"}, + {file = "Cython-0.29.36-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:ee317f9bcab901a3db39c34ee5a27716f7132e5c0de150125342694d18b30f51"}, + {file = "Cython-0.29.36-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e4b8269e5a5d127a2191b02b9df3636c0dac73f14f1ff8a831f39cb5197c4f38"}, + {file = "Cython-0.29.36-py2.py3-none-any.whl", hash = "sha256:95bb13d8be507425d03ebe051f90d4b2a9fdccc64e4f30b35645fdb7542742eb"}, + {file = "Cython-0.29.36.tar.gz", hash = "sha256:41c0cfd2d754e383c9eeb95effc9aa4ab847d0c9747077ddd7c0dcb68c3bc01f"}, +] + +[[package]] +name = "dacite" +version = "1.8.1" +description = "Simple creation of data classes from dictionaries." +optional = false +python-versions = ">=3.6" +files = [ + {file = "dacite-1.8.1-py3-none-any.whl", hash = "sha256:cc31ad6fdea1f49962ea42db9421772afe01ac5442380d9a99fcf3d188c61afe"}, +] + +[package.extras] +dev = ["black", "coveralls", "mypy", "pre-commit", "pylint", "pytest (>=5)", "pytest-benchmark", "pytest-cov"] + +[[package]] +name = "distlib" +version = "0.3.7" +description = "Distribution utilities" +optional = false +python-versions = "*" +files = [ + {file = "distlib-0.3.7-py2.py3-none-any.whl", hash = "sha256:2e24928bc811348f0feb63014e97aaae3037f2cf48712d51ae61df7fd6075057"}, + {file = "distlib-0.3.7.tar.gz", hash = "sha256:9dafe54b34a028eafd95039d5e5d4851a13734540f1331060d31c9916e7147a8"}, +] + +[[package]] +name = "docopt" +version = "0.6.2" +description = "Pythonic argument parser, that will make you smile" +optional = false +python-versions = "*" +files = [ + {file = "docopt-0.6.2.tar.gz", hash = "sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"}, +] + +[[package]] +name = "dulwich" +version = "0.21.5" +description = "Python Git Library" +optional = false +python-versions = ">=3.7" +files = [ + {file = "dulwich-0.21.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:8864719bc176cdd27847332a2059127e2f7bab7db2ff99a999873cb7fff54116"}, + {file = "dulwich-0.21.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3800cdc17d144c1f7e114972293bd6c46688f5bcc2c9228ed0537ded72394082"}, + {file = "dulwich-0.21.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e2f676bfed8146966fe934ee734969d7d81548fbd250a8308582973670a9dab1"}, + {file = "dulwich-0.21.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4db330fb59fe3b9d253bdf0e49a521739db83689520c4921ab1c5242aaf77b82"}, + {file = "dulwich-0.21.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3e8f6d4f4f4d01dd1d3c968e486d4cd77f96f772da7265941bc506de0944ddb9"}, + {file = "dulwich-0.21.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:1cc0c9ba19ac1b2372598802bc9201a9c45e5d6f1f7a80ec40deeb10acc4e9ae"}, + {file = "dulwich-0.21.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:61e10242b5a7a82faa8996b2c76239cfb633620b02cdd2946e8af6e7eb31d651"}, + {file = "dulwich-0.21.5-cp310-cp310-win32.whl", hash = "sha256:7f357639b56146a396f48e5e0bc9bbaca3d6d51c8340bd825299272b588fff5f"}, + {file = "dulwich-0.21.5-cp310-cp310-win_amd64.whl", hash = "sha256:891d5c73e2b66d05dbb502e44f027dc0dbbd8f6198bc90dae348152e69d0befc"}, + {file = "dulwich-0.21.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:45d6198e804b539708b73a003419e48fb42ff2c3c6dd93f63f3b134dff6dd259"}, + {file = "dulwich-0.21.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c2a565d4e704d7f784cdf9637097141f6d47129c8fffc2fac699d57cb075a169"}, + {file = "dulwich-0.21.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:823091d6b6a1ea07dc4839c9752198fb39193213d103ac189c7669736be2eaff"}, + {file = "dulwich-0.21.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2c9931b657f2206abec0964ec2355ee2c1e04d05f8864e823ffa23c548c4548"}, + {file = "dulwich-0.21.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7dc358c2ee727322a09b7c6da43d47a1026049dbd3ad8d612eddca1f9074b298"}, + {file = "dulwich-0.21.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6155ab7388ee01c670f7c5d8003d4e133eebebc7085a856c007989f0ba921b36"}, + {file = "dulwich-0.21.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a605e10d72f90a39ea2e634fbfd80f866fc4df29a02ea6db52ae92e5fd4a2003"}, + {file = "dulwich-0.21.5-cp311-cp311-win32.whl", hash = "sha256:daa607370722c3dce99a0022397c141caefb5ed32032a4f72506f4817ea6405b"}, + {file = "dulwich-0.21.5-cp311-cp311-win_amd64.whl", hash = "sha256:5e56b2c1911c344527edb2bf1a4356e2fb7e086b1ba309666e1e5c2224cdca8a"}, + {file = "dulwich-0.21.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:85d3401d08b1ec78c7d58ae987c4bb7b768a438f3daa74aeb8372bebc7fb16fa"}, + {file = "dulwich-0.21.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:90479608e49db93d8c9e4323bc0ec5496678b535446e29d8fd67dc5bbb5d51bf"}, + {file = "dulwich-0.21.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f9a6bf99f57bcac4c77fc60a58f1b322c91cc4d8c65dc341f76bf402622f89cb"}, + {file = "dulwich-0.21.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:3e68b162af2aae995355e7920f89d50d72b53d56021e5ac0a546d493b17cbf7e"}, + {file = "dulwich-0.21.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:0ab86d6d42e385bf3438e70f3c9b16de68018bd88929379e3484c0ef7990bd3c"}, + {file = "dulwich-0.21.5-cp37-cp37m-win32.whl", hash = "sha256:f2eeca6d61366cf5ee8aef45bed4245a67d4c0f0d731dc2383eabb80fa695683"}, + {file = "dulwich-0.21.5-cp37-cp37m-win_amd64.whl", hash = "sha256:1b20a3656b48c941d49c536824e1e5278a695560e8de1a83b53a630143c4552e"}, + {file = "dulwich-0.21.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:3932b5e17503b265a85f1eda77ede647681c3bab53bc9572955b6b282abd26ea"}, + {file = "dulwich-0.21.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6616132d219234580de88ceb85dd51480dc43b1bdc05887214b8dd9cfd4a9d40"}, + {file = "dulwich-0.21.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:eaf6c7fb6b13495c19c9aace88821c2ade3c8c55b4e216cd7cc55d3e3807d7fa"}, + {file = "dulwich-0.21.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be12a46f73023970125808a4a78f610c055373096c1ecea3280edee41613eba8"}, + {file = "dulwich-0.21.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baecef0d8b9199822c7912876a03a1af17833f6c0d461efb62decebd45897e49"}, + {file = "dulwich-0.21.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:82f632afb9c7c341a875d46aaa3e6c5e586c7a64ce36c9544fa400f7e4f29754"}, + {file = "dulwich-0.21.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:82cdf482f8f51fcc965ffad66180b54a9abaea9b1e985a32e1acbfedf6e0e363"}, + {file = "dulwich-0.21.5-cp38-cp38-win32.whl", hash = "sha256:c8ded43dc0bd2e65420eb01e778034be5ca7f72e397a839167eda7dcb87c4248"}, + {file = "dulwich-0.21.5-cp38-cp38-win_amd64.whl", hash = "sha256:2aba0fdad2a19bd5bb3aad6882580cb33359c67b48412ccd4cfccd932012b35e"}, + {file = "dulwich-0.21.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:fd4ad079758514375f11469e081723ba8831ce4eaa1a64b41f06a3a866d5ac34"}, + {file = "dulwich-0.21.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7fe62685bf356bfb4d0738f84a3fcf0d1fc9e11fee152e488a20b8c66a52429e"}, + {file = "dulwich-0.21.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:aae448da7d80306dda4fc46292fed7efaa466294571ab3448be16714305076f1"}, + {file = "dulwich-0.21.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b24cb1fad0525dba4872e9381bc576ea2a6dcdf06b0ed98f8e953e3b1d719b89"}, + {file = "dulwich-0.21.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1e39b7c2c9bda6acae83b25054650a8bb7e373e886e2334721d384e1479bf04b"}, + {file = "dulwich-0.21.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:26456dba39d1209fca17187db06967130e27eeecad2b3c2bbbe63467b0bf09d6"}, + {file = "dulwich-0.21.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:281310644e02e3aa6d76bcaffe2063b9031213c4916b5f1a6e68c25bdecfaba4"}, + {file = "dulwich-0.21.5-cp39-cp39-win32.whl", hash = "sha256:4814ca3209dabe0fe7719e9545fbdad7f8bb250c5a225964fe2a31069940c4cf"}, + {file = "dulwich-0.21.5-cp39-cp39-win_amd64.whl", hash = "sha256:c922a4573267486be0ef85216f2da103fb38075b8465dc0e90457843884e4860"}, + {file = "dulwich-0.21.5-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:e52b20c4368171b7d32bd3ab0f1d2402e76ad4f2ea915ff9aa73bc9fa2b54d6d"}, + {file = "dulwich-0.21.5-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aeb736d777ee21f2117a90fc453ee181aa7eedb9e255b5ef07c51733f3fe5cb6"}, + {file = "dulwich-0.21.5-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e8a79c1ed7166f32ad21974fa98d11bf6fd74e94a47e754c777c320e01257c6"}, + {file = "dulwich-0.21.5-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:b943517e30bd651fbc275a892bb96774f3893d95fe5a4dedd84496a98eaaa8ab"}, + {file = "dulwich-0.21.5-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:32493a456358a3a6c15bbda07106fc3d4cc50834ee18bc7717968d18be59b223"}, + {file = "dulwich-0.21.5-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0aa44b812d978fc22a04531f5090c3c369d5facd03fa6e0501d460a661800c7f"}, + {file = "dulwich-0.21.5-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f46bcb6777e5f9f4af24a2bd029e88b77316269d24ce66be590e546a0d8f7b7"}, + {file = "dulwich-0.21.5-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:a917fd3b4493db3716da2260f16f6b18f68d46fbe491d851d154fc0c2d984ae4"}, + {file = "dulwich-0.21.5-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:684c52cff867d10c75a7238151ca307582b3d251bbcd6db9e9cffbc998ef804e"}, + {file = "dulwich-0.21.5-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9019189d7a8f7394df6a22cd5b484238c5776e42282ad5d6d6c626b4c5f43597"}, + {file = "dulwich-0.21.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:494024f74c2eef9988adb4352b3651ac1b6c0466176ec62b69d3d3672167ba68"}, + {file = "dulwich-0.21.5-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:f9b6ac1b1c67fc6083c42b7b6cd3b211292c8a6517216c733caf23e8b103ab6d"}, + {file = "dulwich-0.21.5.tar.gz", hash = "sha256:70955e4e249ddda6e34a4636b90f74e931e558f993b17c52570fa6144b993103"}, +] + +[package.dependencies] +urllib3 = ">=1.25" + +[package.extras] +fastimport = ["fastimport"] +https = ["urllib3 (>=1.24.1)"] +paramiko = ["paramiko"] +pgp = ["gpg"] + +[[package]] +name = "fastapi" +version = "0.103.2" +description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" +optional = false +python-versions = ">=3.7" +files = [ + {file = "fastapi-0.103.2-py3-none-any.whl", hash = "sha256:3270de872f0fe9ec809d4bd3d4d890c6d5cc7b9611d721d6438f9dacc8c4ef2e"}, + {file = "fastapi-0.103.2.tar.gz", hash = "sha256:75a11f6bfb8fc4d2bec0bd710c2d5f2829659c0e8c0afd5560fdda6ce25ec653"}, +] + +[package.dependencies] +anyio = ">=3.7.1,<4.0.0" +pydantic = ">=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.1.0 || >2.1.0,<3.0.0" +starlette = ">=0.27.0,<0.28.0" +typing-extensions = ">=4.5.0" + +[package.extras] +all = ["email-validator (>=2.0.0)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=2.11.2)", "orjson (>=3.2.1)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.5)", "pyyaml (>=5.3.1)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0)", "uvicorn[standard] (>=0.12.0)"] + +[[package]] +name = "filelock" +version = "3.12.2" +description = "A platform independent file lock." +optional = false +python-versions = ">=3.7" +files = [ + {file = "filelock-3.12.2-py3-none-any.whl", hash = "sha256:cbb791cdea2a72f23da6ac5b5269ab0a0d161e9ef0100e653b69049a7706d1ec"}, + {file = "filelock-3.12.2.tar.gz", hash = "sha256:002740518d8aa59a26b0c76e10fb8c6e15eae825d34b6fdf670333fd7b938d81"}, +] + +[package.extras] +docs = ["furo (>=2023.5.20)", "sphinx (>=7.0.1)", "sphinx-autodoc-typehints (>=1.23,!=1.23.4)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "diff-cover (>=7.5)", "pytest (>=7.3.1)", "pytest-cov (>=4.1)", "pytest-mock (>=3.10)", "pytest-timeout (>=2.1)"] + +[[package]] +name = "flake8" +version = "6.1.0" +description = "the modular source code checker: pep8 pyflakes and co" +optional = false +python-versions = ">=3.8.1" +files = [ + {file = "flake8-6.1.0-py2.py3-none-any.whl", hash = "sha256:ffdfce58ea94c6580c77888a86506937f9a1a227dfcd15f245d694ae20a6b6e5"}, + {file = "flake8-6.1.0.tar.gz", hash = "sha256:d5b3857f07c030bdb5bf41c7f53799571d75c4491748a3adcd47de929e34cd23"}, +] + +[package.dependencies] +mccabe = ">=0.7.0,<0.8.0" +pycodestyle = ">=2.11.0,<2.12.0" +pyflakes = ">=3.1.0,<3.2.0" + +[[package]] +name = "flake8-bugbear" +version = "23.7.10" +description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle." +optional = false +python-versions = ">=3.8.1" +files = [ + {file = "flake8-bugbear-23.7.10.tar.gz", hash = "sha256:0ebdc7d8ec1ca8bd49347694562381f099f4de2f8ec6bda7a7dca65555d9e0d4"}, + {file = "flake8_bugbear-23.7.10-py3-none-any.whl", hash = "sha256:d99d005114020fbef47ed5e4aebafd22f167f9a0fbd0d8bf3c9e90612cb25c34"}, +] + +[package.dependencies] +attrs = ">=19.2.0" +flake8 = ">=6.0.0" + +[package.extras] +dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit", "pytest", "tox"] + +[[package]] +name = "gitdb" +version = "4.0.10" +description = "Git Object Database" +optional = false +python-versions = ">=3.7" +files = [ + {file = "gitdb-4.0.10-py3-none-any.whl", hash = "sha256:c286cf298426064079ed96a9e4a9d39e7f3e9bf15ba60701e95f5492f28415c7"}, + {file = "gitdb-4.0.10.tar.gz", hash = "sha256:6eb990b69df4e15bad899ea868dc46572c3f75339735663b81de79b06f17eb9a"}, +] + +[package.dependencies] +smmap = ">=3.0.1,<6" + +[[package]] +name = "gitpython" +version = "3.1.32" +description = "GitPython is a Python library used to interact with Git repositories" +optional = false +python-versions = ">=3.7" +files = [ + {file = "GitPython-3.1.32-py3-none-any.whl", hash = "sha256:e3d59b1c2c6ebb9dfa7a184daf3b6dd4914237e7488a1730a6d8f6f5d0b4187f"}, + {file = "GitPython-3.1.32.tar.gz", hash = "sha256:8d9b8cb1e80b9735e8717c9362079d3ce4c6e5ddeebedd0361b228c3a67a62f6"}, +] + +[package.dependencies] +gitdb = ">=4.0.1,<5" + +[[package]] +name = "h11" +version = "0.14.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.7" +files = [ + {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, + {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, +] + +[[package]] +name = "httpcore" +version = "0.18.0" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpcore-0.18.0-py3-none-any.whl", hash = "sha256:adc5398ee0a476567bf87467063ee63584a8bce86078bf748e48754f60202ced"}, + {file = "httpcore-0.18.0.tar.gz", hash = "sha256:13b5e5cd1dca1a6636a6aaea212b19f4f85cd88c366a2b82304181b769aab3c9"}, +] + +[package.dependencies] +anyio = ">=3.0,<5.0" +certifi = "*" +h11 = ">=0.13,<0.15" +sniffio = "==1.*" + +[package.extras] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] + +[[package]] +name = "httpx" +version = "0.25.0" +description = "The next generation HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-0.25.0-py3-none-any.whl", hash = "sha256:181ea7f8ba3a82578be86ef4171554dd45fec26a02556a744db029a0a27b7100"}, + {file = "httpx-0.25.0.tar.gz", hash = "sha256:47ecda285389cb32bb2691cc6e069e3ab0205956f681c5b2ad2325719751d875"}, +] + +[package.dependencies] +certifi = "*" +httpcore = ">=0.18.0,<0.19.0" +idna = "*" +sniffio = "*" + +[package.extras] +brotli = ["brotli", "brotlicffi"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] + +[[package]] +name = "identify" +version = "2.5.27" +description = "File identification library for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "identify-2.5.27-py2.py3-none-any.whl", hash = "sha256:fdb527b2dfe24602809b2201e033c2a113d7bdf716db3ca8e3243f735dcecaba"}, + {file = "identify-2.5.27.tar.gz", hash = "sha256:287b75b04a0e22d727bc9a41f0d4f3c1bcada97490fa6eabb5b28f0e9097e733"}, +] + +[package.extras] +license = ["ukkonen"] + +[[package]] +name = "idna" +version = "3.4" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.5" +files = [ + {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, + {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, +] + +[[package]] +name = "importlib-metadata" +version = "6.8.0" +description = "Read metadata from Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "importlib_metadata-6.8.0-py3-none-any.whl", hash = "sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb"}, + {file = "importlib_metadata-6.8.0.tar.gz", hash = "sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743"}, +] + +[package.dependencies] +zipp = ">=0.5" + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +perf = ["ipython"] +testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] + +[[package]] +name = "iniconfig" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.7" +files = [ + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, +] + +[[package]] +name = "installer" +version = "0.7.0" +description = "A library for installing Python wheels." +optional = false +python-versions = ">=3.7" +files = [ + {file = "installer-0.7.0-py3-none-any.whl", hash = "sha256:05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53"}, + {file = "installer-0.7.0.tar.gz", hash = "sha256:a26d3e3116289bb08216e0d0f7d925fcef0b0194eedfa0c944bcaaa106c4b631"}, +] + +[[package]] +name = "isort" +version = "5.12.0" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.12.0-py3-none-any.whl", hash = "sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6"}, + {file = "isort-5.12.0.tar.gz", hash = "sha256:8bef7dde241278824a6d83f44a544709b065191b95b6e50894bdc722fcba0504"}, +] + +[package.extras] +colors = ["colorama (>=0.4.3)"] +pipfile-deprecated-finder = ["pip-shims (>=0.5.2)", "pipreqs", "requirementslib"] +plugins = ["setuptools"] +requirements-deprecated-finder = ["pip-api", "pipreqs"] + +[[package]] +name = "jaraco-classes" +version = "3.3.0" +description = "Utility functions for Python class constructs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "jaraco.classes-3.3.0-py3-none-any.whl", hash = "sha256:10afa92b6743f25c0cf5f37c6bb6e18e2c5bb84a16527ccfc0040ea377e7aaeb"}, + {file = "jaraco.classes-3.3.0.tar.gz", hash = "sha256:c063dd08e89217cee02c8d5e5ec560f2c8ce6cdc2fcdc2e68f7b2e5547ed3621"}, +] + +[package.dependencies] +more-itertools = "*" + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-ruff"] + +[[package]] +name = "jeepney" +version = "0.8.0" +description = "Low-level, pure Python DBus protocol wrapper." +optional = false +python-versions = ">=3.7" +files = [ + {file = "jeepney-0.8.0-py3-none-any.whl", hash = "sha256:c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755"}, + {file = "jeepney-0.8.0.tar.gz", hash = "sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806"}, +] + +[package.extras] +test = ["async-timeout", "pytest", "pytest-asyncio (>=0.17)", "pytest-trio", "testpath", "trio"] +trio = ["async_generator", "trio"] + +[[package]] +name = "jinja2" +version = "3.1.2" +description = "A very fast and expressive template engine." +optional = false +python-versions = ">=3.7" +files = [ + {file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"}, + {file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"}, +] + +[package.dependencies] +MarkupSafe = ">=2.0" + +[package.extras] +i18n = ["Babel (>=2.7)"] + +[[package]] +name = "jsonschema" +version = "4.17.3" +description = "An implementation of JSON Schema validation for Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "jsonschema-4.17.3-py3-none-any.whl", hash = "sha256:a870ad254da1a8ca84b6a2905cac29d265f805acc57af304784962a2aa6508f6"}, + {file = "jsonschema-4.17.3.tar.gz", hash = "sha256:0f864437ab8b6076ba6707453ef8f98a6a0d512a80e93f8abdb676f737ecb60d"}, +] + +[package.dependencies] +attrs = ">=17.4.0" +pyrsistent = ">=0.14.0,<0.17.0 || >0.17.0,<0.17.1 || >0.17.1,<0.17.2 || >0.17.2" + +[package.extras] +format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] +format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=1.11)"] + +[[package]] +name = "keyring" +version = "24.2.0" +description = "Store and access your passwords safely." +optional = false +python-versions = ">=3.8" +files = [ + {file = "keyring-24.2.0-py3-none-any.whl", hash = "sha256:4901caaf597bfd3bbd78c9a0c7c4c29fcd8310dab2cffefe749e916b6527acd6"}, + {file = "keyring-24.2.0.tar.gz", hash = "sha256:ca0746a19ec421219f4d713f848fa297a661a8a8c1504867e55bfb5e09091509"}, +] + +[package.dependencies] +importlib-metadata = {version = ">=4.11.4", markers = "python_version < \"3.12\""} +"jaraco.classes" = "*" +jeepney = {version = ">=0.4.2", markers = "sys_platform == \"linux\""} +pywin32-ctypes = {version = ">=0.2.0", markers = "sys_platform == \"win32\""} +SecretStorage = {version = ">=3.2", markers = "sys_platform == \"linux\""} + +[package.extras] +completion = ["shtab"] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-ruff"] + +[[package]] +name = "macholib" +version = "1.16.2" +description = "Mach-O header analysis and editing" +optional = false +python-versions = "*" +files = [ + {file = "macholib-1.16.2-py2.py3-none-any.whl", hash = "sha256:44c40f2cd7d6726af8fa6fe22549178d3a4dfecc35a9cd15ea916d9c83a688e0"}, + {file = "macholib-1.16.2.tar.gz", hash = "sha256:557bbfa1bb255c20e9abafe7ed6cd8046b48d9525db2f9b77d3122a63a2a8bf8"}, +] + +[package.dependencies] +altgraph = ">=0.17" + +[[package]] +name = "markupsafe" +version = "2.1.3" +description = "Safely add untrusted strings to HTML/XML markup." +optional = false +python-versions = ">=3.7" +files = [ + {file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cd0f502fe016460680cd20aaa5a76d241d6f35a1c3350c474bac1273803893fa"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68e78619a61ecf91e76aa3e6e8e33fc4894a2bebe93410754bd28fce0a8a4f9f"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c1a9bcdadc6c28eecee2c119465aebff8f7a584dd719facdd9e825ec61ab52"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:525808b8019e36eb524b8c68acdd63a37e75714eac50e988180b169d64480a00"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:962f82a3086483f5e5f64dbad880d31038b698494799b097bc59c2edf392fce6"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:aa7bd130efab1c280bed0f45501b7c8795f9fdbeb02e965371bbef3523627779"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c9c804664ebe8f83a211cace637506669e7890fec1b4195b505c214e50dd4eb7"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-win32.whl", hash = "sha256:10bbfe99883db80bdbaff2dcf681dfc6533a614f700da1287707e8a5d78a8431"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-win_amd64.whl", hash = "sha256:1577735524cdad32f9f694208aa75e422adba74f1baee7551620e43a3141f559"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ad9e82fb8f09ade1c3e1b996a6337afac2b8b9e365f926f5a61aacc71adc5b3c"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3c0fae6c3be832a0a0473ac912810b2877c8cb9d76ca48de1ed31e1c68386575"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b076b6226fb84157e3f7c971a47ff3a679d837cf338547532ab866c57930dbee"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfce63a9e7834b12b87c64d6b155fdd9b3b96191b6bd334bf37db7ff1fe457f2"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:338ae27d6b8745585f87218a3f23f1512dbf52c26c28e322dbe54bcede54ccb9"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e4dd52d80b8c83fdce44e12478ad2e85c64ea965e75d66dbeafb0a3e77308fcc"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:df0be2b576a7abbf737b1575f048c23fb1d769f267ec4358296f31c2479db8f9"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aa57bd9cf8ae831a362185ee444e15a93ecb2e344c8e52e4d721ea3ab6ef1823"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47d4f1c5f80fc62fdd7777d0d40a2e9dda0a05883ab11374334f6c4de38adffd"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f67c7038d560d92149c060157d623c542173016c4babc0c1913cca0564b9939"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9aad3c1755095ce347e26488214ef77e0485a3c34a50c5a5e2471dff60b9dd9c"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:14ff806850827afd6b07a5f32bd917fb7f45b046ba40c57abdb636674a8b559c"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8f9293864fe09b8149f0cc42ce56e3f0e54de883a9de90cd427f191c346eb2e1"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-win32.whl", hash = "sha256:715d3562f79d540f251b99ebd6d8baa547118974341db04f5ad06d5ea3eb8007"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-win_amd64.whl", hash = "sha256:1b8dd8c3fd14349433c79fa8abeb573a55fc0fdd769133baac1f5e07abf54aeb"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca379055a47383d02a5400cb0d110cef0a776fc644cda797db0c5696cfd7e18e"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:b7ff0f54cb4ff66dd38bebd335a38e2c22c41a8ee45aa608efc890ac3e3931bc"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c011a4149cfbcf9f03994ec2edffcb8b1dc2d2aede7ca243746df97a5d41ce48"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:56d9f2ecac662ca1611d183feb03a3fa4406469dafe241673d521dd5ae92a155"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-win32.whl", hash = "sha256:8758846a7e80910096950b67071243da3e5a20ed2546e6392603c096778d48e0"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-win_amd64.whl", hash = "sha256:787003c0ddb00500e49a10f2844fac87aa6ce977b90b0feaaf9de23c22508b24"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:2ef12179d3a291be237280175b542c07a36e7f60718296278d8593d21ca937d4"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2c1b19b3aaacc6e57b7e25710ff571c24d6c3613a45e905b1fde04d691b98ee0"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8afafd99945ead6e075b973fefa56379c5b5c53fd8937dad92c662da5d8fd5ee"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c41976a29d078bb235fea9b2ecd3da465df42a562910f9022f1a03107bd02be"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d080e0a5eb2529460b30190fcfcc4199bd7f827663f858a226a81bc27beaa97e"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:69c0f17e9f5a7afdf2cc9fb2d1ce6aabdb3bafb7f38017c0b77862bcec2bbad8"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:504b320cd4b7eff6f968eddf81127112db685e81f7e36e75f9f84f0df46041c3"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:42de32b22b6b804f42c5d98be4f7e5e977ecdd9ee9b660fda1a3edf03b11792d"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-win32.whl", hash = "sha256:ceb01949af7121f9fc39f7d27f91be8546f3fb112c608bc4029aef0bab86a2a5"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-win_amd64.whl", hash = "sha256:1b40069d487e7edb2676d3fbdb2b0829ffa2cd63a2ec26c4938b2d34391b4ecc"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8023faf4e01efadfa183e863fefde0046de576c6f14659e8782065bcece22198"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6b2b56950d93e41f33b4223ead100ea0fe11f8e6ee5f641eb753ce4b77a7042b"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9dcdfd0eaf283af041973bff14a2e143b8bd64e069f4c383416ecd79a81aab58"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:282c2cb35b5b673bbcadb33a585408104df04f14b2d9b01d4c345a3b92861c2c"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ab4a0df41e7c16a1392727727e7998a467472d0ad65f3ad5e6e765015df08636"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7ef3cb2ebbf91e330e3bb937efada0edd9003683db6b57bb108c4001f37a02ea"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-win32.whl", hash = "sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-win_amd64.whl", hash = "sha256:3fd4abcb888d15a94f32b75d8fd18ee162ca0c064f35b11134be77050296d6ba"}, + {file = "MarkupSafe-2.1.3.tar.gz", hash = "sha256:af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad"}, +] + +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + +[[package]] +name = "more-itertools" +version = "10.1.0" +description = "More routines for operating on iterables, beyond itertools" +optional = false +python-versions = ">=3.8" +files = [ + {file = "more-itertools-10.1.0.tar.gz", hash = "sha256:626c369fa0eb37bac0291bce8259b332fd59ac792fa5497b59837309cd5b114a"}, + {file = "more_itertools-10.1.0-py3-none-any.whl", hash = "sha256:64e0735fcfdc6f3464ea133afe8ea4483b1c5fe3a3d69852e6503b43a0b222e6"}, +] + +[[package]] +name = "msgpack" +version = "1.0.5" +description = "MessagePack serializer" +optional = false +python-versions = "*" +files = [ + {file = "msgpack-1.0.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:525228efd79bb831cf6830a732e2e80bc1b05436b086d4264814b4b2955b2fa9"}, + {file = "msgpack-1.0.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:4f8d8b3bf1ff2672567d6b5c725a1b347fe838b912772aa8ae2bf70338d5a198"}, + {file = "msgpack-1.0.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cdc793c50be3f01106245a61b739328f7dccc2c648b501e237f0699fe1395b81"}, + {file = "msgpack-1.0.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5cb47c21a8a65b165ce29f2bec852790cbc04936f502966768e4aae9fa763cb7"}, + {file = "msgpack-1.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e42b9594cc3bf4d838d67d6ed62b9e59e201862a25e9a157019e171fbe672dd3"}, + {file = "msgpack-1.0.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:55b56a24893105dc52c1253649b60f475f36b3aa0fc66115bffafb624d7cb30b"}, + {file = "msgpack-1.0.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:1967f6129fc50a43bfe0951c35acbb729be89a55d849fab7686004da85103f1c"}, + {file = "msgpack-1.0.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:20a97bf595a232c3ee6d57ddaadd5453d174a52594bf9c21d10407e2a2d9b3bd"}, + {file = "msgpack-1.0.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d25dd59bbbbb996eacf7be6b4ad082ed7eacc4e8f3d2df1ba43822da9bfa122a"}, + {file = "msgpack-1.0.5-cp310-cp310-win32.whl", hash = "sha256:382b2c77589331f2cb80b67cc058c00f225e19827dbc818d700f61513ab47bea"}, + {file = "msgpack-1.0.5-cp310-cp310-win_amd64.whl", hash = "sha256:4867aa2df9e2a5fa5f76d7d5565d25ec76e84c106b55509e78c1ede0f152659a"}, + {file = "msgpack-1.0.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9f5ae84c5c8a857ec44dc180a8b0cc08238e021f57abdf51a8182e915e6299f0"}, + {file = "msgpack-1.0.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9e6ca5d5699bcd89ae605c150aee83b5321f2115695e741b99618f4856c50898"}, + {file = "msgpack-1.0.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5494ea30d517a3576749cad32fa27f7585c65f5f38309c88c6d137877fa28a5a"}, + {file = "msgpack-1.0.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ab2f3331cb1b54165976a9d976cb251a83183631c88076613c6c780f0d6e45a"}, + {file = "msgpack-1.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:28592e20bbb1620848256ebc105fc420436af59515793ed27d5c77a217477705"}, + {file = "msgpack-1.0.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fe5c63197c55bce6385d9aee16c4d0641684628f63ace85f73571e65ad1c1e8d"}, + {file = "msgpack-1.0.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ed40e926fa2f297e8a653c954b732f125ef97bdd4c889f243182299de27e2aa9"}, + {file = "msgpack-1.0.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:b2de4c1c0538dcb7010902a2b97f4e00fc4ddf2c8cda9749af0e594d3b7fa3d7"}, + {file = "msgpack-1.0.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bf22a83f973b50f9d38e55c6aade04c41ddda19b00c4ebc558930d78eecc64ed"}, + {file = "msgpack-1.0.5-cp311-cp311-win32.whl", hash = "sha256:c396e2cc213d12ce017b686e0f53497f94f8ba2b24799c25d913d46c08ec422c"}, + {file = "msgpack-1.0.5-cp311-cp311-win_amd64.whl", hash = "sha256:6c4c68d87497f66f96d50142a2b73b97972130d93677ce930718f68828b382e2"}, + {file = "msgpack-1.0.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a2b031c2e9b9af485d5e3c4520f4220d74f4d222a5b8dc8c1a3ab9448ca79c57"}, + {file = "msgpack-1.0.5-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f837b93669ce4336e24d08286c38761132bc7ab29782727f8557e1eb21b2080"}, + {file = "msgpack-1.0.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1d46dfe3832660f53b13b925d4e0fa1432b00f5f7210eb3ad3bb9a13c6204a6"}, + {file = "msgpack-1.0.5-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:366c9a7b9057e1547f4ad51d8facad8b406bab69c7d72c0eb6f529cf76d4b85f"}, + {file = "msgpack-1.0.5-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:4c075728a1095efd0634a7dccb06204919a2f67d1893b6aa8e00497258bf926c"}, + {file = "msgpack-1.0.5-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:f933bbda5a3ee63b8834179096923b094b76f0c7a73c1cfe8f07ad608c58844b"}, + {file = "msgpack-1.0.5-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:36961b0568c36027c76e2ae3ca1132e35123dcec0706c4b7992683cc26c1320c"}, + {file = "msgpack-1.0.5-cp36-cp36m-win32.whl", hash = "sha256:b5ef2f015b95f912c2fcab19c36814963b5463f1fb9049846994b007962743e9"}, + {file = "msgpack-1.0.5-cp36-cp36m-win_amd64.whl", hash = "sha256:288e32b47e67f7b171f86b030e527e302c91bd3f40fd9033483f2cacc37f327a"}, + {file = "msgpack-1.0.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:137850656634abddfb88236008339fdaba3178f4751b28f270d2ebe77a563b6c"}, + {file = "msgpack-1.0.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c05a4a96585525916b109bb85f8cb6511db1c6f5b9d9cbcbc940dc6b4be944b"}, + {file = "msgpack-1.0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56a62ec00b636583e5cb6ad313bbed36bb7ead5fa3a3e38938503142c72cba4f"}, + {file = "msgpack-1.0.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ef8108f8dedf204bb7b42994abf93882da1159728a2d4c5e82012edd92c9da9f"}, + {file = "msgpack-1.0.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1835c84d65f46900920b3708f5ba829fb19b1096c1800ad60bae8418652a951d"}, + {file = "msgpack-1.0.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:e57916ef1bd0fee4f21c4600e9d1da352d8816b52a599c46460e93a6e9f17086"}, + {file = "msgpack-1.0.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:17358523b85973e5f242ad74aa4712b7ee560715562554aa2134d96e7aa4cbbf"}, + {file = "msgpack-1.0.5-cp37-cp37m-win32.whl", hash = "sha256:cb5aaa8c17760909ec6cb15e744c3ebc2ca8918e727216e79607b7bbce9c8f77"}, + {file = "msgpack-1.0.5-cp37-cp37m-win_amd64.whl", hash = "sha256:ab31e908d8424d55601ad7075e471b7d0140d4d3dd3272daf39c5c19d936bd82"}, + {file = "msgpack-1.0.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:b72d0698f86e8d9ddf9442bdedec15b71df3598199ba33322d9711a19f08145c"}, + {file = "msgpack-1.0.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:379026812e49258016dd84ad79ac8446922234d498058ae1d415f04b522d5b2d"}, + {file = "msgpack-1.0.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:332360ff25469c346a1c5e47cbe2a725517919892eda5cfaffe6046656f0b7bb"}, + {file = "msgpack-1.0.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:476a8fe8fae289fdf273d6d2a6cb6e35b5a58541693e8f9f019bfe990a51e4ba"}, + {file = "msgpack-1.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9985b214f33311df47e274eb788a5893a761d025e2b92c723ba4c63936b69b1"}, + {file = "msgpack-1.0.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:48296af57cdb1d885843afd73c4656be5c76c0c6328db3440c9601a98f303d87"}, + {file = "msgpack-1.0.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:addab7e2e1fcc04bd08e4eb631c2a90960c340e40dfc4a5e24d2ff0d5a3b3edb"}, + {file = "msgpack-1.0.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:916723458c25dfb77ff07f4c66aed34e47503b2eb3188b3adbec8d8aa6e00f48"}, + {file = "msgpack-1.0.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:821c7e677cc6acf0fd3f7ac664c98803827ae6de594a9f99563e48c5a2f27eb0"}, + {file = "msgpack-1.0.5-cp38-cp38-win32.whl", hash = "sha256:1c0f7c47f0087ffda62961d425e4407961a7ffd2aa004c81b9c07d9269512f6e"}, + {file = "msgpack-1.0.5-cp38-cp38-win_amd64.whl", hash = "sha256:bae7de2026cbfe3782c8b78b0db9cbfc5455e079f1937cb0ab8d133496ac55e1"}, + {file = "msgpack-1.0.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:20c784e66b613c7f16f632e7b5e8a1651aa5702463d61394671ba07b2fc9e025"}, + {file = "msgpack-1.0.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:266fa4202c0eb94d26822d9bfd7af25d1e2c088927fe8de9033d929dd5ba24c5"}, + {file = "msgpack-1.0.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:18334484eafc2b1aa47a6d42427da7fa8f2ab3d60b674120bce7a895a0a85bdd"}, + {file = "msgpack-1.0.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:57e1f3528bd95cc44684beda696f74d3aaa8a5e58c816214b9046512240ef437"}, + {file = "msgpack-1.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:586d0d636f9a628ddc6a17bfd45aa5b5efaf1606d2b60fa5d87b8986326e933f"}, + {file = "msgpack-1.0.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a740fa0e4087a734455f0fc3abf5e746004c9da72fbd541e9b113013c8dc3282"}, + {file = "msgpack-1.0.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:3055b0455e45810820db1f29d900bf39466df96ddca11dfa6d074fa47054376d"}, + {file = "msgpack-1.0.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:a61215eac016f391129a013c9e46f3ab308db5f5ec9f25811e811f96962599a8"}, + {file = "msgpack-1.0.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:362d9655cd369b08fda06b6657a303eb7172d5279997abe094512e919cf74b11"}, + {file = "msgpack-1.0.5-cp39-cp39-win32.whl", hash = "sha256:ac9dd47af78cae935901a9a500104e2dea2e253207c924cc95de149606dc43cc"}, + {file = "msgpack-1.0.5-cp39-cp39-win_amd64.whl", hash = "sha256:06f5174b5f8ed0ed919da0e62cbd4ffde676a374aba4020034da05fab67b9164"}, + {file = "msgpack-1.0.5.tar.gz", hash = "sha256:c075544284eadc5cddc70f4757331d99dcbc16b2bbd4849d15f8aae4cf36d31c"}, +] + +[[package]] +name = "mypy" +version = "1.6.0" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "mypy-1.6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:091f53ff88cb093dcc33c29eee522c087a438df65eb92acd371161c1f4380ff0"}, + {file = "mypy-1.6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:eb7ff4007865833c470a601498ba30462b7374342580e2346bf7884557e40531"}, + {file = "mypy-1.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49499cf1e464f533fc45be54d20a6351a312f96ae7892d8e9f1708140e27ce41"}, + {file = "mypy-1.6.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4c192445899c69f07874dabda7e931b0cc811ea055bf82c1ababf358b9b2a72c"}, + {file = "mypy-1.6.0-cp310-cp310-win_amd64.whl", hash = "sha256:3df87094028e52766b0a59a3e46481bb98b27986ed6ded6a6cc35ecc75bb9182"}, + {file = "mypy-1.6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3c8835a07b8442da900db47ccfda76c92c69c3a575872a5b764332c4bacb5a0a"}, + {file = "mypy-1.6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:24f3de8b9e7021cd794ad9dfbf2e9fe3f069ff5e28cb57af6f873ffec1cb0425"}, + {file = "mypy-1.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:856bad61ebc7d21dbc019b719e98303dc6256cec6dcc9ebb0b214b81d6901bd8"}, + {file = "mypy-1.6.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:89513ddfda06b5c8ebd64f026d20a61ef264e89125dc82633f3c34eeb50e7d60"}, + {file = "mypy-1.6.0-cp311-cp311-win_amd64.whl", hash = "sha256:9f8464ed410ada641c29f5de3e6716cbdd4f460b31cf755b2af52f2d5ea79ead"}, + {file = "mypy-1.6.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:971104bcb180e4fed0d7bd85504c9036346ab44b7416c75dd93b5c8c6bb7e28f"}, + {file = "mypy-1.6.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ab98b8f6fdf669711f3abe83a745f67f50e3cbaea3998b90e8608d2b459fd566"}, + {file = "mypy-1.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1a69db3018b87b3e6e9dd28970f983ea6c933800c9edf8c503c3135b3274d5ad"}, + {file = "mypy-1.6.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:dccd850a2e3863891871c9e16c54c742dba5470f5120ffed8152956e9e0a5e13"}, + {file = "mypy-1.6.0-cp312-cp312-win_amd64.whl", hash = "sha256:f8598307150b5722854f035d2e70a1ad9cc3c72d392c34fffd8c66d888c90f17"}, + {file = "mypy-1.6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:fea451a3125bf0bfe716e5d7ad4b92033c471e4b5b3e154c67525539d14dc15a"}, + {file = "mypy-1.6.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e28d7b221898c401494f3b77db3bac78a03ad0a0fff29a950317d87885c655d2"}, + {file = "mypy-1.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4b7a99275a61aa22256bab5839c35fe8a6887781862471df82afb4b445daae6"}, + {file = "mypy-1.6.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:7469545380dddce5719e3656b80bdfbb217cfe8dbb1438532d6abc754b828fed"}, + {file = "mypy-1.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:7807a2a61e636af9ca247ba8494031fb060a0a744b9fee7de3a54bed8a753323"}, + {file = "mypy-1.6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d2dad072e01764823d4b2f06bc7365bb1d4b6c2f38c4d42fade3c8d45b0b4b67"}, + {file = "mypy-1.6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b19006055dde8a5425baa5f3b57a19fa79df621606540493e5e893500148c72f"}, + {file = "mypy-1.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31eba8a7a71f0071f55227a8057468b8d2eb5bf578c8502c7f01abaec8141b2f"}, + {file = "mypy-1.6.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8e0db37ac4ebb2fee7702767dfc1b773c7365731c22787cb99f507285014fcaf"}, + {file = "mypy-1.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:c69051274762cccd13498b568ed2430f8d22baa4b179911ad0c1577d336ed849"}, + {file = "mypy-1.6.0-py3-none-any.whl", hash = "sha256:9e1589ca150a51d9d00bb839bfeca2f7a04f32cd62fad87a847bc0818e15d7dc"}, + {file = "mypy-1.6.0.tar.gz", hash = "sha256:4f3d27537abde1be6d5f2c96c29a454da333a2a271ae7d5bc7110e6d4b7beb3f"}, +] + +[package.dependencies] +mypy-extensions = ">=1.0.0" +typing-extensions = ">=4.1.0" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +install-types = ["pip"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.5" +files = [ + {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, + {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, +] + +[[package]] +name = "nodeenv" +version = "1.8.0" +description = "Node.js virtual environment builder" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" +files = [ + {file = "nodeenv-1.8.0-py2.py3-none-any.whl", hash = "sha256:df865724bb3c3adc86b3876fa209771517b0cfe596beff01a92700e0e8be4cec"}, + {file = "nodeenv-1.8.0.tar.gz", hash = "sha256:d51e0c37e64fbf47d017feac3145cdbb58836d7eee8c6f6d3b6880c5456227d2"}, +] + +[package.dependencies] +setuptools = "*" + +[[package]] +name = "numpy" +version = "1.25.2" +description = "Fundamental package for array computing in Python" +optional = false +python-versions = ">=3.9" +files = [ + {file = "numpy-1.25.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:db3ccc4e37a6873045580d413fe79b68e47a681af8db2e046f1dacfa11f86eb3"}, + {file = "numpy-1.25.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:90319e4f002795ccfc9050110bbbaa16c944b1c37c0baeea43c5fb881693ae1f"}, + {file = "numpy-1.25.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dfe4a913e29b418d096e696ddd422d8a5d13ffba4ea91f9f60440a3b759b0187"}, + {file = "numpy-1.25.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f08f2e037bba04e707eebf4bc934f1972a315c883a9e0ebfa8a7756eabf9e357"}, + {file = "numpy-1.25.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bec1e7213c7cb00d67093247f8c4db156fd03075f49876957dca4711306d39c9"}, + {file = "numpy-1.25.2-cp310-cp310-win32.whl", hash = "sha256:7dc869c0c75988e1c693d0e2d5b26034644399dd929bc049db55395b1379e044"}, + {file = "numpy-1.25.2-cp310-cp310-win_amd64.whl", hash = "sha256:834b386f2b8210dca38c71a6e0f4fd6922f7d3fcff935dbe3a570945acb1b545"}, + {file = "numpy-1.25.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c5462d19336db4560041517dbb7759c21d181a67cb01b36ca109b2ae37d32418"}, + {file = "numpy-1.25.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c5652ea24d33585ea39eb6a6a15dac87a1206a692719ff45d53c5282e66d4a8f"}, + {file = "numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2"}, + {file = "numpy-1.25.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:60e7f0f7f6d0eee8364b9a6304c2845b9c491ac706048c7e8cf47b83123b8dbf"}, + {file = "numpy-1.25.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bb33d5a1cf360304754913a350edda36d5b8c5331a8237268c48f91253c3a364"}, + {file = "numpy-1.25.2-cp311-cp311-win32.whl", hash = "sha256:5883c06bb92f2e6c8181df7b39971a5fb436288db58b5a1c3967702d4278691d"}, + {file = "numpy-1.25.2-cp311-cp311-win_amd64.whl", hash = "sha256:5c97325a0ba6f9d041feb9390924614b60b99209a71a69c876f71052521d42a4"}, + {file = "numpy-1.25.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b79e513d7aac42ae918db3ad1341a015488530d0bb2a6abcbdd10a3a829ccfd3"}, + {file = "numpy-1.25.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:eb942bfb6f84df5ce05dbf4b46673ffed0d3da59f13635ea9b926af3deb76926"}, + {file = "numpy-1.25.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e0746410e73384e70d286f93abf2520035250aad8c5714240b0492a7302fdca"}, + {file = "numpy-1.25.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7806500e4f5bdd04095e849265e55de20d8cc4b661b038957354327f6d9b295"}, + {file = "numpy-1.25.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8b77775f4b7df768967a7c8b3567e309f617dd5e99aeb886fa14dc1a0791141f"}, + {file = "numpy-1.25.2-cp39-cp39-win32.whl", hash = "sha256:2792d23d62ec51e50ce4d4b7d73de8f67a2fd3ea710dcbc8563a51a03fb07b01"}, + {file = "numpy-1.25.2-cp39-cp39-win_amd64.whl", hash = "sha256:76b4115d42a7dfc5d485d358728cdd8719be33cc5ec6ec08632a5d6fca2ed380"}, + {file = "numpy-1.25.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:1a1329e26f46230bf77b02cc19e900db9b52f398d6722ca853349a782d4cff55"}, + {file = "numpy-1.25.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c3abc71e8b6edba80a01a52e66d83c5d14433cbcd26a40c329ec7ed09f37901"}, + {file = "numpy-1.25.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:1b9735c27cea5d995496f46a8b1cd7b408b3f34b6d50459d9ac8fe3a20cc17bf"}, + {file = "numpy-1.25.2.tar.gz", hash = "sha256:fd608e19c8d7c55021dffd43bfe5492fab8cc105cc8986f813f8c3c048b38760"}, +] + +[[package]] +name = "packaging" +version = "23.1" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.7" +files = [ + {file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"}, + {file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"}, +] + +[[package]] +name = "pathspec" +version = "0.11.2" +description = "Utility library for gitignore style pattern matching of file paths." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pathspec-0.11.2-py3-none-any.whl", hash = "sha256:1d6ed233af05e679efb96b1851550ea95bbb64b7c490b0f5aa52996c11e92a20"}, + {file = "pathspec-0.11.2.tar.gz", hash = "sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3"}, +] + +[[package]] +name = "pefile" +version = "2023.2.7" +description = "Python PE parsing module" +optional = false +python-versions = ">=3.6.0" +files = [ + {file = "pefile-2023.2.7-py3-none-any.whl", hash = "sha256:da185cd2af68c08a6cd4481f7325ed600a88f6a813bad9dea07ab3ef73d8d8d6"}, + {file = "pefile-2023.2.7.tar.gz", hash = "sha256:82e6114004b3d6911c77c3953e3838654b04511b8b66e8583db70c65998017dc"}, +] + +[[package]] +name = "pexpect" +version = "4.8.0" +description = "Pexpect allows easy control of interactive console applications." +optional = false +python-versions = "*" +files = [ + {file = "pexpect-4.8.0-py2.py3-none-any.whl", hash = "sha256:0b48a55dcb3c05f3329815901ea4fc1537514d6ba867a152b581d69ae3710937"}, + {file = "pexpect-4.8.0.tar.gz", hash = "sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c"}, +] + +[package.dependencies] +ptyprocess = ">=0.5" + +[[package]] +name = "pip-licenses" +version = "4.3.2" +description = "Dump the software license list of Python packages installed with pip." +optional = false +python-versions = "~=3.8" +files = [ + {file = "pip-licenses-4.3.2.tar.gz", hash = "sha256:27ce33be185a009f3128ea59fe4c1490f4f4da5eb53ed951b87ef3c621b583f9"}, + {file = "pip_licenses-4.3.2-py3-none-any.whl", hash = "sha256:3fede933c47e1f4bc5e91d7cfd1d9b9d4e37a3c03b2875352b12bbad41294cd6"}, +] + +[package.dependencies] +prettytable = ">=2.3.0" + +[package.extras] +test = ["docutils", "mypy", "pytest-cov", "pytest-pycodestyle", "pytest-runner"] + +[[package]] +name = "pkginfo" +version = "1.9.6" +description = "Query metadata from sdists / bdists / installed packages." +optional = false +python-versions = ">=3.6" +files = [ + {file = "pkginfo-1.9.6-py3-none-any.whl", hash = "sha256:4b7a555a6d5a22169fcc9cf7bfd78d296b0361adad412a346c1226849af5e546"}, + {file = "pkginfo-1.9.6.tar.gz", hash = "sha256:8fd5896e8718a4372f0ea9cc9d96f6417c9b986e23a4d116dda26b62cc29d046"}, +] + +[package.extras] +testing = ["pytest", "pytest-cov"] + +[[package]] +name = "platformdirs" +version = "3.10.0" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +optional = false +python-versions = ">=3.7" +files = [ + {file = "platformdirs-3.10.0-py3-none-any.whl", hash = "sha256:d7c24979f292f916dc9cbf8648319032f551ea8c49a4c9bf2fb556a02070ec1d"}, + {file = "platformdirs-3.10.0.tar.gz", hash = "sha256:b45696dab2d7cc691a3226759c0d3b00c47c8b6e293d96f6436f733303f77f6d"}, +] + +[package.extras] +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.1)", "sphinx-autodoc-typehints (>=1.24)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)"] + +[[package]] +name = "pluggy" +version = "1.2.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"}, + {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "poetry" +version = "1.6.1" +description = "Python dependency management and packaging made easy." +optional = false +python-versions = ">=3.8,<4.0" +files = [ + {file = "poetry-1.6.1-py3-none-any.whl", hash = "sha256:9b4cb6079c08cc0d91e8cba18a6bd4d4f7d7830263a7fb18ecb3faa77937c988"}, + {file = "poetry-1.6.1.tar.gz", hash = "sha256:0ab9b1a592731cc8b252b8d6aaeea19c72cc0a109d7468b829ad57e6c48039d2"}, +] + +[package.dependencies] +build = ">=0.10.0,<0.11.0" +cachecontrol = {version = ">=0.13.0,<0.14.0", extras = ["filecache"]} +cleo = ">=2.0.0,<3.0.0" +crashtest = ">=0.4.1,<0.5.0" +dulwich = ">=0.21.2,<0.22.0" +installer = ">=0.7.0,<0.8.0" +jsonschema = ">=4.10.0,<4.18.0" +keyring = ">=24.0.0,<25.0.0" +packaging = ">=20.4" +pexpect = ">=4.7.0,<5.0.0" +pkginfo = ">=1.9.4,<2.0.0" +platformdirs = ">=3.0.0,<4.0.0" +poetry-core = "1.7.0" +poetry-plugin-export = ">=1.5.0,<2.0.0" +pyproject-hooks = ">=1.0.0,<2.0.0" +requests = ">=2.26,<3.0" +requests-toolbelt = ">=0.9.1,<2" +shellingham = ">=1.5,<2.0" +tomlkit = ">=0.11.4,<1.0.0" +trove-classifiers = ">=2022.5.19" +virtualenv = ">=20.22.0,<21.0.0" +xattr = {version = ">=0.10.0,<0.11.0", markers = "sys_platform == \"darwin\""} + +[[package]] +name = "poetry-core" +version = "1.7.0" +description = "Poetry PEP 517 Build Backend" +optional = false +python-versions = ">=3.8,<4.0" +files = [ + {file = "poetry_core-1.7.0-py3-none-any.whl", hash = "sha256:38e174cdb00a84ee4a1cab66a378b435747f72414f5573bc18cfc3850a94df38"}, + {file = "poetry_core-1.7.0.tar.gz", hash = "sha256:8f679b83bd9c820082637beca1204124d5d2a786e4818da47ec8acefd0353b74"}, +] + +[[package]] +name = "poetry-plugin-export" +version = "1.5.0" +description = "Poetry plugin to export the dependencies to various formats" +optional = false +python-versions = ">=3.8,<4.0" +files = [ + {file = "poetry_plugin_export-1.5.0-py3-none-any.whl", hash = "sha256:cd8267597970375ca29868daec5e7718bad500c7584663af3eeb0ed16f24e2bd"}, + {file = "poetry_plugin_export-1.5.0.tar.gz", hash = "sha256:ecc8738da0c81c3758e36b4e72e04ae59648a547492af2ffe6245af3594bb00f"}, +] + +[package.dependencies] +poetry = ">=1.5.0,<2.0.0" +poetry-core = ">=1.6.0,<2.0.0" + +[[package]] +name = "pre-commit" +version = "2.21.0" +description = "A framework for managing and maintaining multi-language pre-commit hooks." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pre_commit-2.21.0-py2.py3-none-any.whl", hash = "sha256:e2f91727039fc39a92f58a588a25b87f936de6567eed4f0e673e0507edc75bad"}, + {file = "pre_commit-2.21.0.tar.gz", hash = "sha256:31ef31af7e474a8d8995027fefdfcf509b5c913ff31f2015b4ec4beb26a6f658"}, +] + +[package.dependencies] +cfgv = ">=2.0.0" +identify = ">=1.0.0" +nodeenv = ">=0.11.1" +pyyaml = ">=5.1" +virtualenv = ">=20.10.0" + +[[package]] +name = "prettytable" +version = "3.8.0" +description = "A simple Python library for easily displaying tabular data in a visually appealing ASCII table format" +optional = false +python-versions = ">=3.8" +files = [ + {file = "prettytable-3.8.0-py3-none-any.whl", hash = "sha256:03481bca25ae0c28958c8cd6ac5165c159ce89f7ccde04d5c899b24b68bb13b7"}, + {file = "prettytable-3.8.0.tar.gz", hash = "sha256:031eae6a9102017e8c7c7906460d150b7ed78b20fd1d8c8be4edaf88556c07ce"}, +] + +[package.dependencies] +wcwidth = "*" + +[package.extras] +tests = ["pytest", "pytest-cov", "pytest-lazy-fixture"] + +[[package]] +name = "ptyprocess" +version = "0.7.0" +description = "Run a subprocess in a pseudo terminal" +optional = false +python-versions = "*" +files = [ + {file = "ptyprocess-0.7.0-py2.py3-none-any.whl", hash = "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35"}, + {file = "ptyprocess-0.7.0.tar.gz", hash = "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220"}, +] + +[[package]] +name = "py" +version = "1.11.0" +description = "library with cross-python path, ini-parsing, io, code, log facilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, + {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, +] + +[[package]] +name = "pycodestyle" +version = "2.11.0" +description = "Python style guide checker" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycodestyle-2.11.0-py2.py3-none-any.whl", hash = "sha256:5d1013ba8dc7895b548be5afb05740ca82454fd899971563d2ef625d090326f8"}, + {file = "pycodestyle-2.11.0.tar.gz", hash = "sha256:259bcc17857d8a8b3b4a2327324b79e5f020a13c16074670f9c8c8f872ea76d0"}, +] + +[[package]] +name = "pycparser" +version = "2.21" +description = "C parser in Python" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"}, + {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, +] + +[[package]] +name = "pydantic" +version = "1.10.12" +description = "Data validation and settings management using python type hints" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic-1.10.12-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a1fcb59f2f355ec350073af41d927bf83a63b50e640f4dbaa01053a28b7a7718"}, + {file = "pydantic-1.10.12-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b7ccf02d7eb340b216ec33e53a3a629856afe1c6e0ef91d84a4e6f2fb2ca70fe"}, + {file = "pydantic-1.10.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8fb2aa3ab3728d950bcc885a2e9eff6c8fc40bc0b7bb434e555c215491bcf48b"}, + {file = "pydantic-1.10.12-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:771735dc43cf8383959dc9b90aa281f0b6092321ca98677c5fb6125a6f56d58d"}, + {file = "pydantic-1.10.12-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:ca48477862372ac3770969b9d75f1bf66131d386dba79506c46d75e6b48c1e09"}, + {file = "pydantic-1.10.12-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a5e7add47a5b5a40c49b3036d464e3c7802f8ae0d1e66035ea16aa5b7a3923ed"}, + {file = "pydantic-1.10.12-cp310-cp310-win_amd64.whl", hash = "sha256:e4129b528c6baa99a429f97ce733fff478ec955513630e61b49804b6cf9b224a"}, + {file = "pydantic-1.10.12-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b0d191db0f92dfcb1dec210ca244fdae5cbe918c6050b342d619c09d31eea0cc"}, + {file = "pydantic-1.10.12-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:795e34e6cc065f8f498c89b894a3c6da294a936ee71e644e4bd44de048af1405"}, + {file = "pydantic-1.10.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:69328e15cfda2c392da4e713443c7dbffa1505bc9d566e71e55abe14c97ddc62"}, + {file = "pydantic-1.10.12-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2031de0967c279df0d8a1c72b4ffc411ecd06bac607a212892757db7462fc494"}, + {file = "pydantic-1.10.12-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:ba5b2e6fe6ca2b7e013398bc7d7b170e21cce322d266ffcd57cca313e54fb246"}, + {file = "pydantic-1.10.12-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:2a7bac939fa326db1ab741c9d7f44c565a1d1e80908b3797f7f81a4f86bc8d33"}, + {file = "pydantic-1.10.12-cp311-cp311-win_amd64.whl", hash = "sha256:87afda5539d5140cb8ba9e8b8c8865cb5b1463924d38490d73d3ccfd80896b3f"}, + {file = "pydantic-1.10.12-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:549a8e3d81df0a85226963611950b12d2d334f214436a19537b2efed61b7639a"}, + {file = "pydantic-1.10.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:598da88dfa127b666852bef6d0d796573a8cf5009ffd62104094a4fe39599565"}, + {file = "pydantic-1.10.12-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ba5c4a8552bff16c61882db58544116d021d0b31ee7c66958d14cf386a5b5350"}, + {file = "pydantic-1.10.12-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c79e6a11a07da7374f46970410b41d5e266f7f38f6a17a9c4823db80dadf4303"}, + {file = "pydantic-1.10.12-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ab26038b8375581dc832a63c948f261ae0aa21f1d34c1293469f135fa92972a5"}, + {file = "pydantic-1.10.12-cp37-cp37m-win_amd64.whl", hash = "sha256:e0a16d274b588767602b7646fa05af2782576a6cf1022f4ba74cbb4db66f6ca8"}, + {file = "pydantic-1.10.12-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6a9dfa722316f4acf4460afdf5d41d5246a80e249c7ff475c43a3a1e9d75cf62"}, + {file = "pydantic-1.10.12-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a73f489aebd0c2121ed974054cb2759af8a9f747de120acd2c3394cf84176ccb"}, + {file = "pydantic-1.10.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b30bcb8cbfccfcf02acb8f1a261143fab622831d9c0989707e0e659f77a18e0"}, + {file = "pydantic-1.10.12-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2fcfb5296d7877af406ba1547dfde9943b1256d8928732267e2653c26938cd9c"}, + {file = "pydantic-1.10.12-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:2f9a6fab5f82ada41d56b0602606a5506aab165ca54e52bc4545028382ef1c5d"}, + {file = "pydantic-1.10.12-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:dea7adcc33d5d105896401a1f37d56b47d443a2b2605ff8a969a0ed5543f7e33"}, + {file = "pydantic-1.10.12-cp38-cp38-win_amd64.whl", hash = "sha256:1eb2085c13bce1612da8537b2d90f549c8cbb05c67e8f22854e201bde5d98a47"}, + {file = "pydantic-1.10.12-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ef6c96b2baa2100ec91a4b428f80d8f28a3c9e53568219b6c298c1125572ebc6"}, + {file = "pydantic-1.10.12-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6c076be61cd0177a8433c0adcb03475baf4ee91edf5a4e550161ad57fc90f523"}, + {file = "pydantic-1.10.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2d5a58feb9a39f481eda4d5ca220aa8b9d4f21a41274760b9bc66bfd72595b86"}, + {file = "pydantic-1.10.12-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e5f805d2d5d0a41633651a73fa4ecdd0b3d7a49de4ec3fadf062fe16501ddbf1"}, + {file = "pydantic-1.10.12-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:1289c180abd4bd4555bb927c42ee42abc3aee02b0fb2d1223fb7c6e5bef87dbe"}, + {file = "pydantic-1.10.12-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5d1197e462e0364906cbc19681605cb7c036f2475c899b6f296104ad42b9f5fb"}, + {file = "pydantic-1.10.12-cp39-cp39-win_amd64.whl", hash = "sha256:fdbdd1d630195689f325c9ef1a12900524dceb503b00a987663ff4f58669b93d"}, + {file = "pydantic-1.10.12-py3-none-any.whl", hash = "sha256:b749a43aa51e32839c9d71dc67eb1e4221bb04af1033a32e3923d46f9effa942"}, + {file = "pydantic-1.10.12.tar.gz", hash = "sha256:0fe8a415cea8f340e7a9af9c54fc71a649b43e8ca3cc732986116b3cb135d303"}, +] + +[package.dependencies] +typing-extensions = ">=4.2.0" + +[package.extras] +dotenv = ["python-dotenv (>=0.10.4)"] +email = ["email-validator (>=1.0.3)"] + +[[package]] +name = "pyflakes" +version = "3.1.0" +description = "passive checker of Python programs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyflakes-3.1.0-py2.py3-none-any.whl", hash = "sha256:4132f6d49cb4dae6819e5379898f2b8cce3c5f23994194c24b77d5da2e36f774"}, + {file = "pyflakes-3.1.0.tar.gz", hash = "sha256:a0aae034c444db0071aa077972ba4768d40c830d9539fd45bf4cd3f8f6992efc"}, +] + +[[package]] +name = "pyinstaller" +version = "5.13.2" +description = "PyInstaller bundles a Python application and all its dependencies into a single package." +optional = false +python-versions = "<3.13,>=3.7" +files = [ + {file = "pyinstaller-5.13.2-py3-none-macosx_10_13_universal2.whl", hash = "sha256:16cbd66b59a37f4ee59373a003608d15df180a0d9eb1a29ff3bfbfae64b23d0f"}, + {file = "pyinstaller-5.13.2-py3-none-manylinux2014_aarch64.whl", hash = "sha256:8f6dd0e797ae7efdd79226f78f35eb6a4981db16c13325e962a83395c0ec7420"}, + {file = "pyinstaller-5.13.2-py3-none-manylinux2014_i686.whl", hash = "sha256:65133ed89467edb2862036b35d7c5ebd381670412e1e4361215e289c786dd4e6"}, + {file = "pyinstaller-5.13.2-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:7d51734423685ab2a4324ab2981d9781b203dcae42839161a9ee98bfeaabdade"}, + {file = "pyinstaller-5.13.2-py3-none-manylinux2014_s390x.whl", hash = "sha256:2c2fe9c52cb4577a3ac39626b84cf16cf30c2792f785502661286184f162ae0d"}, + {file = "pyinstaller-5.13.2-py3-none-manylinux2014_x86_64.whl", hash = "sha256:c63ef6133eefe36c4b2f4daf4cfea3d6412ece2ca218f77aaf967e52a95ac9b8"}, + {file = "pyinstaller-5.13.2-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:aadafb6f213549a5906829bb252e586e2cf72a7fbdb5731810695e6516f0ab30"}, + {file = "pyinstaller-5.13.2-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:b2e1c7f5cceb5e9800927ddd51acf9cc78fbaa9e79e822c48b0ee52d9ce3c892"}, + {file = "pyinstaller-5.13.2-py3-none-win32.whl", hash = "sha256:421cd24f26144f19b66d3868b49ed673176765f92fa9f7914cd2158d25b6d17e"}, + {file = "pyinstaller-5.13.2-py3-none-win_amd64.whl", hash = "sha256:ddcc2b36052a70052479a9e5da1af067b4496f43686ca3cdda99f8367d0627e4"}, + {file = "pyinstaller-5.13.2-py3-none-win_arm64.whl", hash = "sha256:27cd64e7cc6b74c5b1066cbf47d75f940b71356166031deb9778a2579bb874c6"}, + {file = "pyinstaller-5.13.2.tar.gz", hash = "sha256:c8e5d3489c3a7cc5f8401c2d1f48a70e588f9967e391c3b06ddac1f685f8d5d2"}, +] + +[package.dependencies] +altgraph = "*" +macholib = {version = ">=1.8", markers = "sys_platform == \"darwin\""} +pefile = {version = ">=2022.5.30", markers = "sys_platform == \"win32\""} +pyinstaller-hooks-contrib = ">=2021.4" +pywin32-ctypes = {version = ">=0.2.1", markers = "sys_platform == \"win32\""} +setuptools = ">=42.0.0" + +[package.extras] +encryption = ["tinyaes (>=1.0.0)"] +hook-testing = ["execnet (>=1.5.0)", "psutil", "pytest (>=2.7.3)"] + +[[package]] +name = "pyinstaller-hooks-contrib" +version = "2023.7" +description = "Community maintained hooks for PyInstaller" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyinstaller-hooks-contrib-2023.7.tar.gz", hash = "sha256:0c436a4c3506020e34116a8a7ddfd854c1ad6ddca9a8cd84500bd6e69c9e68f9"}, + {file = "pyinstaller_hooks_contrib-2023.7-py2.py3-none-any.whl", hash = "sha256:3c10df14c0f71ab388dfbf1625375b087e7330d9444cbfd2b310ba027fa0cff0"}, +] + +[[package]] +name = "pyopenjtalk" +version = "0.3.2+b35fc89" +description = "A python wrapper for OpenJTalk" +optional = false +python-versions = "*" +files = [] +develop = false + +[package.dependencies] +numpy = ">=1.20.0" +six = "*" +tqdm = "*" + +[package.extras] +dev = ["black (>=19.19b0,<=20.8)", "click (<8.1.0)", "cython (>=0.21.0,<3.0.0)", "flake8 (>=3.7,<4)", "flake8-bugbear", "importlib-metadata (<5.0)", "isort (>=4.3,<5.2.0)", "mypy (<=0.910)", "pysen", "types-decorator", "types-setuptools"] +docs = ["Jinja2 (>=3.0.1)", "ipython", "jupyter", "nbsphinx (>=0.8.6)", "pandoc", "sphinx_rtd_theme"] +marine = ["marine (>=0.0.5)"] +test = ["pytest", "scipy"] + +[package.source] +type = "git" +url = "https://github.com/VOICEVOX/pyopenjtalk" +reference = "b35fc89fe42948a28e33aed886ea145a51113f88" +resolved_reference = "b35fc89fe42948a28e33aed886ea145a51113f88" + +[[package]] +name = "pyproject-hooks" +version = "1.0.0" +description = "Wrappers to call pyproject.toml-based build backend hooks." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyproject_hooks-1.0.0-py3-none-any.whl", hash = "sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8"}, + {file = "pyproject_hooks-1.0.0.tar.gz", hash = "sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5"}, +] + +[[package]] +name = "pyrsistent" +version = "0.19.3" +description = "Persistent/Functional/Immutable data structures" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyrsistent-0.19.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:20460ac0ea439a3e79caa1dbd560344b64ed75e85d8703943e0b66c2a6150e4a"}, + {file = "pyrsistent-0.19.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4c18264cb84b5e68e7085a43723f9e4c1fd1d935ab240ce02c0324a8e01ccb64"}, + {file = "pyrsistent-0.19.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4b774f9288dda8d425adb6544e5903f1fb6c273ab3128a355c6b972b7df39dcf"}, + {file = "pyrsistent-0.19.3-cp310-cp310-win32.whl", hash = "sha256:5a474fb80f5e0d6c9394d8db0fc19e90fa540b82ee52dba7d246a7791712f74a"}, + {file = "pyrsistent-0.19.3-cp310-cp310-win_amd64.whl", hash = "sha256:49c32f216c17148695ca0e02a5c521e28a4ee6c5089f97e34fe24163113722da"}, + {file = "pyrsistent-0.19.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f0774bf48631f3a20471dd7c5989657b639fd2d285b861237ea9e82c36a415a9"}, + {file = "pyrsistent-0.19.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3ab2204234c0ecd8b9368dbd6a53e83c3d4f3cab10ecaf6d0e772f456c442393"}, + {file = "pyrsistent-0.19.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e42296a09e83028b3476f7073fcb69ffebac0e66dbbfd1bd847d61f74db30f19"}, + {file = "pyrsistent-0.19.3-cp311-cp311-win32.whl", hash = "sha256:64220c429e42a7150f4bfd280f6f4bb2850f95956bde93c6fda1b70507af6ef3"}, + {file = "pyrsistent-0.19.3-cp311-cp311-win_amd64.whl", hash = "sha256:016ad1afadf318eb7911baa24b049909f7f3bb2c5b1ed7b6a8f21db21ea3faa8"}, + {file = "pyrsistent-0.19.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c4db1bd596fefd66b296a3d5d943c94f4fac5bcd13e99bffe2ba6a759d959a28"}, + {file = "pyrsistent-0.19.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aeda827381f5e5d65cced3024126529ddc4289d944f75e090572c77ceb19adbf"}, + {file = "pyrsistent-0.19.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:42ac0b2f44607eb92ae88609eda931a4f0dfa03038c44c772e07f43e738bcac9"}, + {file = "pyrsistent-0.19.3-cp37-cp37m-win32.whl", hash = "sha256:e8f2b814a3dc6225964fa03d8582c6e0b6650d68a232df41e3cc1b66a5d2f8d1"}, + {file = "pyrsistent-0.19.3-cp37-cp37m-win_amd64.whl", hash = "sha256:c9bb60a40a0ab9aba40a59f68214eed5a29c6274c83b2cc206a359c4a89fa41b"}, + {file = "pyrsistent-0.19.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:a2471f3f8693101975b1ff85ffd19bb7ca7dd7c38f8a81701f67d6b4f97b87d8"}, + {file = "pyrsistent-0.19.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc5d149f31706762c1f8bda2e8c4f8fead6e80312e3692619a75301d3dbb819a"}, + {file = "pyrsistent-0.19.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3311cb4237a341aa52ab8448c27e3a9931e2ee09561ad150ba94e4cfd3fc888c"}, + {file = "pyrsistent-0.19.3-cp38-cp38-win32.whl", hash = "sha256:f0e7c4b2f77593871e918be000b96c8107da48444d57005b6a6bc61fb4331b2c"}, + {file = "pyrsistent-0.19.3-cp38-cp38-win_amd64.whl", hash = "sha256:c147257a92374fde8498491f53ffa8f4822cd70c0d85037e09028e478cababb7"}, + {file = "pyrsistent-0.19.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b735e538f74ec31378f5a1e3886a26d2ca6351106b4dfde376a26fc32a044edc"}, + {file = "pyrsistent-0.19.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:99abb85579e2165bd8522f0c0138864da97847875ecbd45f3e7e2af569bfc6f2"}, + {file = "pyrsistent-0.19.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a8cb235fa6d3fd7aae6a4f1429bbb1fec1577d978098da1252f0489937786f3"}, + {file = "pyrsistent-0.19.3-cp39-cp39-win32.whl", hash = "sha256:c74bed51f9b41c48366a286395c67f4e894374306b197e62810e0fdaf2364da2"}, + {file = "pyrsistent-0.19.3-cp39-cp39-win_amd64.whl", hash = "sha256:878433581fc23e906d947a6814336eee031a00e6defba224234169ae3d3d6a98"}, + {file = "pyrsistent-0.19.3-py3-none-any.whl", hash = "sha256:ccf0d6bd208f8111179f0c26fdf84ed7c3891982f2edaeae7422575f47e66b64"}, + {file = "pyrsistent-0.19.3.tar.gz", hash = "sha256:1a2994773706bbb4995c31a97bc94f1418314923bd1048c6d964837040376440"}, +] + +[[package]] +name = "pysen" +version = "0.10.5" +description = "Python linting made easy. Also a casual yet honorific way to address individuals who have entered an organization prior to you." +optional = false +python-versions = "*" +files = [ + {file = "pysen-0.10.5-py3-none-any.whl", hash = "sha256:4e8a83263f04585807e3754622bb635d4a0ccd88ec1a4f324e8c9efba300237f"}, + {file = "pysen-0.10.5.tar.gz", hash = "sha256:61a6674e0b8a0c6b837b878310bd4117c5d4108dd95db572caa31c5b311d85bb"}, +] + +[package.dependencies] +colorlog = ">=4.0.0,<5.0.0" +dacite = ">=1.1.0,<2.0.0" +GitPython = ">=3.0.0,<4.0.0" +tomlkit = ">=0.5.11,<1.0.0" +unidiff = ">=0.6.0,<1.0.0" + +[package.extras] +lint = ["black (>=19.10b0,<=22.10)", "flake8 (>=3.7,<5)", "flake8-bugbear", "isort (>=4.3,<5.2.0)", "mypy (>=0.770,<0.800)"] + +[[package]] +name = "pytest" +version = "6.2.5" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.6" +files = [ + {file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"}, + {file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"}, +] + +[package.dependencies] +atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} +attrs = ">=19.2.0" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +py = ">=1.8.2" +toml = "*" + +[package.extras] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] + +[[package]] +name = "python-multipart" +version = "0.0.5" +description = "A streaming multipart parser for Python" +optional = false +python-versions = "*" +files = [ + {file = "python-multipart-0.0.5.tar.gz", hash = "sha256:f7bb5f611fc600d15fa47b3974c8aa16e93724513b49b5f95c81e6624c83fa43"}, +] + +[package.dependencies] +six = ">=1.4.0" + +[[package]] +name = "pywin32-ctypes" +version = "0.2.2" +description = "A (partial) reimplementation of pywin32 using ctypes/cffi" +optional = false +python-versions = ">=3.6" +files = [ + {file = "pywin32-ctypes-0.2.2.tar.gz", hash = "sha256:3426e063bdd5fd4df74a14fa3cf80a0b42845a87e1d1e81f6549f9daec593a60"}, + {file = "pywin32_ctypes-0.2.2-py3-none-any.whl", hash = "sha256:bf490a1a709baf35d688fe0ecf980ed4de11d2b3e37b51e5442587a75d9957e7"}, +] + +[[package]] +name = "pyworld" +version = "0.3.4" +description = "PyWorld: a Python wrapper for WORLD vocoder" +optional = false +python-versions = "*" +files = [ + {file = "pyworld-0.3.4-cp310-cp310-win_amd64.whl", hash = "sha256:699d2478b31215893152f67bb3eef244ed77fd3b8ac6757428fbcf7f8e1a057c"}, + {file = "pyworld-0.3.4-cp311-cp311-win_amd64.whl", hash = "sha256:61292a4dced5f4a0677aa7afdd5c601df79e70771aa63bbdd8279e6a1d0f5d7a"}, + {file = "pyworld-0.3.4-cp36-cp36m-win32.whl", hash = "sha256:ebd9f918f54fb5dd6a16059635d904b56a5165e7e5207ab1b4fa0fb839b4efa7"}, + {file = "pyworld-0.3.4-cp36-cp36m-win_amd64.whl", hash = "sha256:34db25abde77cc231605d0f3748742cf9535156ee239fd861241a66d43c5134c"}, + {file = "pyworld-0.3.4-cp37-cp37m-win32.whl", hash = "sha256:8c0a4c6ef1d3ba7742b4cf773c2733743392ce525d75efda4b832abb623d8689"}, + {file = "pyworld-0.3.4-cp37-cp37m-win_amd64.whl", hash = "sha256:235ce1c9b97986897cf60544c6d46a5eef814688b1aa0ea9d88e9877e6df015f"}, + {file = "pyworld-0.3.4-cp38-cp38-win_amd64.whl", hash = "sha256:a1aa7ec78e4575c231bc374c825a3c5c1fefdff5c83932dcf90b7d333c156c2e"}, + {file = "pyworld-0.3.4-cp39-cp39-win_amd64.whl", hash = "sha256:fddbbb9aec3f2341279237a907b8b625fa099086205b24aa740008becbd7e3d4"}, + {file = "pyworld-0.3.4.tar.gz", hash = "sha256:106c70ee7a7d8c9ba488d8022f2033706929a40f0264256b8e87da5aab98303a"}, +] + +[package.dependencies] +cython = ">=0.24" +numpy = "*" + +[package.extras] +sdist = ["cython (>=0.24)", "numpy"] +test = ["nose"] + +[[package]] +name = "pyyaml" +version = "6.0.1" +description = "YAML parser and emitter for Python" +optional = false +python-versions = ">=3.6" +files = [ + {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, + {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, + {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, + {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, + {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, + {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, + {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, + {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, + {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, + {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, + {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, + {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, + {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, + {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, + {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, + {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, + {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, + {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, + {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, +] + +[[package]] +name = "rapidfuzz" +version = "2.15.1" +description = "rapid fuzzy string matching" +optional = false +python-versions = ">=3.7" +files = [ + {file = "rapidfuzz-2.15.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:fc0bc259ebe3b93e7ce9df50b3d00e7345335d35acbd735163b7c4b1957074d3"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d59fb3a410d253f50099d7063855c2b95df1ef20ad93ea3a6b84115590899f25"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c525a3da17b6d79d61613096c8683da86e3573e807dfaecf422eea09e82b5ba6"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4deae6a918ecc260d0c4612257be8ba321d8e913ccb43155403842758c46fbe"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2577463d10811386e704a3ab58b903eb4e2a31b24dfd9886d789b0084d614b01"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f67d5f56aa48c0da9de4ab81bffb310683cf7815f05ea38e5aa64f3ba4368339"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d7927722ff43690e52b3145b5bd3089151d841d350c6f8378c3cfac91f67573a"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6534afc787e32c4104f65cdeb55f6abe4d803a2d0553221d00ef9ce12788dcde"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d0ae6ec79a1931929bb9dd57bc173eb5ba4c7197461bf69e3a34b6dd314feed2"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:be7ccc45c4d1a7dfb595f260e8022a90c6cb380c2a346ee5aae93f85c96d362b"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:8ba013500a2b68c64b2aecc5fb56a2dad6c2872cf545a0308fd044827b6e5f6a"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:4d9f7d10065f657f960b48699e7dddfce14ab91af4bab37a215f0722daf0d716"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7e24a1b802cea04160b3fccd75d2d0905065783ebc9de157d83c14fb9e1c6ce2"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-win32.whl", hash = "sha256:dffdf03499e0a5b3442951bb82b556333b069e0661e80568752786c79c5b32de"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-win_amd64.whl", hash = "sha256:7d150d90a7c6caae7962f29f857a4e61d42038cfd82c9df38508daf30c648ae7"}, + {file = "rapidfuzz-2.15.1-cp310-cp310-win_arm64.whl", hash = "sha256:87c30e9184998ff6eb0fa9221f94282ce7c908fd0da96a1ef66ecadfaaa4cdb7"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6986413cb37035eb796e32f049cbc8c13d8630a4ac1e0484e3e268bb3662bd1b"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a72f26e010d4774b676f36e43c0fc8a2c26659efef4b3be3fd7714d3491e9957"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b5cd54c98a387cca111b3b784fc97a4f141244bbc28a92d4bde53f164464112e"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da7fac7c3da39f93e6b2ebe386ed0ffe1cefec91509b91857f6e1204509e931f"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f976e76ac72f650790b3a5402431612175b2ac0363179446285cb3c901136ca9"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:abde47e1595902a490ed14d4338d21c3509156abb2042a99e6da51f928e0c117"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ca8f1747007a3ce919739a60fa95c5325f7667cccf6f1c1ef18ae799af119f5e"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c35da09ab9797b020d0d4f07a66871dfc70ea6566363811090353ea971748b5a"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a3a769ca7580686a66046b77df33851b3c2d796dc1eb60c269b68f690f3e1b65"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:d50622efefdb03a640a51a6123748cd151d305c1f0431af762e833d6ffef71f0"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:b7461b0a7651d68bc23f0896bffceea40f62887e5ab8397bf7caa883592ef5cb"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:074ee9e17912e025c72a5780ee4c7c413ea35cd26449719cc399b852d4e42533"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:7025fb105a11f503943f17718cdb8241ea3bb4d812c710c609e69bead40e2ff0"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-win32.whl", hash = "sha256:2084d36b95139413cef25e9487257a1cc892b93bd1481acd2a9656f7a1d9930c"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-win_amd64.whl", hash = "sha256:5a738fcd24e34bce4b19126b92fdae15482d6d3a90bd687fd3d24ce9d28ce82d"}, + {file = "rapidfuzz-2.15.1-cp311-cp311-win_arm64.whl", hash = "sha256:dc3cafa68cfa54638632bdcadf9aab89a3d182b4a3f04d2cad7585ed58ea8731"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:3c53d57ba7a88f7bf304d4ea5a14a0ca112db0e0178fff745d9005acf2879f7d"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a6ee758eec4cf2215dc8d8eafafcea0d1f48ad4b0135767db1b0f7c5c40a17dd"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2d93ba3ae59275e7a3a116dac4ffdb05e9598bf3ee0861fecc5b60fb042d539e"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7c3ff75e647908ddbe9aa917fbe39a112d5631171f3fcea5809e2363e525a59d"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6d89c421702474c6361245b6b199e6e9783febacdbfb6b002669e6cb3ef17a09"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f69e6199fec0f58f9a89afbbaea78d637c7ce77f656a03a1d6ea6abdc1d44f8"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:41dfea282844d0628279b4db2929da0dacb8ac317ddc5dcccc30093cf16357c1"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:2dd03477feefeccda07b7659dd614f6738cfc4f9b6779dd61b262a73b0a9a178"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:5efe035aa76ff37d1b5fa661de3c4b4944de9ff227a6c0b2e390a95c101814c0"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:ed2cf7c69102c7a0a06926d747ed855bc836f52e8d59a5d1e3adfd980d1bd165"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a0e441d4c2025110ec3eba5d54f11f78183269a10152b3a757a739ffd1bb12bf"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-win32.whl", hash = "sha256:a4a54efe17cc9f53589c748b53f28776dfdfb9bc83619685740cb7c37985ac2f"}, + {file = "rapidfuzz-2.15.1-cp37-cp37m-win_amd64.whl", hash = "sha256:bb8318116ecac4dfb84841d8b9b461f9bb0c3be5b616418387d104f72d2a16d1"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e9296c530e544f68858c3416ad1d982a1854f71e9d2d3dcedb5b216e6d54f067"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:49c4bcdb9238f11f8c4eba1b898937f09b92280d6f900023a8216008f299b41a"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ebb40a279e134bb3fef099a8b58ed5beefb201033d29bdac005bddcdb004ef71"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a7381c11cb590bbd4e6f2d8779a0b34fdd2234dfa13d0211f6aee8ca166d9d05"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cfdcdedfd12a0077193f2cf3626ff6722c5a184adf0d2d51f1ec984bf21c23c3"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f85bece1ec59bda8b982bd719507d468d4df746dfb1988df11d916b5e9fe19e8"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b1b393f4a1eaa6867ffac6aef58cfb04bab2b3d7d8e40b9fe2cf40dd1d384601"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53de456ef020a77bf9d7c6c54860a48e2e902584d55d3001766140ac45c54bc7"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2492330bc38b76ed967eab7bdaea63a89b6ceb254489e2c65c3824efcbf72993"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:099e4c6befaa8957a816bdb67ce664871f10aaec9bebf2f61368cf7e0869a7a1"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:46599b2ad4045dd3f794a24a6db1e753d23304699d4984462cf1ead02a51ddf3"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:591f19d16758a3c55c9d7a0b786b40d95599a5b244d6eaef79c7a74fcf5104d8"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ed17359061840eb249f8d833cb213942e8299ffc4f67251a6ed61833a9f2ea20"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-win32.whl", hash = "sha256:aa1e5aad325168e29bf8e17006479b97024aa9d2fdbe12062bd2f8f09080acf8"}, + {file = "rapidfuzz-2.15.1-cp38-cp38-win_amd64.whl", hash = "sha256:c2bb68832b140c551dbed691290bef4ee6719d4e8ce1b7226a3736f61a9d1a83"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:3fac40972cf7b6c14dded88ae2331eb50dfbc278aa9195473ef6fc6bfe49f686"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f0e456cbdc0abf39352800309dab82fd3251179fa0ff6573fa117f51f4e84be8"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:22b9d22022b9d09fd4ece15102270ab9b6a5cfea8b6f6d1965c1df7e3783f5ff"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:46754fe404a9a6f5cbf7abe02d74af390038d94c9b8c923b3f362467606bfa28"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:91abb8bf7610efe326394adc1d45e1baca8f360e74187f3fa0ef3df80cdd3ba6"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e40a2f60024f9d3c15401e668f732800114a023f3f8d8c40f1521a62081ff054"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a48ee83916401ac73938526d7bd804e01d2a8fe61809df7f1577b0b3b31049a3"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c71580052f9dbac443c02f60484e5a2e5f72ad4351b84b2009fbe345b1f38422"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:82b86d5b8c1b9bcbc65236d75f81023c78d06a721c3e0229889ff4ed5c858169"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:fc4528b7736e5c30bc954022c2cf410889abc19504a023abadbc59cdf9f37cae"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:e1e0e569108a5760d8f01d0f2148dd08cc9a39ead79fbefefca9e7c7723c7e88"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:94e1c97f0ad45b05003806f8a13efc1fc78983e52fa2ddb00629003acf4676ef"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:47e81767a962e41477a85ad7ac937e34d19a7d2a80be65614f008a5ead671c56"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-win32.whl", hash = "sha256:79fc574aaf2d7c27ec1022e29c9c18f83cdaf790c71c05779528901e0caad89b"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-win_amd64.whl", hash = "sha256:f3dd4bcef2d600e0aa121e19e6e62f6f06f22a89f82ef62755e205ce14727874"}, + {file = "rapidfuzz-2.15.1-cp39-cp39-win_arm64.whl", hash = "sha256:cac095cbdf44bc286339a77214bbca6d4d228c9ebae3da5ff6a80aaeb7c35634"}, + {file = "rapidfuzz-2.15.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:b89d1126be65c85763d56e3b47d75f1a9b7c5529857b4d572079b9a636eaa8a7"}, + {file = "rapidfuzz-2.15.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:19b7460e91168229768be882ea365ba0ac7da43e57f9416e2cfadc396a7df3c2"}, + {file = "rapidfuzz-2.15.1-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:93c33c03e7092642c38f8a15ca2d8fc38da366f2526ec3b46adf19d5c7aa48ba"}, + {file = "rapidfuzz-2.15.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:040faca2e26d9dab5541b45ce72b3f6c0e36786234703fc2ac8c6f53bb576743"}, + {file = "rapidfuzz-2.15.1-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:6e2a3b23e1e9aa13474b3c710bba770d0dcc34d517d3dd6f97435a32873e3f28"}, + {file = "rapidfuzz-2.15.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2e597b9dfd6dd180982684840975c458c50d447e46928efe3e0120e4ec6f6686"}, + {file = "rapidfuzz-2.15.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d14752c9dd2036c5f36ebe8db5f027275fa7d6b3ec6484158f83efb674bab84e"}, + {file = "rapidfuzz-2.15.1-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:558224b6fc6124d13fa32d57876f626a7d6188ba2a97cbaea33a6ee38a867e31"}, + {file = "rapidfuzz-2.15.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c89cfa88dc16fd8c9bcc0c7f0b0073f7ef1e27cceb246c9f5a3f7004fa97c4d"}, + {file = "rapidfuzz-2.15.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:509c5b631cd64df69f0f011893983eb15b8be087a55bad72f3d616b6ae6a0f96"}, + {file = "rapidfuzz-2.15.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:0f73a04135a03a6e40393ecd5d46a7a1049d353fc5c24b82849830d09817991f"}, + {file = "rapidfuzz-2.15.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c99d53138a2dfe8ada67cb2855719f934af2733d726fbf73247844ce4dd6dd5"}, + {file = "rapidfuzz-2.15.1-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f01fa757f0fb332a1f045168d29b0d005de6c39ee5ce5d6c51f2563bb53c601b"}, + {file = "rapidfuzz-2.15.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:60368e1add6e550faae65614844c43f8a96e37bf99404643b648bf2dba92c0fb"}, + {file = "rapidfuzz-2.15.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:785744f1270828cc632c5a3660409dee9bcaac6931a081bae57542c93e4d46c4"}, + {file = "rapidfuzz-2.15.1.tar.gz", hash = "sha256:d62137c2ca37aea90a11003ad7dc109c8f1739bfbe5a9a217f3cdb07d7ac00f6"}, +] + +[package.extras] +full = ["numpy"] + +[[package]] +name = "requests" +version = "2.31.0" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=3.7" +files = [ + {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, + {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<3" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + +[[package]] +name = "requests-toolbelt" +version = "1.0.0" +description = "A utility belt for advanced users of python-requests" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "requests-toolbelt-1.0.0.tar.gz", hash = "sha256:7681a0a3d047012b5bdc0ee37d7f8f07ebe76ab08caeccfc3921ce23c88d5bc6"}, + {file = "requests_toolbelt-1.0.0-py2.py3-none-any.whl", hash = "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06"}, +] + +[package.dependencies] +requests = ">=2.0.1,<3.0.0" + +[[package]] +name = "secretstorage" +version = "3.3.3" +description = "Python bindings to FreeDesktop.org Secret Service API" +optional = false +python-versions = ">=3.6" +files = [ + {file = "SecretStorage-3.3.3-py3-none-any.whl", hash = "sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99"}, + {file = "SecretStorage-3.3.3.tar.gz", hash = "sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77"}, +] + +[package.dependencies] +cryptography = ">=2.0" +jeepney = ">=0.6" + +[[package]] +name = "semver" +version = "3.0.1" +description = "Python helper for Semantic Versioning (https://semver.org)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "semver-3.0.1-py3-none-any.whl", hash = "sha256:2a23844ba1647362c7490fe3995a86e097bb590d16f0f32dfc383008f19e4cdf"}, + {file = "semver-3.0.1.tar.gz", hash = "sha256:9ec78c5447883c67b97f98c3b6212796708191d22e4ad30f4570f840171cbce1"}, +] + +[[package]] +name = "setuptools" +version = "68.1.2" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "setuptools-68.1.2-py3-none-any.whl", hash = "sha256:3d8083eed2d13afc9426f227b24fd1659489ec107c0e86cec2ffdde5c92e790b"}, + {file = "setuptools-68.1.2.tar.gz", hash = "sha256:3d4dfa6d95f1b101d695a6160a7626e15583af71a5f52176efa5d39a054d475d"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5,<=7.1.2)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] + +[[package]] +name = "shellingham" +version = "1.5.3" +description = "Tool to Detect Surrounding Shell" +optional = false +python-versions = ">=3.7" +files = [ + {file = "shellingham-1.5.3-py2.py3-none-any.whl", hash = "sha256:419c6a164770c9c7cfcaeddfacb3d31ac7a8db0b0f3e9c1287679359734107e9"}, + {file = "shellingham-1.5.3.tar.gz", hash = "sha256:cb4a6fec583535bc6da17b647dd2330cf7ef30239e05d547d99ae3705fd0f7f8"}, +] + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "smmap" +version = "5.0.0" +description = "A pure Python implementation of a sliding window memory map manager" +optional = false +python-versions = ">=3.6" +files = [ + {file = "smmap-5.0.0-py3-none-any.whl", hash = "sha256:2aba19d6a040e78d8b09de5c57e96207b09ed71d8e55ce0959eeee6c8e190d94"}, + {file = "smmap-5.0.0.tar.gz", hash = "sha256:c840e62059cd3be204b0c9c9f74be2c09d5648eddd4580d9314c3ecde0b30936"}, +] + +[[package]] +name = "sniffio" +version = "1.3.0" +description = "Sniff out which async library your code is running under" +optional = false +python-versions = ">=3.7" +files = [ + {file = "sniffio-1.3.0-py3-none-any.whl", hash = "sha256:eecefdce1e5bbfb7ad2eeaabf7c1eeb404d7757c379bd1f7e5cce9d8bf425384"}, + {file = "sniffio-1.3.0.tar.gz", hash = "sha256:e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101"}, +] + +[[package]] +name = "soundfile" +version = "0.12.1" +description = "An audio library based on libsndfile, CFFI and NumPy" +optional = false +python-versions = "*" +files = [ + {file = "soundfile-0.12.1-py2.py3-none-any.whl", hash = "sha256:828a79c2e75abab5359f780c81dccd4953c45a2c4cd4f05ba3e233ddf984b882"}, + {file = "soundfile-0.12.1-py2.py3-none-macosx_10_9_x86_64.whl", hash = "sha256:d922be1563ce17a69582a352a86f28ed8c9f6a8bc951df63476ffc310c064bfa"}, + {file = "soundfile-0.12.1-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:bceaab5c4febb11ea0554566784bcf4bc2e3977b53946dda2b12804b4fe524a8"}, + {file = "soundfile-0.12.1-py2.py3-none-manylinux_2_17_x86_64.whl", hash = "sha256:2dc3685bed7187c072a46ab4ffddd38cef7de9ae5eb05c03df2ad569cf4dacbc"}, + {file = "soundfile-0.12.1-py2.py3-none-manylinux_2_31_x86_64.whl", hash = "sha256:074247b771a181859d2bc1f98b5ebf6d5153d2c397b86ee9e29ba602a8dfe2a6"}, + {file = "soundfile-0.12.1-py2.py3-none-win32.whl", hash = "sha256:59dfd88c79b48f441bbf6994142a19ab1de3b9bb7c12863402c2bc621e49091a"}, + {file = "soundfile-0.12.1-py2.py3-none-win_amd64.whl", hash = "sha256:0d86924c00b62552b650ddd28af426e3ff2d4dc2e9047dae5b3d8452e0a49a77"}, + {file = "soundfile-0.12.1.tar.gz", hash = "sha256:e8e1017b2cf1dda767aef19d2fd9ee5ebe07e050d430f77a0a7c66ba08b8cdae"}, +] + +[package.dependencies] +cffi = ">=1.0" + +[package.extras] +numpy = ["numpy"] + +[[package]] +name = "soxr" +version = "0.3.6" +description = "High quality, one-dimensional sample-rate conversion library" +optional = false +python-versions = ">=3.6" +files = [ + {file = "soxr-0.3.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8f64bc45a30ee6d9765cc4b1fdb6b9d5ec7d2880fc42a2e968c662ed3abe83c7"}, + {file = "soxr-0.3.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8fe418fcee2173422b5c25ca4d9e03a86dd9d08f1502b0077987e2018ac943df"}, + {file = "soxr-0.3.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b9074ee0901057353455febc5fe91a83dae1f97ade4e96acc8b95bd3d70cb495"}, + {file = "soxr-0.3.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f0b01688e7e591411a3499a62427a87236be31c84d6a88afd381947568f445df"}, + {file = "soxr-0.3.6-cp310-cp310-win_amd64.whl", hash = "sha256:03834c82977dc8976a183e22dfc9dd0f65198f416ac79f6bb13310e63c795662"}, + {file = "soxr-0.3.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:97a89e3798f22bd04c475b30c041ee2f2e223effb4f80a71d4f5e278f7939138"}, + {file = "soxr-0.3.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:705af37f7a63d3abecf9121bff392241636b403bcf6e232fb527d0b108aa8700"}, + {file = "soxr-0.3.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e73f8b9fb5ac3ad26155a6c789284bea1de98701c184e0ecb9cb328e9f81dfc2"}, + {file = "soxr-0.3.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1add0aeed67f2396d7b4cefa36887ba8db1a185791f085c12aafa82e96d6fdf"}, + {file = "soxr-0.3.6-cp311-cp311-win_amd64.whl", hash = "sha256:ba651652a64623a61ea86717357dcbf4d71f7f3695da979056ca257890f47d10"}, + {file = "soxr-0.3.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c17f5efa78575afdbb854afbead11be5b209340e0ba801073ea4af31eeb567e7"}, + {file = "soxr-0.3.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:475f86acd92e97275b86940afabf0f108252b6a684fc724cef8019308d234162"}, + {file = "soxr-0.3.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f5d31d750886651137664cf55283e96a6f324d914d137f758d339d08a18347d"}, + {file = "soxr-0.3.6-cp37-cp37m-win_amd64.whl", hash = "sha256:15277be23858ae9e1eeaec8151bbcd41ebf70c35ea067bb5e897f6834804256c"}, + {file = "soxr-0.3.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ac7da6054eff748f414cfaa8172249c492da7e88dde6aa97bfb2272d87727060"}, + {file = "soxr-0.3.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:dd1874aa176b5ae755f26c5bd7d9d45217839719a4343862d2fe72e50c57dd16"}, + {file = "soxr-0.3.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d0c40a25ae9520d7752e7ece07c3ec2bc58f30893c20a58c9d7a5311e7499290"}, + {file = "soxr-0.3.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ad635ee478635efca9457b811bba373272319b45a1941d7f9d9ac8c2e98b3bc"}, + {file = "soxr-0.3.6-cp38-cp38-win_amd64.whl", hash = "sha256:dcf107a32d971e329b330a8f2026fedb118e39f5d549f65743184f8ec5d38204"}, + {file = "soxr-0.3.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:385a37d39813e1d633229bcd94ab6bd76b27b779d38f2f6cbc390926f3965d31"}, + {file = "soxr-0.3.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2a78c61bf65b2e9d5612cbcab449a4a070ea84a18ff0757a840e0fa49b574225"}, + {file = "soxr-0.3.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79872546786c3d05ff90260197863811532823fcfb58aeb647e916c6aa57299d"}, + {file = "soxr-0.3.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c72ab44bfd72ecadb0a29e38487c241eb69a9867d3476e528c64e957fc06ff7"}, + {file = "soxr-0.3.6-cp39-cp39-win_amd64.whl", hash = "sha256:2b2dd2e2625b4b98360cd1607d72e4bd2eac60de3a18244b8a4d45f9168a4541"}, + {file = "soxr-0.3.6.tar.gz", hash = "sha256:6b3d98da77353b5bbb4401cef83cec7f1538844dc27c7badf89c2855b43f42b4"}, +] + +[package.dependencies] +numpy = "*" + +[package.extras] +docs = ["linkify-it-py", "myst-parser", "sphinx", "sphinx-book-theme"] +test = ["pytest"] + +[[package]] +name = "starlette" +version = "0.27.0" +description = "The little ASGI library that shines." +optional = false +python-versions = ">=3.7" +files = [ + {file = "starlette-0.27.0-py3-none-any.whl", hash = "sha256:918416370e846586541235ccd38a474c08b80443ed31c578a418e2209b3eef91"}, + {file = "starlette-0.27.0.tar.gz", hash = "sha256:6a6b0d042acb8d469a01eba54e9cda6cbd24ac602c4cd016723117d6a7e73b75"}, +] + +[package.dependencies] +anyio = ">=3.4.0,<5" + +[package.extras] +full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart", "pyyaml"] + +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] + +[[package]] +name = "tomlkit" +version = "0.12.1" +description = "Style preserving TOML library" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tomlkit-0.12.1-py3-none-any.whl", hash = "sha256:712cbd236609acc6a3e2e97253dfc52d4c2082982a88f61b640ecf0817eab899"}, + {file = "tomlkit-0.12.1.tar.gz", hash = "sha256:38e1ff8edb991273ec9f6181244a6a391ac30e9f5098e7535640ea6be97a7c86"}, +] + +[[package]] +name = "tqdm" +version = "4.66.1" +description = "Fast, Extensible Progress Meter" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tqdm-4.66.1-py3-none-any.whl", hash = "sha256:d302b3c5b53d47bce91fea46679d9c3c6508cf6332229aa1e7d8653723793386"}, + {file = "tqdm-4.66.1.tar.gz", hash = "sha256:d88e651f9db8d8551a62556d3cff9e3034274ca5d66e93197cf2490e2dcb69c7"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[package.extras] +dev = ["pytest (>=6)", "pytest-cov", "pytest-timeout", "pytest-xdist"] +notebook = ["ipywidgets (>=6)"] +slack = ["slack-sdk"] +telegram = ["requests"] + +[[package]] +name = "trove-classifiers" +version = "2023.8.7" +description = "Canonical source for classifiers on PyPI (pypi.org)." +optional = false +python-versions = "*" +files = [ + {file = "trove-classifiers-2023.8.7.tar.gz", hash = "sha256:c9f2a0a85d545e5362e967e4f069f56fddfd91215e22ffa48c66fb283521319a"}, + {file = "trove_classifiers-2023.8.7-py3-none-any.whl", hash = "sha256:a676626a31286130d56de2ea1232484df97c567eb429d56cfcb0637e681ecf09"}, +] + +[[package]] +name = "typing-extensions" +version = "4.7.1" +description = "Backported and Experimental Type Hints for Python 3.7+" +optional = false +python-versions = ">=3.7" +files = [ + {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, + {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, +] + +[[package]] +name = "unidiff" +version = "0.7.5" +description = "Unified diff parsing/metadata extraction library." +optional = false +python-versions = "*" +files = [ + {file = "unidiff-0.7.5-py2.py3-none-any.whl", hash = "sha256:c93bf2265cc1ba2a520e415ab05da587370bc2a3ae9e0414329f54f0c2fc09e8"}, + {file = "unidiff-0.7.5.tar.gz", hash = "sha256:2e5f0162052248946b9f0970a40e9e124236bf86c82b70821143a6fc1dea2574"}, +] + +[[package]] +name = "urllib3" +version = "2.0.4" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=3.7" +files = [ + {file = "urllib3-2.0.4-py3-none-any.whl", hash = "sha256:de7df1803967d2c2a98e4b11bb7d6bd9210474c46e8a0401514e3a42a75ebde4"}, + {file = "urllib3-2.0.4.tar.gz", hash = "sha256:8d22f86aae8ef5e410d4f539fde9ce6b2113a001bb4d189e0aed70642d602b11"}, +] + +[package.extras] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17.1.0)", "urllib3-secure-extra"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "uvicorn" +version = "0.15.0" +description = "The lightning-fast ASGI server." +optional = false +python-versions = "*" +files = [ + {file = "uvicorn-0.15.0-py3-none-any.whl", hash = "sha256:17f898c64c71a2640514d4089da2689e5db1ce5d4086c2d53699bf99513421c1"}, + {file = "uvicorn-0.15.0.tar.gz", hash = "sha256:d9a3c0dd1ca86728d3e235182683b4cf94cd53a867c288eaeca80ee781b2caff"}, +] + +[package.dependencies] +asgiref = ">=3.4.0" +click = ">=7.0" +h11 = ">=0.8" + +[package.extras] +standard = ["PyYAML (>=5.1)", "colorama (>=0.4)", "httptools (==0.2.*)", "python-dotenv (>=0.13)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1)", "watchgod (>=0.6)", "websockets (>=9.1)"] + +[[package]] +name = "virtualenv" +version = "20.24.3" +description = "Virtual Python Environment builder" +optional = false +python-versions = ">=3.7" +files = [ + {file = "virtualenv-20.24.3-py3-none-any.whl", hash = "sha256:95a6e9398b4967fbcb5fef2acec5efaf9aa4972049d9ae41f95e0972a683fd02"}, + {file = "virtualenv-20.24.3.tar.gz", hash = "sha256:e5c3b4ce817b0b328af041506a2a299418c98747c4b1e68cb7527e74ced23efc"}, +] + +[package.dependencies] +distlib = ">=0.3.7,<1" +filelock = ">=3.12.2,<4" +platformdirs = ">=3.9.1,<4" + +[package.extras] +docs = ["furo (>=2023.5.20)", "proselint (>=0.13)", "sphinx (>=7.0.1)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] +test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] + +[[package]] +name = "wcwidth" +version = "0.2.6" +description = "Measures the displayed width of unicode strings in a terminal" +optional = false +python-versions = "*" +files = [ + {file = "wcwidth-0.2.6-py2.py3-none-any.whl", hash = "sha256:795b138f6875577cd91bba52baf9e445cd5118fd32723b460e30a0af30ea230e"}, + {file = "wcwidth-0.2.6.tar.gz", hash = "sha256:a5220780a404dbe3353789870978e472cfe477761f06ee55077256e509b156d0"}, +] + +[[package]] +name = "xattr" +version = "0.10.1" +description = "Python wrapper for extended filesystem attributes" +optional = false +python-versions = "*" +files = [ + {file = "xattr-0.10.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:16a660a883e703b311d1bbbcafc74fa877585ec081cd96e8dd9302c028408ab1"}, + {file = "xattr-0.10.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:1e2973e72faa87ca29d61c23b58c3c89fe102d1b68e091848b0e21a104123503"}, + {file = "xattr-0.10.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:13279fe8f7982e3cdb0e088d5cb340ce9cbe5ef92504b1fd80a0d3591d662f68"}, + {file = "xattr-0.10.1-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:1dc9b9f580ef4b8ac5e2c04c16b4d5086a611889ac14ecb2e7e87170623a0b75"}, + {file = "xattr-0.10.1-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:485539262c2b1f5acd6b6ea56e0da2bc281a51f74335c351ea609c23d82c9a79"}, + {file = "xattr-0.10.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:295b3ab335fcd06ca0a9114439b34120968732e3f5e9d16f456d5ec4fa47a0a2"}, + {file = "xattr-0.10.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:a126eb38e14a2f273d584a692fe36cff760395bf7fc061ef059224efdb4eb62c"}, + {file = "xattr-0.10.1-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:b0e919c24f5b74428afa91507b15e7d2ef63aba98e704ad13d33bed1288dca81"}, + {file = "xattr-0.10.1-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:e31d062cfe1aaeab6ba3db6bd255f012d105271018e647645941d6609376af18"}, + {file = "xattr-0.10.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:209fb84c09b41c2e4cf16dd2f481bb4a6e2e81f659a47a60091b9bcb2e388840"}, + {file = "xattr-0.10.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c4120090dac33eddffc27e487f9c8f16b29ff3f3f8bcb2251b2c6c3f974ca1e1"}, + {file = "xattr-0.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3e739d624491267ec5bb740f4eada93491de429d38d2fcdfb97b25efe1288eca"}, + {file = "xattr-0.10.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2677d40b95636f3482bdaf64ed9138fb4d8376fb7933f434614744780e46e42d"}, + {file = "xattr-0.10.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40039f1532c4456fd0f4c54e9d4e01eb8201248c321c6c6856262d87e9a99593"}, + {file = "xattr-0.10.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:148466e5bb168aba98f80850cf976e931469a3c6eb11e9880d9f6f8b1e66bd06"}, + {file = "xattr-0.10.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0aedf55b116beb6427e6f7958ccd80a8cbc80e82f87a4cd975ccb61a8d27b2ee"}, + {file = "xattr-0.10.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:c3024a9ff157247c8190dd0eb54db4a64277f21361b2f756319d9d3cf20e475f"}, + {file = "xattr-0.10.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f1be6e733e9698f645dbb98565bb8df9b75e80e15a21eb52787d7d96800e823b"}, + {file = "xattr-0.10.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:7880c8a54c18bc091a4ce0adc5c6d81da1c748aec2fe7ac586d204d6ec7eca5b"}, + {file = "xattr-0.10.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:89c93b42c3ba8aedbc29da759f152731196c2492a2154371c0aae3ef8ba8301b"}, + {file = "xattr-0.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6b905e808df61b677eb972f915f8a751960284358b520d0601c8cbc476ba2df6"}, + {file = "xattr-0.10.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d1ef954d0655f93a34d07d0cc7e02765ec779ff0b59dc898ee08c6326ad614d5"}, + {file = "xattr-0.10.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:199b20301b6acc9022661412346714ce764d322068ef387c4de38062474db76c"}, + {file = "xattr-0.10.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec0956a8ab0f0d3f9011ba480f1e1271b703d11542375ef73eb8695a6bd4b78b"}, + {file = "xattr-0.10.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ffcb57ca1be338d69edad93cf59aac7c6bb4dbb92fd7bf8d456c69ea42f7e6d2"}, + {file = "xattr-0.10.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:1f0563196ee54756fe2047627d316977dc77d11acd7a07970336e1a711e934db"}, + {file = "xattr-0.10.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:fc354f086f926a1c7f04886f97880fed1a26d20e3bc338d0d965fd161dbdb8ab"}, + {file = "xattr-0.10.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:c0cd2d02ef2fb45ecf2b0da066a58472d54682c6d4f0452dfe7ae2f3a76a42ea"}, + {file = "xattr-0.10.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:49626096ddd72dcc1654aadd84b103577d8424f26524a48d199847b5d55612d0"}, + {file = "xattr-0.10.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ceaa26bef8fcb17eb59d92a7481c2d15d20211e217772fb43c08c859b01afc6a"}, + {file = "xattr-0.10.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e8c014c371391f28f8cd27d73ea59f42b30772cd640b5a2538ad4f440fd9190b"}, + {file = "xattr-0.10.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:46c32cd605673606b9388a313b0050ee7877a0640d7561eea243ace4fa2cc5a6"}, + {file = "xattr-0.10.1-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:772b22c4ff791fe5816a7c2a1c9fcba83f9ab9bea138eb44d4d70f34676232b4"}, + {file = "xattr-0.10.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:183ad611a2d70b5a3f5f7aadef0fcef604ea33dcf508228765fd4ddac2c7321d"}, + {file = "xattr-0.10.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8068df3ebdfa9411e58d5ae4a05d807ec5994645bb01af66ec9f6da718b65c5b"}, + {file = "xattr-0.10.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5bc40570155beb85e963ae45300a530223d9822edfdf09991b880e69625ba38a"}, + {file = "xattr-0.10.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:436e1aaf23c07e15bed63115f1712d2097e207214fc6bcde147c1efede37e2c5"}, + {file = "xattr-0.10.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7298455ccf3a922d403339781b10299b858bb5ec76435445f2da46fb768e31a5"}, + {file = "xattr-0.10.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:986c2305c6c1a08f78611eb38ef9f1f47682774ce954efb5a4f3715e8da00d5f"}, + {file = "xattr-0.10.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:5dc6099e76e33fa3082a905fe59df766b196534c705cf7a2e3ad9bed2b8a180e"}, + {file = "xattr-0.10.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:042ad818cda6013162c0bfd3816f6b74b7700e73c908cde6768da824686885f8"}, + {file = "xattr-0.10.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:9d4c306828a45b41b76ca17adc26ac3dc00a80e01a5ba85d71df2a3e948828f2"}, + {file = "xattr-0.10.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a606280b0c9071ef52572434ecd3648407b20df3d27af02c6592e84486b05894"}, + {file = "xattr-0.10.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5b49d591cf34cda2079fd7a5cb2a7a1519f54dc2e62abe3e0720036f6ed41a85"}, + {file = "xattr-0.10.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b8705ac6791426559c1a5c2b88bb2f0e83dc5616a09b4500899bfff6a929302"}, + {file = "xattr-0.10.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a5ea974930e876bc5c146f54ac0f85bb39b7b5de2b6fc63f90364712ae368ebe"}, + {file = "xattr-0.10.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f55a2dd73a12a1ae5113c5d9cd4b4ab6bf7950f4d76d0a1a0c0c4264d50da61d"}, + {file = "xattr-0.10.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:475c38da0d3614cc5564467c4efece1e38bd0705a4dbecf8deeb0564a86fb010"}, + {file = "xattr-0.10.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:925284a4a28e369459b2b7481ea22840eed3e0573a4a4c06b6b0614ecd27d0a7"}, + {file = "xattr-0.10.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:aa32f1b45fed9122bed911de0fcc654da349e1f04fa4a9c8ef9b53e1cc98b91e"}, + {file = "xattr-0.10.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c5d3d0e728bace64b74c475eb4da6148cd172b2d23021a1dcd055d92f17619ac"}, + {file = "xattr-0.10.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:8faaacf311e2b5cc67c030c999167a78a9906073e6abf08eaa8cf05b0416515c"}, + {file = "xattr-0.10.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cc6b8d5ca452674e1a96e246a3d2db5f477aecbc7c945c73f890f56323e75203"}, + {file = "xattr-0.10.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3725746a6502f40f72ef27e0c7bfc31052a239503ff3eefa807d6b02a249be22"}, + {file = "xattr-0.10.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:789bd406d1aad6735e97b20c6d6a1701e1c0661136be9be862e6a04564da771f"}, + {file = "xattr-0.10.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9a7a807ab538210ff8532220d8fc5e2d51c212681f63dbd4e7ede32543b070f"}, + {file = "xattr-0.10.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:3e5825b5fc99ecdd493b0cc09ec35391e7a451394fdf623a88b24726011c950d"}, + {file = "xattr-0.10.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:80638d1ce7189dc52f26c234cee3522f060fadab6a8bc3562fe0ddcbe11ba5a4"}, + {file = "xattr-0.10.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3ff0dbe4a6ce2ce065c6de08f415bcb270ecfd7bf1655a633ddeac695ce8b250"}, + {file = "xattr-0.10.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:5267e5f9435c840d2674194150b511bef929fa7d3bc942a4a75b9eddef18d8d8"}, + {file = "xattr-0.10.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b27dfc13b193cb290d5d9e62f806bb9a99b00cd73bb6370d556116ad7bb5dc12"}, + {file = "xattr-0.10.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:636ebdde0277bce4d12d2ef2550885804834418fee0eb456b69be928e604ecc4"}, + {file = "xattr-0.10.1-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d60c27922ec80310b45574351f71e0dd3a139c5295e8f8b19d19c0010196544f"}, + {file = "xattr-0.10.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:b34df5aad035d0343bd740a95ca30db99b776e2630dca9cc1ba8e682c9cc25ea"}, + {file = "xattr-0.10.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f24a7c04ff666d0fe905dfee0a84bc899d624aeb6dccd1ea86b5c347f15c20c1"}, + {file = "xattr-0.10.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a3878e1aff8eca64badad8f6d896cb98c52984b1e9cd9668a3ab70294d1ef92d"}, + {file = "xattr-0.10.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4abef557028c551d59cf2fb3bf63f2a0c89f00d77e54c1c15282ecdd56943496"}, + {file = "xattr-0.10.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:0e14bd5965d3db173d6983abdc1241c22219385c22df8b0eb8f1846c15ce1fee"}, + {file = "xattr-0.10.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f9be588a4b6043b03777d50654c6079af3da60cc37527dbb80d36ec98842b1e"}, + {file = "xattr-0.10.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7bc4ae264aa679aacf964abf3ea88e147eb4a22aea6af8c6d03ebdebd64cfd6"}, + {file = "xattr-0.10.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:827b5a97673b9997067fde383a7f7dc67342403093b94ea3c24ae0f4f1fec649"}, + {file = "xattr-0.10.1.tar.gz", hash = "sha256:c12e7d81ffaa0605b3ac8c22c2994a8e18a9cf1c59287a1b7722a2289c952ec5"}, +] + +[package.dependencies] +cffi = ">=1.0" + +[[package]] +name = "zipp" +version = "3.16.2" +description = "Backport of pathlib-compatible object wrapper for zip files" +optional = false +python-versions = ">=3.8" +files = [ + {file = "zipp-3.16.2-py3-none-any.whl", hash = "sha256:679e51dd4403591b2d6838a48de3d283f3d188412a9782faadf845f298736ba0"}, + {file = "zipp-3.16.2.tar.gz", hash = "sha256:ebc15946aa78bd63458992fc81ec3b6f7b1e92d51c35e6de1c3804e73b799147"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] + +[metadata] +lock-version = "2.0" +python-versions = "~3.11" +content-hash = "b3ef9f8c5445b3e481d666a4a3b6a73d44fa1159646cf64f480a19aa1999d0ee" diff --git a/voicevox_nemo_engine/presets.yaml b/voicevox_nemo_engine/presets.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0f554e61cba1005bba8af9de5bda1f1740ef4dbe --- /dev/null +++ b/voicevox_nemo_engine/presets.yaml @@ -0,0 +1,10 @@ +- id: 1 + name: サンプルプリセット + speaker_uuid: 7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff + style_id: 0 + speedScale: 1 + pitchScale: 0 + intonationScale: 1 + volumeScale: 1 + prePhonemeLength: 0.1 + postPhonemeLength: 0.1 diff --git a/voicevox_nemo_engine/pyproject.toml b/voicevox_nemo_engine/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..88926aa0a6baabffb4e0ba7dc9f74a1cbafa9fad --- /dev/null +++ b/voicevox_nemo_engine/pyproject.toml @@ -0,0 +1,84 @@ +[tool.pysen] +version = "0.10.5" + +[tool.pysen.lint] +enable_black = true +enable_flake8 = true +enable_isort = true +enable_mypy = false # TODO: eliminate errors and enable at CI +mypy_preset = "entry" # TODO: "strict" +line_length = 88 +py_version = "py311" +isort_known_first_party = ["voicevox_engine"] +isort_known_third_party = ["numpy"] +[[tool.pysen.lint.mypy_targets]] + paths = [".", "voicevox_engine/"] + +[tool.black] # automatically generated by pysen +# pysen ignores and overwrites any modifications +line-length = 88 +target-version = ["py310", "py311"] + + +[tool.isort] # automatically generated by pysen +# pysen ignores and overwrites any modifications +default_section = "THIRDPARTY" +ensure_newline_before_comments = true +force_grid_wrap = 0 +force_single_line = false +include_trailing_comma = true +known_first_party = ["voicevox_engine"] +known_third_party = ["numpy"] +line_length = 88 +multi_line_output = 3 +use_parentheses = true + +[tool.poetry] +name = "voicevox_engine" +version = "0.0.0" +description = "" +authors = ["Hiroshiba "] + +[tool.poetry.dependencies] +python = "~3.11" +numpy = "^1.20.0" +fastapi = "^0.103.2" +python-multipart = "^0.0.5" +uvicorn = "^0.15.0" +aiofiles = "^0.7.0" +soundfile = "^0.12.1" +pyyaml = "^6.0" +pyworld = "^0.3.0" +requests = "^2.28.1" +jinja2 = "^3.1.2" +pyopenjtalk = {git = "https://github.com/VOICEVOX/pyopenjtalk", rev = "b35fc89fe42948a28e33aed886ea145a51113f88"} +semver = "^3.0.0" +platformdirs = "^3.10.0" +soxr = "^0.3.6" + +[tool.poetry.group.dev.dependencies] +cython = "^0.29.34,>=0.29.33" # NOTE: for Python 3.11 +pyinstaller = "^5.13" +pre-commit = "^2.16.0" +atomicwrites = "^1.4.0" +colorama = "^0.4.4" +poetry = "^1.3.1" + +[tool.poetry.group.test.dependencies] +pysen = "~0.10.5" +black = "^22.12.0" +flake8-bugbear = "^23.1.0" +flake8 = "^6.0.0" +isort = "^5.12.0" +mypy = "^1.6.0" +pytest = "^6.2.5" +coveralls = "^3.2.0" +poetry = "^1.3.1" +httpx = "^0.25.0" # NOTE: required by fastapi.testclient.TestClient + +[tool.poetry.group.license.dependencies] +pip-licenses = "^4.2.0" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/voicevox_nemo_engine/requirements-dev.txt b/voicevox_nemo_engine/requirements-dev.txt new file mode 100644 index 0000000000000000000000000000000000000000..51806c4da80f6fcbc9ee57bff09a8a2222c20205 --- /dev/null +++ b/voicevox_nemo_engine/requirements-dev.txt @@ -0,0 +1,80 @@ +aiofiles==0.7.0 ; python_version >= "3.11" and python_version < "3.12" +altgraph==0.17.3 ; python_version >= "3.11" and python_version < "3.12" +anyio==3.7.1 ; python_version >= "3.11" and python_version < "3.12" +asgiref==3.7.2 ; python_version >= "3.11" and python_version < "3.12" +atomicwrites==1.4.1 ; python_version >= "3.11" and python_version < "3.12" +attrs==23.1.0 ; python_version >= "3.11" and python_version < "3.12" +build==0.10.0 ; python_version >= "3.11" and python_version < "3.12" +cachecontrol[filecache]==0.13.1 ; python_version >= "3.11" and python_version < "3.12" +certifi==2023.7.22 ; python_version >= "3.11" and python_version < "3.12" +cffi==1.15.1 ; python_version >= "3.11" and python_version < "3.12" +cfgv==3.4.0 ; python_version >= "3.11" and python_version < "3.12" +charset-normalizer==3.2.0 ; python_version >= "3.11" and python_version < "3.12" +cleo==2.0.1 ; python_version >= "3.11" and python_version < "3.12" +click==8.1.7 ; python_version >= "3.11" and python_version < "3.12" +colorama==0.4.6 ; python_version >= "3.11" and python_version < "3.12" +crashtest==0.4.1 ; python_version >= "3.11" and python_version < "3.12" +cryptography==41.0.3 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "linux" +cython==0.29.36 ; python_version >= "3.11" and python_version < "3.12" +distlib==0.3.7 ; python_version >= "3.11" and python_version < "3.12" +dulwich==0.21.5 ; python_version >= "3.11" and python_version < "3.12" +fastapi==0.103.2 ; python_version >= "3.11" and python_version < "3.12" +filelock==3.12.2 ; python_version >= "3.11" and python_version < "3.12" +h11==0.14.0 ; python_version >= "3.11" and python_version < "3.12" +identify==2.5.27 ; python_version >= "3.11" and python_version < "3.12" +idna==3.4 ; python_version >= "3.11" and python_version < "3.12" +importlib-metadata==6.8.0 ; python_version >= "3.11" and python_version < "3.12" +installer==0.7.0 ; python_version >= "3.11" and python_version < "3.12" +jaraco-classes==3.3.0 ; python_version >= "3.11" and python_version < "3.12" +jeepney==0.8.0 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "linux" +jinja2==3.1.2 ; python_version >= "3.11" and python_version < "3.12" +jsonschema==4.17.3 ; python_version >= "3.11" and python_version < "3.12" +keyring==24.2.0 ; python_version >= "3.11" and python_version < "3.12" +macholib==1.16.2 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "darwin" +markupsafe==2.1.3 ; python_version >= "3.11" and python_version < "3.12" +more-itertools==10.1.0 ; python_version >= "3.11" and python_version < "3.12" +msgpack==1.0.5 ; python_version >= "3.11" and python_version < "3.12" +nodeenv==1.8.0 ; python_version >= "3.11" and python_version < "3.12" +numpy==1.25.2 ; python_version >= "3.11" and python_version < "3.12" +packaging==23.1 ; python_version >= "3.11" and python_version < "3.12" +pefile==2023.2.7 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "win32" +pexpect==4.8.0 ; python_version >= "3.11" and python_version < "3.12" +pkginfo==1.9.6 ; python_version >= "3.11" and python_version < "3.12" +platformdirs==3.10.0 ; python_version >= "3.11" and python_version < "3.12" +poetry-core==1.7.0 ; python_version >= "3.11" and python_version < "3.12" +poetry-plugin-export==1.5.0 ; python_version >= "3.11" and python_version < "3.12" +poetry==1.6.1 ; python_version >= "3.11" and python_version < "3.12" +pre-commit==2.21.0 ; python_version >= "3.11" and python_version < "3.12" +ptyprocess==0.7.0 ; python_version >= "3.11" and python_version < "3.12" +pycparser==2.21 ; python_version >= "3.11" and python_version < "3.12" +pydantic==1.10.12 ; python_version >= "3.11" and python_version < "3.12" +pyinstaller-hooks-contrib==2023.7 ; python_version >= "3.11" and python_version < "3.12" +pyinstaller==5.13.2 ; python_version >= "3.11" and python_version < "3.12" +pyopenjtalk @ git+https://github.com/VOICEVOX/pyopenjtalk@b35fc89fe42948a28e33aed886ea145a51113f88 ; python_version >= "3.11" and python_version < "3.12" +pyproject-hooks==1.0.0 ; python_version >= "3.11" and python_version < "3.12" +pyrsistent==0.19.3 ; python_version >= "3.11" and python_version < "3.12" +python-multipart==0.0.5 ; python_version >= "3.11" and python_version < "3.12" +pywin32-ctypes==0.2.2 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "win32" +pyworld==0.3.4 ; python_version >= "3.11" and python_version < "3.12" +pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "3.12" +rapidfuzz==2.15.1 ; python_version >= "3.11" and python_version < "3.12" +requests-toolbelt==1.0.0 ; python_version >= "3.11" and python_version < "3.12" +requests==2.31.0 ; python_version >= "3.11" and python_version < "3.12" +secretstorage==3.3.3 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "linux" +semver==3.0.1 ; python_version >= "3.11" and python_version < "3.12" +setuptools==68.1.2 ; python_version >= "3.11" and python_version < "3.12" +shellingham==1.5.3 ; python_version >= "3.11" and python_version < "3.12" +six==1.16.0 ; python_version >= "3.11" and python_version < "3.12" +sniffio==1.3.0 ; python_version >= "3.11" and python_version < "3.12" +soundfile==0.12.1 ; python_version >= "3.11" and python_version < "3.12" +soxr==0.3.6 ; python_version >= "3.11" and python_version < "3.12" +starlette==0.27.0 ; python_version >= "3.11" and python_version < "3.12" +tomlkit==0.12.1 ; python_version >= "3.11" and python_version < "3.12" +tqdm==4.66.1 ; python_version >= "3.11" and python_version < "3.12" +trove-classifiers==2023.8.7 ; python_version >= "3.11" and python_version < "3.12" +typing-extensions==4.7.1 ; python_version >= "3.11" and python_version < "3.12" +urllib3==2.0.4 ; python_version >= "3.11" and python_version < "3.12" +uvicorn==0.15.0 ; python_version >= "3.11" and python_version < "3.12" +virtualenv==20.24.3 ; python_version >= "3.11" and python_version < "3.12" +xattr==0.10.1 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "darwin" +zipp==3.16.2 ; python_version >= "3.11" and python_version < "3.12" diff --git a/voicevox_nemo_engine/requirements-license.txt b/voicevox_nemo_engine/requirements-license.txt new file mode 100644 index 0000000000000000000000000000000000000000..9d58db2b5ed7588c23fec86eb0f24e8340f239ed --- /dev/null +++ b/voicevox_nemo_engine/requirements-license.txt @@ -0,0 +1,36 @@ +aiofiles==0.7.0 ; python_version >= "3.11" and python_version < "3.12" +anyio==3.7.1 ; python_version >= "3.11" and python_version < "3.12" +asgiref==3.7.2 ; python_version >= "3.11" and python_version < "3.12" +certifi==2023.7.22 ; python_version >= "3.11" and python_version < "3.12" +cffi==1.15.1 ; python_version >= "3.11" and python_version < "3.12" +charset-normalizer==3.2.0 ; python_version >= "3.11" and python_version < "3.12" +click==8.1.7 ; python_version >= "3.11" and python_version < "3.12" +colorama==0.4.6 ; python_version >= "3.11" and python_version < "3.12" and platform_system == "Windows" +cython==0.29.36 ; python_version >= "3.11" and python_version < "3.12" +fastapi==0.103.2 ; python_version >= "3.11" and python_version < "3.12" +h11==0.14.0 ; python_version >= "3.11" and python_version < "3.12" +idna==3.4 ; python_version >= "3.11" and python_version < "3.12" +jinja2==3.1.2 ; python_version >= "3.11" and python_version < "3.12" +markupsafe==2.1.3 ; python_version >= "3.11" and python_version < "3.12" +numpy==1.25.2 ; python_version >= "3.11" and python_version < "3.12" +pip-licenses==4.3.2 ; python_version >= "3.11" and python_version < "3.12" +platformdirs==3.10.0 ; python_version >= "3.11" and python_version < "3.12" +prettytable==3.8.0 ; python_version >= "3.11" and python_version < "3.12" +pycparser==2.21 ; python_version >= "3.11" and python_version < "3.12" +pydantic==1.10.12 ; python_version >= "3.11" and python_version < "3.12" +pyopenjtalk @ git+https://github.com/VOICEVOX/pyopenjtalk@b35fc89fe42948a28e33aed886ea145a51113f88 ; python_version >= "3.11" and python_version < "3.12" +python-multipart==0.0.5 ; python_version >= "3.11" and python_version < "3.12" +pyworld==0.3.4 ; python_version >= "3.11" and python_version < "3.12" +pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "3.12" +requests==2.31.0 ; python_version >= "3.11" and python_version < "3.12" +semver==3.0.1 ; python_version >= "3.11" and python_version < "3.12" +six==1.16.0 ; python_version >= "3.11" and python_version < "3.12" +sniffio==1.3.0 ; python_version >= "3.11" and python_version < "3.12" +soundfile==0.12.1 ; python_version >= "3.11" and python_version < "3.12" +soxr==0.3.6 ; python_version >= "3.11" and python_version < "3.12" +starlette==0.27.0 ; python_version >= "3.11" and python_version < "3.12" +tqdm==4.66.1 ; python_version >= "3.11" and python_version < "3.12" +typing-extensions==4.7.1 ; python_version >= "3.11" and python_version < "3.12" +urllib3==2.0.4 ; python_version >= "3.11" and python_version < "3.12" +uvicorn==0.15.0 ; python_version >= "3.11" and python_version < "3.12" +wcwidth==0.2.6 ; python_version >= "3.11" and python_version < "3.12" diff --git a/voicevox_nemo_engine/requirements-test.txt b/voicevox_nemo_engine/requirements-test.txt new file mode 100644 index 0000000000000000000000000000000000000000..6f891c187234a6e9b0599cec474a72e4f8b1407d --- /dev/null +++ b/voicevox_nemo_engine/requirements-test.txt @@ -0,0 +1,97 @@ +aiofiles==0.7.0 ; python_version >= "3.11" and python_version < "3.12" +anyio==3.7.1 ; python_version >= "3.11" and python_version < "3.12" +asgiref==3.7.2 ; python_version >= "3.11" and python_version < "3.12" +atomicwrites==1.4.1 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "win32" +attrs==23.1.0 ; python_version >= "3.11" and python_version < "3.12" +black==22.12.0 ; python_version >= "3.11" and python_version < "3.12" +build==0.10.0 ; python_version >= "3.11" and python_version < "3.12" +cachecontrol[filecache]==0.13.1 ; python_version >= "3.11" and python_version < "3.12" +certifi==2023.7.22 ; python_version >= "3.11" and python_version < "3.12" +cffi==1.15.1 ; python_version >= "3.11" and python_version < "3.12" +charset-normalizer==3.2.0 ; python_version >= "3.11" and python_version < "3.12" +cleo==2.0.1 ; python_version >= "3.11" and python_version < "3.12" +click==8.1.7 ; python_version >= "3.11" and python_version < "3.12" +colorama==0.4.6 ; python_version >= "3.11" and python_version < "3.12" and (sys_platform == "win32" or platform_system == "Windows" or os_name == "nt") +colorlog==4.8.0 ; python_version >= "3.11" and python_version < "3.12" +coverage==6.5.0 ; python_version >= "3.11" and python_version < "3.12" +coveralls==3.3.1 ; python_version >= "3.11" and python_version < "3.12" +crashtest==0.4.1 ; python_version >= "3.11" and python_version < "3.12" +cryptography==41.0.3 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "linux" +cython==0.29.36 ; python_version >= "3.11" and python_version < "3.12" +dacite==1.8.1 ; python_version >= "3.11" and python_version < "3.12" +distlib==0.3.7 ; python_version >= "3.11" and python_version < "3.12" +docopt==0.6.2 ; python_version >= "3.11" and python_version < "3.12" +dulwich==0.21.5 ; python_version >= "3.11" and python_version < "3.12" +fastapi==0.103.2 ; python_version >= "3.11" and python_version < "3.12" +filelock==3.12.2 ; python_version >= "3.11" and python_version < "3.12" +flake8-bugbear==23.7.10 ; python_version >= "3.11" and python_version < "3.12" +flake8==6.1.0 ; python_version >= "3.11" and python_version < "3.12" +gitdb==4.0.10 ; python_version >= "3.11" and python_version < "3.12" +gitpython==3.1.32 ; python_version >= "3.11" and python_version < "3.12" +h11==0.14.0 ; python_version >= "3.11" and python_version < "3.12" +httpcore==0.18.0 ; python_version >= "3.11" and python_version < "3.12" +httpx==0.25.0 ; python_version >= "3.11" and python_version < "3.12" +idna==3.4 ; python_version >= "3.11" and python_version < "3.12" +importlib-metadata==6.8.0 ; python_version >= "3.11" and python_version < "3.12" +iniconfig==2.0.0 ; python_version >= "3.11" and python_version < "3.12" +installer==0.7.0 ; python_version >= "3.11" and python_version < "3.12" +isort==5.12.0 ; python_version >= "3.11" and python_version < "3.12" +jaraco-classes==3.3.0 ; python_version >= "3.11" and python_version < "3.12" +jeepney==0.8.0 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "linux" +jinja2==3.1.2 ; python_version >= "3.11" and python_version < "3.12" +jsonschema==4.17.3 ; python_version >= "3.11" and python_version < "3.12" +keyring==24.2.0 ; python_version >= "3.11" and python_version < "3.12" +markupsafe==2.1.3 ; python_version >= "3.11" and python_version < "3.12" +mccabe==0.7.0 ; python_version >= "3.11" and python_version < "3.12" +more-itertools==10.1.0 ; python_version >= "3.11" and python_version < "3.12" +msgpack==1.0.5 ; python_version >= "3.11" and python_version < "3.12" +mypy-extensions==1.0.0 ; python_version >= "3.11" and python_version < "3.12" +mypy==1.6.0 ; python_version >= "3.11" and python_version < "3.12" +numpy==1.25.2 ; python_version >= "3.11" and python_version < "3.12" +packaging==23.1 ; python_version >= "3.11" and python_version < "3.12" +pathspec==0.11.2 ; python_version >= "3.11" and python_version < "3.12" +pexpect==4.8.0 ; python_version >= "3.11" and python_version < "3.12" +pkginfo==1.9.6 ; python_version >= "3.11" and python_version < "3.12" +platformdirs==3.10.0 ; python_version >= "3.11" and python_version < "3.12" +pluggy==1.2.0 ; python_version >= "3.11" and python_version < "3.12" +poetry-core==1.7.0 ; python_version >= "3.11" and python_version < "3.12" +poetry-plugin-export==1.5.0 ; python_version >= "3.11" and python_version < "3.12" +poetry==1.6.1 ; python_version >= "3.11" and python_version < "3.12" +ptyprocess==0.7.0 ; python_version >= "3.11" and python_version < "3.12" +py==1.11.0 ; python_version >= "3.11" and python_version < "3.12" +pycodestyle==2.11.0 ; python_version >= "3.11" and python_version < "3.12" +pycparser==2.21 ; python_version >= "3.11" and python_version < "3.12" +pydantic==1.10.12 ; python_version >= "3.11" and python_version < "3.12" +pyflakes==3.1.0 ; python_version >= "3.11" and python_version < "3.12" +pyopenjtalk @ git+https://github.com/VOICEVOX/pyopenjtalk@b35fc89fe42948a28e33aed886ea145a51113f88 ; python_version >= "3.11" and python_version < "3.12" +pyproject-hooks==1.0.0 ; python_version >= "3.11" and python_version < "3.12" +pyrsistent==0.19.3 ; python_version >= "3.11" and python_version < "3.12" +pysen==0.10.5 ; python_version >= "3.11" and python_version < "3.12" +pytest==6.2.5 ; python_version >= "3.11" and python_version < "3.12" +python-multipart==0.0.5 ; python_version >= "3.11" and python_version < "3.12" +pywin32-ctypes==0.2.2 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "win32" +pyworld==0.3.4 ; python_version >= "3.11" and python_version < "3.12" +pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "3.12" +rapidfuzz==2.15.1 ; python_version >= "3.11" and python_version < "3.12" +requests-toolbelt==1.0.0 ; python_version >= "3.11" and python_version < "3.12" +requests==2.31.0 ; python_version >= "3.11" and python_version < "3.12" +secretstorage==3.3.3 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "linux" +semver==3.0.1 ; python_version >= "3.11" and python_version < "3.12" +shellingham==1.5.3 ; python_version >= "3.11" and python_version < "3.12" +six==1.16.0 ; python_version >= "3.11" and python_version < "3.12" +smmap==5.0.0 ; python_version >= "3.11" and python_version < "3.12" +sniffio==1.3.0 ; python_version >= "3.11" and python_version < "3.12" +soundfile==0.12.1 ; python_version >= "3.11" and python_version < "3.12" +soxr==0.3.6 ; python_version >= "3.11" and python_version < "3.12" +starlette==0.27.0 ; python_version >= "3.11" and python_version < "3.12" +toml==0.10.2 ; python_version >= "3.11" and python_version < "3.12" +tomlkit==0.12.1 ; python_version >= "3.11" and python_version < "3.12" +tqdm==4.66.1 ; python_version >= "3.11" and python_version < "3.12" +trove-classifiers==2023.8.7 ; python_version >= "3.11" and python_version < "3.12" +typing-extensions==4.7.1 ; python_version >= "3.11" and python_version < "3.12" +unidiff==0.7.5 ; python_version >= "3.11" and python_version < "3.12" +urllib3==2.0.4 ; python_version >= "3.11" and python_version < "3.12" +uvicorn==0.15.0 ; python_version >= "3.11" and python_version < "3.12" +virtualenv==20.24.3 ; python_version >= "3.11" and python_version < "3.12" +xattr==0.10.1 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "darwin" +zipp==3.16.2 ; python_version >= "3.11" and python_version < "3.12" diff --git a/voicevox_nemo_engine/requirements.txt b/voicevox_nemo_engine/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..047c593c911f4c049019b9e3e2b86774ea1b3a2b --- /dev/null +++ b/voicevox_nemo_engine/requirements.txt @@ -0,0 +1,33 @@ +aiofiles==0.7.0 ; python_version >= "3.11" and python_version < "3.12" +anyio==3.7.1 ; python_version >= "3.11" and python_version < "3.12" +asgiref==3.7.2 ; python_version >= "3.11" and python_version < "3.12" +certifi==2023.7.22 ; python_version >= "3.11" and python_version < "3.12" +cffi==1.15.1 ; python_version >= "3.11" and python_version < "3.12" +charset-normalizer==3.2.0 ; python_version >= "3.11" and python_version < "3.12" +click==8.1.7 ; python_version >= "3.11" and python_version < "3.12" +colorama==0.4.6 ; python_version >= "3.11" and python_version < "3.12" and platform_system == "Windows" +cython==0.29.36 ; python_version >= "3.11" and python_version < "3.12" +fastapi==0.103.2 ; python_version >= "3.11" and python_version < "3.12" +h11==0.14.0 ; python_version >= "3.11" and python_version < "3.12" +idna==3.4 ; python_version >= "3.11" and python_version < "3.12" +jinja2==3.1.2 ; python_version >= "3.11" and python_version < "3.12" +markupsafe==2.1.3 ; python_version >= "3.11" and python_version < "3.12" +numpy==1.25.2 ; python_version >= "3.11" and python_version < "3.12" +platformdirs==3.10.0 ; python_version >= "3.11" and python_version < "3.12" +pycparser==2.21 ; python_version >= "3.11" and python_version < "3.12" +pydantic==1.10.12 ; python_version >= "3.11" and python_version < "3.12" +pyopenjtalk @ git+https://github.com/VOICEVOX/pyopenjtalk@b35fc89fe42948a28e33aed886ea145a51113f88 ; python_version >= "3.11" and python_version < "3.12" +python-multipart==0.0.5 ; python_version >= "3.11" and python_version < "3.12" +pyworld==0.3.4 ; python_version >= "3.11" and python_version < "3.12" +pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "3.12" +requests==2.31.0 ; python_version >= "3.11" and python_version < "3.12" +semver==3.0.1 ; python_version >= "3.11" and python_version < "3.12" +six==1.16.0 ; python_version >= "3.11" and python_version < "3.12" +sniffio==1.3.0 ; python_version >= "3.11" and python_version < "3.12" +soundfile==0.12.1 ; python_version >= "3.11" and python_version < "3.12" +soxr==0.3.6 ; python_version >= "3.11" and python_version < "3.12" +starlette==0.27.0 ; python_version >= "3.11" and python_version < "3.12" +tqdm==4.66.1 ; python_version >= "3.11" and python_version < "3.12" +typing-extensions==4.7.1 ; python_version >= "3.11" and python_version < "3.12" +urllib3==2.0.4 ; python_version >= "3.11" and python_version < "3.12" +uvicorn==0.15.0 ; python_version >= "3.11" and python_version < "3.12" diff --git a/voicevox_nemo_engine/run.py b/voicevox_nemo_engine/run.py new file mode 100644 index 0000000000000000000000000000000000000000..6bbd30dd06ad7e6ccbaf55350eddef730970bbea --- /dev/null +++ b/voicevox_nemo_engine/run.py @@ -0,0 +1,1461 @@ +import argparse +import asyncio +import base64 +import json +import multiprocessing +import os +import re +import sys +import traceback +import warnings +import zipfile +from functools import lru_cache +from io import BytesIO, TextIOWrapper +from pathlib import Path +from tempfile import NamedTemporaryFile, TemporaryFile +from typing import Any, Dict, List, Optional + +import soundfile +import uvicorn +from fastapi import FastAPI, Form, HTTPException, Query, Request, Response +from fastapi.middleware.cors import CORSMiddleware +from fastapi.openapi.utils import get_openapi +from fastapi.responses import JSONResponse +from fastapi.templating import Jinja2Templates +from pydantic import ValidationError, conint +from starlette.background import BackgroundTask +from starlette.responses import FileResponse + +from voicevox_engine import __version__ +from voicevox_engine.cancellable_engine import CancellableEngine +from voicevox_engine.downloadable_library import LibraryManager +from voicevox_engine.engine_manifest import EngineManifestLoader +from voicevox_engine.engine_manifest.EngineManifest import EngineManifest +from voicevox_engine.kana_parser import create_kana, parse_kana +from voicevox_engine.metas.MetasStore import MetasStore, construct_lookup +from voicevox_engine.model import ( + AccentPhrase, + AudioQuery, + DownloadableLibrary, + InstalledLibrary, + MorphableTargetInfo, + ParseKanaBadRequest, + ParseKanaError, + Speaker, + SpeakerInfo, + StyleIdNotFoundError, + SupportedDevicesInfo, + UserDictWord, + VvlibManifest, + WordTypes, +) +from voicevox_engine.morphing import ( + get_morphable_targets, + is_synthesis_morphing_permitted, + synthesis_morphing, +) +from voicevox_engine.morphing import ( + synthesis_morphing_parameter as _synthesis_morphing_parameter, +) +from voicevox_engine.part_of_speech_data import MAX_PRIORITY, MIN_PRIORITY +from voicevox_engine.preset import Preset, PresetError, PresetManager +from voicevox_engine.setting import ( + USER_SETTING_PATH, + CorsPolicyMode, + Setting, + SettingLoader, +) +from voicevox_engine.synthesis_engine import SynthesisEngineBase, make_synthesis_engines +from voicevox_engine.user_dict import ( + apply_word, + delete_word, + import_user_dict, + read_dict, + rewrite_word, + update_dict, +) +from voicevox_engine.utility import ( + ConnectBase64WavesException, + connect_base64_waves, + delete_file, + engine_root, + get_latest_core_version, + get_save_dir, +) + + +def get_style_id_from_deprecated(style_id: int | None, speaker_id: int | None) -> int: + """ + style_idとspeaker_id両方ともNoneかNoneでないかをチェックし、 + どちらか片方しかNoneが存在しなければstyle_idを返す + """ + if speaker_id is not None and style_id is None: + warnings.warn("speakerは非推奨です。style_idを利用してください。", stacklevel=1) + return speaker_id + elif style_id is not None and speaker_id is None: + return style_id + raise HTTPException( + status_code=400, detail="speakerとstyle_idが両方とも存在しないか、両方とも存在しています。" + ) + + +def b64encode_str(s): + return base64.b64encode(s).decode("utf-8") + + +def set_output_log_utf8() -> None: + """ + stdout/stderrのエンコーディングをUTF-8に切り替える関数 + """ + # コンソールがない環境だとNone https://docs.python.org/ja/3/library/sys.html#sys.__stdin__ + if sys.stdout is not None: + # 必ずしもreconfigure()が実装されているとは限らない + try: + sys.stdout.reconfigure(encoding="utf-8") + except AttributeError: + # バッファを全て出力する + sys.stdout.flush() + sys.stdout = TextIOWrapper( + sys.stdout.buffer, encoding="utf-8", errors="backslashreplace" + ) + if sys.stderr is not None: + try: + sys.stderr.reconfigure(encoding="utf-8") + except AttributeError: + sys.stderr.flush() + sys.stderr = TextIOWrapper( + sys.stderr.buffer, encoding="utf-8", errors="backslashreplace" + ) + + +def generate_app( + synthesis_engines: Dict[str, SynthesisEngineBase], + latest_core_version: str, + setting_loader: SettingLoader, + preset_manager: PresetManager, + cancellable_engine: CancellableEngine | None = None, + root_dir: Optional[Path] = None, + cors_policy_mode: CorsPolicyMode = CorsPolicyMode.localapps, + allow_origin: Optional[List[str]] = None, +) -> FastAPI: + if root_dir is None: + root_dir = engine_root() + + default_sampling_rate = synthesis_engines[latest_core_version].default_sampling_rate + + app = FastAPI( + title="VOICEVOX Engine", + description="VOICEVOXの音声合成エンジンです。", + version=__version__, + ) + + # CORS用のヘッダを生成するミドルウェア + localhost_regex = "^https?://(localhost|127\\.0\\.0\\.1)(:[0-9]+)?$" + compiled_localhost_regex = re.compile(localhost_regex) + allowed_origins = ["*"] + if cors_policy_mode == "localapps": + allowed_origins = ["app://."] + if allow_origin is not None: + allowed_origins += allow_origin + if "*" in allow_origin: + print( + 'WARNING: Deprecated use of argument "*" in allow_origin. ' + 'Use option "--cors_policy_mod all" instead. See "--help" for more.', + file=sys.stderr, + ) + + app.add_middleware( + CORSMiddleware, + allow_origins=allowed_origins, + allow_credentials=True, + allow_origin_regex=localhost_regex, + allow_methods=["*"], + allow_headers=["*"], + ) + + # 許可されていないOriginを遮断するミドルウェア + @app.middleware("http") + async def block_origin_middleware(request: Request, call_next): + isValidOrigin: bool = False + if "Origin" not in request.headers: # Originのない純粋なリクエストの場合 + isValidOrigin = True + elif "*" in allowed_origins: # すべてを許可する設定の場合 + isValidOrigin = True + elif request.headers["Origin"] in allowed_origins: # Originが許可されている場合 + isValidOrigin = True + elif compiled_localhost_regex.fullmatch( + request.headers["Origin"] + ): # localhostの場合 + isValidOrigin = True + + if isValidOrigin: + return await call_next(request) + else: + return JSONResponse( + status_code=403, content={"detail": "Origin not allowed"} + ) + + engine_manifest_data = EngineManifestLoader( + engine_root() / "engine_manifest.json", engine_root() + ).load_manifest() + library_manager = LibraryManager( + get_save_dir() / "installed_libraries", + engine_manifest_data.supported_vvlib_manifest_version, + engine_manifest_data.brand_name, + engine_manifest_data.name, + engine_manifest_data.uuid, + ) + + metas_store = MetasStore(root_dir / "speaker_info") + + setting_ui_template = Jinja2Templates(directory=engine_root() / "ui_template") + + # キャッシュを有効化 + # モジュール側でlru_cacheを指定するとキャッシュを制御しにくいため、HTTPサーバ側で指定する + # TODO: キャッシュを管理するモジュール側API・HTTP側APIを用意する + synthesis_morphing_parameter = lru_cache(maxsize=4)(_synthesis_morphing_parameter) + + # @app.on_event("startup") + # async def start_catch_disconnection(): + # if cancellable_engine is not None: + # loop = asyncio.get_event_loop() + # _ = loop.create_task(cancellable_engine.catch_disconnection()) + + @app.on_event("startup") + def apply_user_dict(): + update_dict() + + def get_engine(core_version: Optional[str]) -> SynthesisEngineBase: + if core_version is None: + return synthesis_engines[latest_core_version] + if core_version in synthesis_engines: + return synthesis_engines[core_version] + raise HTTPException(status_code=422, detail="不明なバージョンです") + + @app.post( + "/audio_query", + response_model=AudioQuery, + tags=["クエリ作成"], + summary="音声合成用のクエリを作成する", + ) + def audio_query( + text: str, + style_id: int | None = Query(default=None), # noqa: B008 + speaker: int | None = Query(default=None, deprecated=True), # noqa: B008 + core_version: str | None = None, + ) -> AudioQuery: + """ + クエリの初期値を得ます。ここで得られたクエリはそのまま音声合成に利用できます。各値の意味は`Schemas`を参照してください。 + """ + style_id = get_style_id_from_deprecated(style_id=style_id, speaker_id=speaker) + engine = get_engine(core_version) + accent_phrases = engine.create_accent_phrases(text, style_id=style_id) + return AudioQuery( + accent_phrases=accent_phrases, + speedScale=1, + pitchScale=0, + intonationScale=1, + volumeScale=1, + prePhonemeLength=0.1, + postPhonemeLength=0.1, + outputSamplingRate=default_sampling_rate, + outputStereo=False, + kana=create_kana(accent_phrases), + ) + + @app.post( + "/audio_query_from_preset", + response_model=AudioQuery, + tags=["クエリ作成"], + summary="音声合成用のクエリをプリセットを用いて作成する", + ) + def audio_query_from_preset( + text: str, + preset_id: int, + core_version: str | None = None, + ) -> AudioQuery: + """ + クエリの初期値を得ます。ここで得られたクエリはそのまま音声合成に利用できます。各値の意味は`Schemas`を参照してください。 + """ + engine = get_engine(core_version) + try: + presets = preset_manager.load_presets() + except PresetError as err: + raise HTTPException(status_code=422, detail=str(err)) + for preset in presets: + if preset.id == preset_id: + selected_preset = preset + break + else: + raise HTTPException(status_code=422, detail="該当するプリセットIDが見つかりません") + + accent_phrases = engine.create_accent_phrases( + text, style_id=selected_preset.style_id + ) + return AudioQuery( + accent_phrases=accent_phrases, + speedScale=selected_preset.speedScale, + pitchScale=selected_preset.pitchScale, + intonationScale=selected_preset.intonationScale, + volumeScale=selected_preset.volumeScale, + prePhonemeLength=selected_preset.prePhonemeLength, + postPhonemeLength=selected_preset.postPhonemeLength, + outputSamplingRate=default_sampling_rate, + outputStereo=False, + kana=create_kana(accent_phrases), + ) + + @app.post( + "/accent_phrases", + response_model=list[AccentPhrase], + tags=["クエリ編集"], + summary="テキストからアクセント句を得る", + responses={ + 400: { + "description": "読み仮名のパースに失敗", + "model": ParseKanaBadRequest, + } + }, + ) + def accent_phrases( + text: str, + style_id: int | None = Query(default=None), # noqa: B008 + speaker: int | None = Query(default=None, deprecated=True), # noqa: B008 + is_kana: bool = False, + core_version: str | None = None, + ) -> list[AccentPhrase]: + """ + テキストからアクセント句を得ます。 + is_kanaが`true`のとき、テキストは次のようなAquesTalkライクな記法に従う読み仮名として処理されます。デフォルトは`false`です。 + * 全てのカナはカタカナで記述される + * アクセント句は`/`または`、`で区切る。`、`で区切った場合に限り無音区間が挿入される。 + * カナの手前に`_`を入れるとそのカナは無声化される + * アクセント位置を`'`で指定する。全てのアクセント句にはアクセント位置を1つ指定する必要がある。 + * アクセント句末に`?`(全角)を入れることにより疑問文の発音ができる。 + """ + style_id = get_style_id_from_deprecated(style_id=style_id, speaker_id=speaker) + engine = get_engine(core_version) + if is_kana: + try: + accent_phrases = parse_kana(text) + except ParseKanaError as err: + raise HTTPException( + status_code=400, + detail=ParseKanaBadRequest(err).dict(), + ) + accent_phrases = engine.replace_mora_data( + accent_phrases=accent_phrases, style_id=style_id + ) + + return accent_phrases + else: + return engine.create_accent_phrases(text, style_id=style_id) + + @app.post( + "/mora_data", + response_model=list[AccentPhrase], + tags=["クエリ編集"], + summary="アクセント句から音高・音素長を得る", + ) + def mora_data( + accent_phrases: list[AccentPhrase], + style_id: int | None = Query(default=None), # noqa: B008 + speaker: int | None = Query(default=None, deprecated=True), # noqa: B008 + core_version: str | None = None, + ) -> list[AccentPhrase]: + style_id = get_style_id_from_deprecated(style_id=style_id, speaker_id=speaker) + engine = get_engine(core_version) + return engine.replace_mora_data(accent_phrases, style_id=style_id) + + @app.post( + "/mora_length", + response_model=list[AccentPhrase], + tags=["クエリ編集"], + summary="アクセント句から音素長を得る", + ) + def mora_length( + accent_phrases: list[AccentPhrase], + style_id: int | None = Query(default=None), # noqa: B008 + speaker: int | None = Query(default=None, deprecated=True), # noqa: B008 + core_version: str | None = None, + ) -> list[AccentPhrase]: + style_id = get_style_id_from_deprecated(style_id=style_id, speaker_id=speaker) + engine = get_engine(core_version) + return engine.replace_phoneme_length( + accent_phrases=accent_phrases, style_id=style_id + ) + + @app.post( + "/mora_pitch", + response_model=list[AccentPhrase], + tags=["クエリ編集"], + summary="アクセント句から音高を得る", + ) + def mora_pitch( + accent_phrases: list[AccentPhrase], + style_id: int | None = Query(default=None), # noqa: B008 + speaker: int | None = Query(default=None, deprecated=True), # noqa: B008 + core_version: str | None = None, + ) -> list[AccentPhrase]: + style_id = get_style_id_from_deprecated(style_id=style_id, speaker_id=speaker) + engine = get_engine(core_version) + return engine.replace_mora_pitch( + accent_phrases=accent_phrases, style_id=style_id + ) + + @app.post( + "/synthesis", + response_class=FileResponse, + responses={ + 200: { + "content": { + "audio/wav": {"schema": {"type": "string", "format": "binary"}} + }, + } + }, + tags=["音声合成"], + summary="音声合成する", + ) + def synthesis( + query: AudioQuery, + style_id: int | None = Query(default=None), # noqa: B008 + speaker: int | None = Query(default=None, deprecated=True), # noqa: B008 + enable_interrogative_upspeak: bool = Query( # noqa: B008 + default=True, + description="疑問系のテキストが与えられたら語尾を自動調整する", + ), + core_version: str | None = None, + ) -> FileResponse: + style_id = get_style_id_from_deprecated(style_id=style_id, speaker_id=speaker) + engine = get_engine(core_version) + wave = engine.synthesis( + query=query, + style_id=style_id, + enable_interrogative_upspeak=enable_interrogative_upspeak, + ) + + with NamedTemporaryFile(delete=False) as f: + soundfile.write( + file=f, data=wave, samplerate=query.outputSamplingRate, format="WAV" + ) + + return FileResponse( + f.name, + media_type="audio/wav", + background=BackgroundTask(delete_file, f.name), + ) + + @app.post( + "/cancellable_synthesis", + response_class=FileResponse, + responses={ + 200: { + "content": { + "audio/wav": {"schema": {"type": "string", "format": "binary"}} + }, + } + }, + tags=["音声合成"], + summary="音声合成する(キャンセル可能)", + ) + def cancellable_synthesis( + query: AudioQuery, + request: Request, + style_id: int | None = Query(default=None), # noqa: B008 + speaker: int | None = Query(default=None, deprecated=True), # noqa: B008 + core_version: str | None = None, + ) -> FileResponse: + style_id = get_style_id_from_deprecated(style_id=style_id, speaker_id=speaker) + if cancellable_engine is None: + raise HTTPException( + status_code=404, + detail="実験的機能はデフォルトで無効になっています。使用するには引数を指定してください。", + ) + f_name = cancellable_engine._synthesis_impl( + query=query, + style_id=style_id, + request=request, + core_version=core_version, + ) + if f_name == "": + raise HTTPException(status_code=422, detail="不明なバージョンです") + + return FileResponse( + f_name, + media_type="audio/wav", + background=BackgroundTask(delete_file, f_name), + ) + + @app.post( + "/multi_synthesis", + response_class=FileResponse, + responses={ + 200: { + "content": { + "application/zip": { + "schema": {"type": "string", "format": "binary"} + } + }, + } + }, + tags=["音声合成"], + summary="複数まとめて音声合成する", + ) + def multi_synthesis( + queries: list[AccentPhrase], + style_id: int | None = Query(default=None), # noqa: B008 + speaker: int | None = Query(default=None, deprecated=True), # noqa: B008 + core_version: str | None = None, + ) -> FileResponse: + style_id = get_style_id_from_deprecated(style_id=style_id, speaker_id=speaker) + engine = get_engine(core_version) + sampling_rate = queries[0].outputSamplingRate + + with NamedTemporaryFile(delete=False) as f: + with zipfile.ZipFile(f, mode="a") as zip_file: + for i in range(len(queries)): + if queries[i].outputSamplingRate != sampling_rate: + raise HTTPException( + status_code=422, detail="サンプリングレートが異なるクエリがあります" + ) + + with TemporaryFile() as wav_file: + wave = engine.synthesis(query=queries[i], style_id=style_id) + soundfile.write( + file=wav_file, + data=wave, + samplerate=sampling_rate, + format="WAV", + ) + wav_file.seek(0) + zip_file.writestr(f"{str(i + 1).zfill(3)}.wav", wav_file.read()) + + return FileResponse( + f.name, + media_type="application/zip", + background=BackgroundTask(delete_file, f.name), + ) + + @app.post( + "/morphable_targets", + response_model=list[dict[str, MorphableTargetInfo]], + tags=["音声合成"], + summary="指定した話者に対してエンジン内の話者がモーフィングが可能か判定する", + ) + def morphable_targets( + base_speakers: list[int], + core_version: str | None = None, + ) -> list[dict[str, MorphableTargetInfo]]: + """ + 指定されたベース話者に対してエンジン内の各話者がモーフィング機能を利用可能か返します。 + モーフィングの許可/禁止は`/speakers`の`speaker.supported_features.synthesis_morphing`に記載されています。 + プロパティが存在しない場合は、モーフィングが許可されているとみなします。 + 返り値の話者はstring型なので注意。 + """ + engine = get_engine(core_version) + + try: + speakers = metas_store.load_combined_metas(engine=engine) + morphable_targets = get_morphable_targets( + speakers=speakers, base_speakers=base_speakers + ) + # jsonはint型のキーを持てないので、string型に変換する + return [ + {str(k): v for k, v in morphable_target.items()} + for morphable_target in morphable_targets + ] + except StyleIdNotFoundError as e: + raise HTTPException( + status_code=404, detail=f"該当するスタイル(style_id={e.style_id})が見つかりません" + ) + + @app.post( + "/synthesis_morphing", + response_class=FileResponse, + responses={ + 200: { + "content": { + "audio/wav": {"schema": {"type": "string", "format": "binary"}} + }, + } + }, + tags=["音声合成"], + summary="2人の話者でモーフィングした音声を合成する", + ) + def _synthesis_morphing( + query: AudioQuery, + base_speaker: int, + target_speaker: int, + morph_rate: float = Query(..., ge=0.0, le=1.0), # noqa: B008 + core_version: str | None = None, + ) -> FileResponse: + """ + 指定された2人の話者で音声を合成、指定した割合でモーフィングした音声を得ます。 + モーフィングの割合は`morph_rate`で指定でき、0.0でベースの話者、1.0でターゲットの話者に近づきます。 + """ + engine = get_engine(core_version) + + try: + speakers = metas_store.load_combined_metas(engine=engine) + speaker_lookup = construct_lookup(speakers=speakers) + is_permitted = is_synthesis_morphing_permitted( + speaker_lookup, base_speaker, target_speaker + ) + if not is_permitted: + raise HTTPException( + status_code=400, + detail="指定された話者ペアでのモーフィングはできません", + ) + except StyleIdNotFoundError as e: + raise HTTPException( + status_code=404, detail=f"該当するスタイル(style_id={e.style_id})が見つかりません" + ) + + # 生成したパラメータはキャッシュされる + morph_param = synthesis_morphing_parameter( + engine=engine, + query=query, + base_speaker=base_speaker, + target_speaker=target_speaker, + ) + + morph_wave = synthesis_morphing( + morph_param=morph_param, + morph_rate=morph_rate, + output_fs=query.outputSamplingRate, + output_stereo=query.outputStereo, + ) + + with NamedTemporaryFile(delete=False) as f: + soundfile.write( + file=f, + data=morph_wave, + samplerate=query.outputSamplingRate, + format="WAV", + ) + + return FileResponse( + f.name, + media_type="audio/wav", + background=BackgroundTask(delete_file, f.name), + ) + + @app.post( + "/connect_waves", + response_class=FileResponse, + responses={ + 200: { + "content": { + "audio/wav": {"schema": {"type": "string", "format": "binary"}} + }, + } + }, + tags=["その他"], + summary="base64エンコードされた複数のwavデータを一つに結合する", + ) + def connect_waves(waves: list[str]) -> FileResponse: + """ + base64エンコードされたwavデータを一纏めにし、wavファイルで返します。 + """ + try: + waves_nparray, sampling_rate = connect_base64_waves(waves) + except ConnectBase64WavesException as err: + raise HTTPException(status_code=422, detail=str(err)) + + with NamedTemporaryFile(delete=False) as f: + soundfile.write( + file=f, + data=waves_nparray, + samplerate=sampling_rate, + format="WAV", + ) + + return FileResponse( + f.name, + media_type="audio/wav", + background=BackgroundTask(delete_file, f.name), + ) + + @app.get("/presets", response_model=list[Preset], tags=["その他"]) + def get_presets() -> list[Preset]: + """ + エンジンが保持しているプリセットの設定を返します + + Returns + ------- + presets: list[Preset] + プリセットのリスト + """ + try: + presets = preset_manager.load_presets() + except PresetError as err: + raise HTTPException(status_code=422, detail=str(err)) + return presets + + @app.post("/add_preset", response_model=int, tags=["その他"]) + def add_preset(preset: Preset) -> int: + """ + 新しいプリセットを追加します + + Parameters + ------- + preset: Preset + 新しいプリセット。 + プリセットIDが既存のものと重複している場合は、新規のプリセットIDが採番されます。 + + Returns + ------- + id: int + 追加したプリセットのプリセットID + """ + try: + id = preset_manager.add_preset(preset) + except PresetError as err: + raise HTTPException(status_code=422, detail=str(err)) + return id + + @app.post("/update_preset", response_model=int, tags=["その他"]) + def update_preset(preset: Preset) -> int: + """ + 既存のプリセットを更新します + + Parameters + ------- + preset: Preset + 更新するプリセット。 + プリセットIDが更新対象と一致している必要があります。 + + Returns + ------- + id: int + 更新したプリセットのプリセットID + """ + try: + id = preset_manager.update_preset(preset) + except PresetError as err: + raise HTTPException(status_code=422, detail=str(err)) + return id + + @app.post("/delete_preset", status_code=204, tags=["その他"]) + def delete_preset(id: int) -> Response: + """ + 既存のプリセットを削除します + + Parameters + ------- + id: int + 削除するプリセットのプリセットID + + """ + try: + preset_manager.delete_preset(id) + except PresetError as err: + raise HTTPException(status_code=422, detail=str(err)) + return Response(status_code=204) + + @app.get("/version", tags=["その他"]) + def version() -> str: + return __version__ + + @app.get("/core_versions", response_model=list[str], tags=["その他"]) + def core_versions() -> Response: + return Response( + content=json.dumps(list(synthesis_engines.keys())), + media_type="application/json", + ) + + @app.get("/speakers", response_model=list[Speaker], tags=["その他"]) + def speakers( + core_version: str | None = None, + ) -> list[Speaker]: + engine = get_engine(core_version) + return metas_store.load_combined_metas(engine=engine) + + @app.get("/speaker_info", response_model=SpeakerInfo, tags=["その他"]) + def speaker_info( + speaker_uuid: str, + core_version: str | None = None, + ) -> dict[str, Any]: + """ + 指定されたspeaker_uuidに関する情報をjson形式で返します。 + 画像や音声はbase64エンコードされたものが返されます。 + + Returns + ------- + ret_data: SpeakerInfo + """ + speakers = json.loads(get_engine(core_version).speakers) + for i in range(len(speakers)): + if speakers[i]["speaker_uuid"] == speaker_uuid: + speaker = speakers[i] + break + else: + raise HTTPException(status_code=404, detail="該当する話者が見つかりません") + + try: + policy = (root_dir / f"speaker_info/{speaker_uuid}/policy.md").read_text( + "utf-8" + ) + portrait = b64encode_str( + (root_dir / f"speaker_info/{speaker_uuid}/portrait.png").read_bytes() + ) + style_infos = [] + for style in speaker["styles"]: + id = style["id"] + icon = b64encode_str( + ( + root_dir / f"speaker_info/{speaker_uuid}/icons/{id}.png" + ).read_bytes() + ) + style_portrait_path = ( + root_dir / f"speaker_info/{speaker_uuid}/portraits/{id}.png" + ) + style_portrait = ( + b64encode_str(style_portrait_path.read_bytes()) + if style_portrait_path.exists() + else None + ) + voice_samples = [ + b64encode_str( + ( + root_dir + / "speaker_info/{}/voice_samples/{}_{}.wav".format( + speaker_uuid, id, str(j + 1).zfill(3) + ) + ).read_bytes() + ) + for j in range(3) + ] + style_infos.append( + { + "id": id, + "icon": icon, + "portrait": style_portrait, + "voice_samples": voice_samples, + } + ) + except FileNotFoundError: + import traceback + + traceback.print_exc() + raise HTTPException(status_code=500, detail="追加情報が見つかりませんでした") + + ret_data = {"policy": policy, "portrait": portrait, "style_infos": style_infos} + return ret_data + + @app.get( + "/downloadable_libraries", + response_model=list[DownloadableLibrary], + tags=["音声ライブラリ管理"], + ) + def downloadable_libraries() -> list[DownloadableLibrary]: + """ + ダウンロード可能な音声ライブラリの情報を返します。 + + Returns + ------- + ret_data: list[DownloadableLibrary] + """ + if not engine_manifest_data.supported_features.manage_library: + raise HTTPException(status_code=404, detail="この機能は実装されていません") + return library_manager.downloadable_libraries() + + @app.get( + "/installed_libraries", + response_model=dict[str, InstalledLibrary], + tags=["音声ライブラリ管理"], + ) + def installed_libraries() -> dict[str, InstalledLibrary]: + """ + インストールした音声ライブラリの情報を返します。 + + Returns + ------- + ret_data: dict[str, InstalledLibrary] + """ + if not engine_manifest_data.supported_features.manage_library: + raise HTTPException(status_code=404, detail="この機能は実装されていません") + return library_manager.installed_libraries() + + @app.post( + "/install_library/{library_uuid}", + status_code=204, + tags=["音声ライブラリ管理"], + ) + async def install_library( + library_uuid: str, + request: Request, + ) -> Response: + """ + 音声ライブラリをインストールします。 + 音声ライブラリのZIPファイルをリクエストボディとして送信してください。 + + Parameters + ---------- + library_uuid: str + 音声ライブラリのID + """ + if not engine_manifest_data.supported_features.manage_library: + raise HTTPException(status_code=404, detail="この機能は実装されていません") + archive = BytesIO(await request.body()) + loop = asyncio.get_event_loop() + await loop.run_in_executor( + None, library_manager.install_library, library_uuid, archive + ) + return Response(status_code=204) + + @app.post( + "/uninstall_library/{library_uuid}", + status_code=204, + tags=["音声ライブラリ管理"], + ) + def uninstall_library(library_uuid: str) -> Response: + """ + 音声ライブラリをアンインストールします。 + + Parameters + ---------- + library_uuid: str + 音声ライブラリのID + """ + if not engine_manifest_data.supported_features.manage_library: + raise HTTPException(status_code=404, detail="この機能は実装されていません") + library_manager.uninstall_library(library_uuid) + return Response(status_code=204) + + @app.post("/initialize_style_id", status_code=204, tags=["その他"]) + def initialize_style_id( + style_id: int, + skip_reinit: bool = Query( # noqa: B008 + False, description="既に初期化済みのスタイルの再初期化をスキップするかどうか" + ), + core_version: str | None = None, + ) -> Response: + """ + 指定されたstyle_idのスタイルを初期化します。 + 実行しなくても他のAPIは使用できますが、初回実行時に時間がかかることがあります。 + """ + engine = get_engine(core_version) + engine.initialize_style_id_synthesis(style_id=style_id, skip_reinit=skip_reinit) + return Response(status_code=204) + + @app.get("/is_initialized_style_id", response_model=bool, tags=["その他"]) + def is_initialized_style_id( + style_id: int, + core_version: str | None = None, + ) -> bool: + """ + 指定されたstyle_idのスタイルが初期化されているかどうかを返します。 + """ + engine = get_engine(core_version) + return engine.is_initialized_style_id_synthesis(style_id) + + @app.post("/initialize_speaker", status_code=204, tags=["その他"], deprecated=True) + def initialize_speaker( + speaker: int, + skip_reinit: bool = Query( # noqa: B008 + False, description="既に初期化済みの話者の再初期化をスキップするかどうか" + ), + core_version: str | None = None, + ) -> Response: + """ + こちらのAPIは非推奨です。`initialize_style_id`を利用してください。\n + 指定されたspeaker_idの話者を初期化します。 + 実行しなくても他のAPIは使用できますが、初回実行時に時間がかかることがあります。 + """ + warnings.warn( + "使用しているAPI(/initialize_speaker)は非推奨です。/initialized_style_idを利用してください。", + stacklevel=1, + ) + return initialize_style_id( + style_id=speaker, skip_reinit=skip_reinit, core_version=core_version + ) + + @app.get( + "/is_initialized_speaker", response_model=bool, tags=["その他"], deprecated=True + ) + def is_initialized_speaker( + speaker: int, + core_version: str | None = None, + ) -> bool: + """ + こちらのAPIは非推奨です。`is_initialize_style_id`を利用してください。\n + 指定されたspeaker_idの話者が初期化されているかどうかを返します。 + """ + warnings.warn( + "使用しているAPI(/is_initialize_speaker)は非推奨です。/is_initialized_style_idを利用してください。", + stacklevel=1, + ) + return is_initialized_style_id(style_id=speaker, core_version=core_version) + + @app.get("/user_dict", response_model=dict[str, UserDictWord], tags=["ユーザー辞書"]) + def get_user_dict_words() -> dict[str, UserDictWord]: + """ + ユーザー辞書に登録されている単語の一覧を返します。 + 単語の表層形(surface)は正規化済みの物を返します。 + + Returns + ------- + dict[str, UserDictWord] + 単語のUUIDとその詳細 + """ + try: + return read_dict() + except Exception: + traceback.print_exc() + raise HTTPException(status_code=422, detail="辞書の読み込みに失敗しました。") + + @app.post("/user_dict_word", response_model=str, tags=["ユーザー辞書"]) + def add_user_dict_word( + surface: str, + pronunciation: str, + accent_type: int, + word_type: WordTypes | None = None, + priority: conint(ge=MIN_PRIORITY, le=MAX_PRIORITY) | None = None, + ) -> Response: + """ + ユーザー辞書に言葉を追加します。 + + Parameters + ---------- + surface : str + 言葉の表層形 + pronunciation: str + 言葉の発音(カタカナ) + accent_type: int + アクセント型(音が下がる場所を指す) + word_type: WordTypes, optional + PROPER_NOUN(固有名詞)、COMMON_NOUN(普通名詞)、VERB(動詞)、ADJECTIVE(形容詞)、SUFFIX(語尾)のいずれか + priority: int, optional + 単語の優先度(0から10までの整数) + 数字が大きいほど優先度が高くなる + 1から9までの値を指定することを推奨 + """ + try: + word_uuid = apply_word( + surface=surface, + pronunciation=pronunciation, + accent_type=accent_type, + word_type=word_type, + priority=priority, + ) + return Response(content=word_uuid) + except ValidationError as e: + raise HTTPException(status_code=422, detail="パラメータに誤りがあります。\n" + str(e)) + except Exception: + traceback.print_exc() + raise HTTPException(status_code=422, detail="ユーザー辞書への追加に失敗しました。") + + @app.put("/user_dict_word/{word_uuid}", status_code=204, tags=["ユーザー辞書"]) + def rewrite_user_dict_word( + surface: str, + pronunciation: str, + accent_type: int, + word_uuid: str, + word_type: WordTypes | None = None, + priority: conint(ge=MIN_PRIORITY, le=MAX_PRIORITY) | None = None, + ) -> Response: + """ + ユーザー辞書に登録されている言葉を更新します。 + + Parameters + ---------- + surface : str + 言葉の表層形 + pronunciation: str + 言葉の発音(カタカナ) + accent_type: int + アクセント型(音が下がる場所を指す) + word_uuid: str + 更新する言葉のUUID + word_type: WordTypes, optional + PROPER_NOUN(固有名詞)、COMMON_NOUN(普通名詞)、VERB(動詞)、ADJECTIVE(形容詞)、SUFFIX(語尾)のいずれか + priority: int, optional + 単語の優先度(0から10までの整数) + 数字が大きいほど優先度が高くなる + 1から9までの値を指定することを推奨 + """ + try: + rewrite_word( + surface=surface, + pronunciation=pronunciation, + accent_type=accent_type, + word_uuid=word_uuid, + word_type=word_type, + priority=priority, + ) + return Response(status_code=204) + except HTTPException: + raise + except ValidationError as e: + raise HTTPException(status_code=422, detail="パラメータに誤りがあります。\n" + str(e)) + except Exception: + traceback.print_exc() + raise HTTPException(status_code=422, detail="ユーザー辞書の更新に失敗しました。") + + @app.delete("/user_dict_word/{word_uuid}", status_code=204, tags=["ユーザー辞書"]) + def delete_user_dict_word(word_uuid: str) -> Response: + """ + ユーザー辞書に登録されている言葉を削除します。 + + Parameters + ---------- + word_uuid: str + 削除する言葉のUUID + """ + try: + delete_word(word_uuid=word_uuid) + return Response(status_code=204) + except HTTPException: + raise + except Exception: + traceback.print_exc() + raise HTTPException(status_code=422, detail="ユーザー辞書の更新に失敗しました。") + + @app.post("/import_user_dict", status_code=204, tags=["ユーザー辞書"]) + def import_user_dict_words( + import_dict_data: dict[str, UserDictWord], + override: bool, + ) -> Response: + """ + 他のユーザー辞書をインポートします。 + + Parameters + ---------- + import_dict_data: dict[str, UserDictWord] + インポートするユーザー辞書のデータ + override: bool + 重複したエントリがあった場合、上書きするかどうか + """ + try: + import_user_dict(dict_data=import_dict_data, override=override) + return Response(status_code=204) + except Exception: + traceback.print_exc() + raise HTTPException(status_code=422, detail="ユーザー辞書のインポートに失敗しました。") + + @app.get("/supported_devices", response_model=SupportedDevicesInfo, tags=["その他"]) + def supported_devices( + core_version: str | None = None, + ) -> Response: + supported_devices = get_engine(core_version).supported_devices + if supported_devices is None: + raise HTTPException(status_code=422, detail="非対応の機能です。") + return Response( + content=supported_devices, + media_type="application/json", + ) + + @app.get("/engine_manifest", response_model=EngineManifest, tags=["その他"]) + def engine_manifest() -> EngineManifest: + return engine_manifest_data + + @app.post( + "/validate_kana", + response_model=bool, + tags=["その他"], + summary="テキストがAquesTalkライクな記法に従っているか判定する", + responses={ + 400: { + "description": "テキストが不正です", + "model": ParseKanaBadRequest, + } + }, + ) + def validate_kana(text: str) -> bool: + """ + テキストがAquesTalkライクな記法に従っているかどうかを判定します。 + 従っていない場合はエラーが返ります。 + + Parameters + ---------- + text: str + 判定する対象の文字列 + """ + try: + parse_kana(text) + return True + except ParseKanaError as err: + raise HTTPException( + status_code=400, + detail=ParseKanaBadRequest(err).dict(), + ) + + @app.get("/setting", response_class=Response, tags=["設定"]) + def setting_get(request: Request) -> Response: + settings = setting_loader.load_setting_file() + + cors_policy_mode = settings.cors_policy_mode + allow_origin = settings.allow_origin + + if allow_origin is None: + allow_origin = "" + + return setting_ui_template.TemplateResponse( + "ui.html", + { + "request": request, + "cors_policy_mode": cors_policy_mode, + "allow_origin": allow_origin, + }, + ) + + @app.post("/setting", response_class=Response, tags=["設定"]) + def setting_post( + request: Request, + cors_policy_mode: str | None = Form(None), # noqa: B008 + allow_origin: str | None = Form(None), # noqa: B008 + ) -> Response: + settings = Setting( + cors_policy_mode=cors_policy_mode, + allow_origin=allow_origin, + ) + + # 更新した設定へ上書き + setting_loader.dump_setting_file(settings) + + if allow_origin is None: + allow_origin = "" + + return setting_ui_template.TemplateResponse( + "ui.html", + { + "request": request, + "cors_policy_mode": cors_policy_mode, + "allow_origin": allow_origin, + }, + ) + + # VvlibManifestモデルはAPIとして表には出ないが、エディタ側で利用したいので、手動で追加する + # ref: https://fastapi.tiangolo.com/advanced/extending-openapi/#modify-the-openapi-schema + def custom_openapi(): + if app.openapi_schema: + return app.openapi_schema + openapi_schema = get_openapi( + title=app.title, + version=app.version, + description=app.description, + routes=app.routes, + tags=app.openapi_tags, + servers=app.servers, + terms_of_service=app.terms_of_service, + contact=app.contact, + license_info=app.license_info, + ) + openapi_schema["components"]["schemas"][ + "VvlibManifest" + ] = VvlibManifest.schema() + app.openapi_schema = openapi_schema + return openapi_schema + + app.openapi = custom_openapi + + return app + + +def main() -> None: + multiprocessing.freeze_support() + + output_log_utf8 = os.getenv("VV_OUTPUT_LOG_UTF8", default="") + if output_log_utf8 == "1": + set_output_log_utf8() + elif not (output_log_utf8 == "" or output_log_utf8 == "0"): + print( + "WARNING: invalid VV_OUTPUT_LOG_UTF8 environment variable value", + file=sys.stderr, + ) + + parser = argparse.ArgumentParser(description="VOICEVOX のエンジンです。") + parser.add_argument( + "--host", type=str, default="127.0.0.1", help="接続を受け付けるホストアドレスです。" + ) + parser.add_argument("--port", type=int, default=50121, help="接続を受け付けるポート番号です。") + parser.add_argument( + "--use_gpu", action="store_true", help="指定するとGPUを使って音声合成するようになります。" + ) + parser.add_argument( + "--voicevox_dir", type=Path, default=None, help="VOICEVOXのディレクトリパスです。" + ) + parser.add_argument( + "--voicelib_dir", + type=Path, + default=None, + action="append", + help="VOICEVOX COREのディレクトリパスです。", + ) + parser.add_argument( + "--runtime_dir", + type=Path, + default=None, + action="append", + help="VOICEVOX COREで使用するライブラリのディレクトリパスです。", + ) + parser.add_argument( + "--enable_mock", + action="store_true", + help="指定するとVOICEVOX COREを使わずモックで音声合成を行います。", + ) + parser.add_argument( + "--enable_cancellable_synthesis", + action="store_true", + help="指定すると音声合成を途中でキャンセルできるようになります。", + ) + parser.add_argument( + "--init_processes", + type=int, + default=2, + help="cancellable_synthesis機能の初期化時に生成するプロセス数です。", + ) + parser.add_argument( + "--load_all_models", action="store_true", help="指定すると起動時に全ての音声合成モデルを読み込みます。" + ) + + # 引数へ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, + help=( + "音声合成を行うスレッド数です。指定しないと、代わりに環境変数VV_CPU_NUM_THREADSの値が使われます。" + "VV_CPU_NUM_THREADSが空文字列でなく数値でもない場合はエラー終了します。" + ), + ) + + parser.add_argument( + "--output_log_utf8", + action="store_true", + help=( + "指定するとログ出力をUTF-8でおこないます。指定しないと、代わりに環境変数 VV_OUTPUT_LOG_UTF8 の値が使われます。" + "VV_OUTPUT_LOG_UTF8 の値が1の場合はUTF-8で、0または空文字、値がない場合は環境によって自動的に決定されます。" + ), + ) + + parser.add_argument( + "--cors_policy_mode", + type=CorsPolicyMode, + choices=list(CorsPolicyMode), + default=None, + help=( + "CORSの許可モード。allまたはlocalappsが指定できます。allはすべてを許可します。" + "localappsはオリジン間リソース共有ポリシーを、app://.とlocalhost関連に限定します。" + "その他のオリジンはallow_originオプションで追加できます。デフォルトはlocalapps。" + ), + ) + + parser.add_argument( + "--allow_origin", nargs="*", help="許可するオリジンを指定します。スペースで区切ることで複数指定できます。" + ) + + parser.add_argument( + "--setting_file", type=Path, default=USER_SETTING_PATH, help="設定ファイルを指定できます。" + ) + + parser.add_argument( + "--preset_file", + type=Path, + default=None, + help=( + "プリセットファイルを指定できます。" + "指定がない場合、環境変数 VV_PRESET_FILE、--voicevox_dirのpresets.yaml、" + "実行ファイルのディレクトリのpresets.yamlを順に探します。" + ), + ) + + args = parser.parse_args() + + if args.output_log_utf8: + set_output_log_utf8() + + # Synthesis Engine + use_gpu: bool = args.use_gpu + voicevox_dir: Path | None = args.voicevox_dir + voicelib_dirs: list[Path] | None = args.voicelib_dir + runtime_dirs: list[Path] | None = args.runtime_dir + enable_mock: bool = args.enable_mock + cpu_num_threads: int | None = args.cpu_num_threads + load_all_models: bool = args.load_all_models + + synthesis_engines = make_synthesis_engines( + use_gpu=use_gpu, + voicelib_dirs=voicelib_dirs, + voicevox_dir=voicevox_dir, + runtime_dirs=runtime_dirs, + cpu_num_threads=cpu_num_threads, + enable_mock=enable_mock, + load_all_models=load_all_models, + ) + assert len(synthesis_engines) != 0, "音声合成エンジンがありません。" + latest_core_version = get_latest_core_version(versions=synthesis_engines.keys()) + + # Cancellable Engine + enable_cancellable_synthesis: bool = args.enable_cancellable_synthesis + init_processes: int = args.init_processes + + cancellable_engine: CancellableEngine | None = None + if enable_cancellable_synthesis: + cancellable_engine = CancellableEngine( + init_processes=init_processes, + use_gpu=use_gpu, + voicelib_dirs=voicelib_dirs, + voicevox_dir=voicevox_dir, + runtime_dirs=runtime_dirs, + cpu_num_threads=cpu_num_threads, + enable_mock=enable_mock, + ) + + root_dir: Path | None = voicevox_dir + if root_dir is None: + root_dir = engine_root() + + setting_loader = SettingLoader(args.setting_file) + + settings = setting_loader.load_setting_file() + + cors_policy_mode: CorsPolicyMode | None = args.cors_policy_mode + if cors_policy_mode is None: + cors_policy_mode = settings.cors_policy_mode + + allow_origin = None + if args.allow_origin is not None: + allow_origin = args.allow_origin + elif settings.allow_origin is not None: + allow_origin = settings.allow_origin.split(" ") + + # Preset Manager + # preset_pathの優先順: 引数、環境変数、voicevox_dir、実行ファイルのディレクトリ + # ファイルの存在に関わらず、優先順で最初に指定されたパスをプリセットファイルとして使用する + preset_path: Path | None = args.preset_file + if preset_path is None: + # 引数 --preset_file の指定がない場合 + env_preset_path = os.getenv("VV_PRESET_FILE") + if env_preset_path is not None and len(env_preset_path) != 0: + # 環境変数 VV_PRESET_FILE の指定がある場合 + preset_path = Path(env_preset_path) + else: + # 環境変数 VV_PRESET_FILE の指定がない場合 + preset_path = root_dir / "presets.yaml" + + preset_manager = PresetManager( + preset_path=preset_path, + ) + + uvicorn.run( + generate_app( + synthesis_engines, + latest_core_version, + setting_loader, + preset_manager=preset_manager, + cancellable_engine=cancellable_engine, + root_dir=root_dir, + cors_policy_mode=cors_policy_mode, + allow_origin=allow_origin, + ), + host=args.host, + port=args.port, + ) + + +if __name__ == "__main__": + main() diff --git a/voicevox_nemo_engine/run.spec b/voicevox_nemo_engine/run.spec new file mode 100644 index 0000000000000000000000000000000000000000..b84c82408767acc4076df770f1b619502b94c3db --- /dev/null +++ b/voicevox_nemo_engine/run.spec @@ -0,0 +1,91 @@ +# -*- mode: python ; coding: utf-8 -*- +# このファイルはPyInstallerによって自動生成されたもので、それをカスタマイズして使用しています。 +from PyInstaller.utils.hooks import collect_data_files +import os + +datas = [ + ('engine_manifest_assets', 'engine_manifest_assets'), + ('speaker_info', 'speaker_info'), + ('engine_manifest.json', '.'), + ('default.csv', '.'), + ('licenses.json', '.'), + ('presets.yaml', '.'), + ('default_setting.yml', '.'), + ('ui_template', 'ui_template'), +] +datas += collect_data_files('pyopenjtalk') + +core_model_dir_path = os.environ.get('CORE_MODEL_DIR_PATH') +if core_model_dir_path: + print('CORE_MODEL_DIR_PATH is found:', core_model_dir_path) + if not os.path.isdir(core_model_dir_path): + raise Exception("CORE_MODEL_DIR_PATH was found, but it is not directory!") + datas += [(core_model_dir_path, "model")] + +# コアとONNX Runtimeはバイナリであるが、`binaries`に加えると +# 依存関係のパスがPyInstallerに書き換えらるので、`datas`に加える +# 参考: https://github.com/VOICEVOX/voicevox_engine/pull/446#issuecomment-1210052318 +libcore_path = os.environ.get('LIBCORE_PATH') +if libcore_path: + print('LIBCORE_PATH is found:', libcore_path) + if not os.path.isfile(libcore_path): + raise Exception("LIBCORE_PATH was found, but it is not file!") + datas += [(libcore_path, ".")] + +libonnxruntime_path = os.environ.get('LIBONNXRUNTIME_PATH') +if libonnxruntime_path: + print('LIBONNXRUNTIME_PATH is found:', libonnxruntime_path) + if not os.path.isfile(libonnxruntime_path): + raise Exception("LIBCORE_PATH was found, but it is not file!") + datas += [(libonnxruntime_path, ".")] + + +block_cipher = None + + +a = Analysis( + ['run.py'], + pathex=[], + binaries=[], + datas=datas, + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) + +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) + +exe = EXE( + pyz, + a.scripts, + [], + exclude_binaries=True, + name='run', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) + +coll = COLLECT( + exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='run', +) diff --git a/voicevox_nemo_engine/setup.cfg b/voicevox_nemo_engine/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..2a1a913e07ccb1c75d7b9561e4f548d3eee7643a --- /dev/null +++ b/voicevox_nemo_engine/setup.cfg @@ -0,0 +1,36 @@ +[flake8] +# automatically generated by pysen +# pysen ignores and overwrites any modifications +# e203: black treats : as a binary operator +# e231: black doesn't put a space after , +# e501: black may exceed the line-length to follow other style rules +# w503 or w504: either one needs to be disabled to select w error codes +ignore = E203,E231,E501,W503 +max-line-length = 88 +select = B,B950,C,E,F,W + +[mypy] +# automatically generated by pysen +# pysen ignores and overwrites any modifications +check_untyped_defs = True +disallow_any_decorated = False +disallow_any_generics = False +disallow_any_unimported = False +disallow_incomplete_defs = True +disallow_subclassing_any = True +disallow_untyped_calls = False +disallow_untyped_decorators = False +disallow_untyped_defs = False +ignore_errors = False +ignore_missing_imports = True +no_implicit_optional = True +python_version = 3.10 +show_error_codes = True +strict_equality = True +strict_optional = True +warn_redundant_casts = True +warn_return_any = False +warn_unreachable = True +warn_unused_configs = True +warn_unused_ignores = False + diff --git a/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/icons/8.png b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/icons/8.png new file mode 100644 index 0000000000000000000000000000000000000000..4cee4b8062d297f0e69218ecd2022890b333a013 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/icons/8.png differ diff --git a/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/metas.json b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/metas.json new file mode 100644 index 0000000000000000000000000000000000000000..577af6f5806b6294acccfdf500a0ba2df2d26f76 --- /dev/null +++ b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/metas.json @@ -0,0 +1,3 @@ +{ + "supported_features": { "permitted_synthesis_morphing": "NOTHING" } +} diff --git a/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/policy.md b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/policy.md new file mode 100644 index 0000000000000000000000000000000000000000..32a15afd7544b8cfecb727231432376aa8c9917e --- /dev/null +++ b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/policy.md @@ -0,0 +1,3 @@ +dummy3 policy + +https://voicevox.hiroshiba.jp/ diff --git a/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/portrait.png b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/portrait.png new file mode 100644 index 0000000000000000000000000000000000000000..f0d2a7254107ceb2f2b0767f4d17d0127c0330ea Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/portrait.png differ diff --git a/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/portraits/8.png b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/portraits/8.png new file mode 100644 index 0000000000000000000000000000000000000000..c399d6cb936b8778fa692ea2dc726cb0ee3c57d8 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/portraits/8.png differ diff --git a/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_001.wav b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_001.wav new file mode 100644 index 0000000000000000000000000000000000000000..6afbb4e3a695e2535dbbee75fb445c102cd2603f Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_001.wav differ diff --git a/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_002.wav b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_002.wav new file mode 100644 index 0000000000000000000000000000000000000000..aeea8d2445485529ee02f59b20ac09860e8e6999 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_002.wav differ diff --git a/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_003.wav b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_003.wav new file mode 100644 index 0000000000000000000000000000000000000000..2419bd9d9e7508a89d28d666706b5637340054af Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_003.wav differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/1.png b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/1.png new file mode 100644 index 0000000000000000000000000000000000000000..11af05543fbd6b1b255800190d6ef2d48f2f0c89 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/1.png differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/3.png b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/3.png new file mode 100644 index 0000000000000000000000000000000000000000..ff5032e911b1072232befd347efc6b8ae9e45b9e Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/3.png differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/5.png b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/5.png new file mode 100644 index 0000000000000000000000000000000000000000..3452a88fa39c935c056b26d933693e8cd24aefba Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/5.png differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/7.png b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/7.png new file mode 100644 index 0000000000000000000000000000000000000000..63b1e7e53296b1bc02366b0ecfba997ae5b0bde2 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/7.png differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/metas.json b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/metas.json new file mode 100644 index 0000000000000000000000000000000000000000..41570a1fc2e6b3f1ca0592a92ab71daf30f342d7 --- /dev/null +++ b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/metas.json @@ -0,0 +1,3 @@ +{ + "supported_features": { "permitted_synthesis_morphing": "SELF_ONLY" } +} diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/policy.md b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/policy.md new file mode 100644 index 0000000000000000000000000000000000000000..0328c63112a40f44145440562c8fe2d56ac86e38 --- /dev/null +++ b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/policy.md @@ -0,0 +1,3 @@ +dummy2 policy + +https://voicevox.hiroshiba.jp/ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/portrait.png b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/portrait.png new file mode 100644 index 0000000000000000000000000000000000000000..23970a6c67453ea010e837b97319d8497bdf0eff Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/portrait.png differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/portraits/3.png b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/portraits/3.png new file mode 100644 index 0000000000000000000000000000000000000000..8431858d7cc7a5d8f66720655e439e073d5b2f99 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/portraits/3.png differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/1_001.wav b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/1_001.wav new file mode 100644 index 0000000000000000000000000000000000000000..9b5bfa40f60526592528969635af09e3ddcebe81 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/1_001.wav differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/1_002.wav b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/1_002.wav new file mode 100644 index 0000000000000000000000000000000000000000..8736022ccc10942df0cefbdf844972009663207c Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/1_002.wav differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/1_003.wav b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/1_003.wav new file mode 100644 index 0000000000000000000000000000000000000000..3730464daeadd58085becdedd0cf0188d4dffcc8 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/1_003.wav differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/3_001.wav b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/3_001.wav new file mode 100644 index 0000000000000000000000000000000000000000..507acbaa6faf3d520b8b3dbe705571d51a4bf99c Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/3_001.wav differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/3_002.wav b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/3_002.wav new file mode 100644 index 0000000000000000000000000000000000000000..e14d80bcbcde0819dcb262bf2bfc118ddd1e8cb7 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/3_002.wav differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/3_003.wav b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/3_003.wav new file mode 100644 index 0000000000000000000000000000000000000000..8d42657c680e14589bc8e8f90ef1c52f92959107 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/3_003.wav differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/5_001.wav b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/5_001.wav new file mode 100644 index 0000000000000000000000000000000000000000..c616d692a65affdff488d9aef53b34cc1b32232e Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/5_001.wav differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/5_002.wav b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/5_002.wav new file mode 100644 index 0000000000000000000000000000000000000000..4086db4809326bd6689cb34ef8859fb49f862499 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/5_002.wav differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/5_003.wav b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/5_003.wav new file mode 100644 index 0000000000000000000000000000000000000000..d3823d9fd2fcbd4c46ab3d6547cdcbeb735bccf2 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/5_003.wav differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/7_001.wav b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/7_001.wav new file mode 100644 index 0000000000000000000000000000000000000000..88194d7e260bd62dd92f819a0d0e3deed852788b Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/7_001.wav differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/7_002.wav b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/7_002.wav new file mode 100644 index 0000000000000000000000000000000000000000..61d5a7eae88985a23b1e0b318dc26c75f33c88dc Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/7_002.wav differ diff --git a/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/7_003.wav b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/7_003.wav new file mode 100644 index 0000000000000000000000000000000000000000..71fcdbeaa2b495fe56bf894ddd9c89e9ab21ae00 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/voice_samples/7_003.wav differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/icons/0.png b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/icons/0.png new file mode 100644 index 0000000000000000000000000000000000000000..84cc0f222215ec00a1554c827913be8b283ff7da Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/icons/0.png differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/icons/2.png b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/icons/2.png new file mode 100644 index 0000000000000000000000000000000000000000..ffd29cc5196663b95e74fda71fadd7c223bb6fbb Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/icons/2.png differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/icons/4.png b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/icons/4.png new file mode 100644 index 0000000000000000000000000000000000000000..722a466f498371a81f8d12989695a27316cc9c6f Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/icons/4.png differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/icons/6.png b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/icons/6.png new file mode 100644 index 0000000000000000000000000000000000000000..1f6d0e107939be97d85768952d4ff96497b83d11 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/icons/6.png differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/metas.json b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/metas.json new file mode 100644 index 0000000000000000000000000000000000000000..0967ef424bce6791893e9a57bb952f80fd536e93 --- /dev/null +++ b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/metas.json @@ -0,0 +1 @@ +{} diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/policy.md b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/policy.md new file mode 100644 index 0000000000000000000000000000000000000000..c9bcc2cea42f727c8e43c934fc38163144848882 --- /dev/null +++ b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/policy.md @@ -0,0 +1,3 @@ +dummy1 policy + +https://voicevox.hiroshiba.jp/ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portrait.png b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portrait.png new file mode 100644 index 0000000000000000000000000000000000000000..74af491ccb22a442aec8064cc9ffc06f9305b35a Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portrait.png differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portraits/0.png b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portraits/0.png new file mode 100644 index 0000000000000000000000000000000000000000..0ad715aa946adbae1e0f412341e071796da94056 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portraits/0.png differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portraits/2.png b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portraits/2.png new file mode 100644 index 0000000000000000000000000000000000000000..07c5503cc153e015c7a01009a592758d2b03fe7d Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portraits/2.png differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portraits/4.png b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portraits/4.png new file mode 100644 index 0000000000000000000000000000000000000000..88810bbcfa672bd4823551b42404039f2b37bd2d Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portraits/4.png differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portraits/6.png b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portraits/6.png new file mode 100644 index 0000000000000000000000000000000000000000..b681cde2bad3b1dd738f5bd9ecd0282a5db5f4f9 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/portraits/6.png differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/0_001.wav b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/0_001.wav new file mode 100644 index 0000000000000000000000000000000000000000..ac83689ca80dbbfc9971991da4180673ef0b2de2 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/0_001.wav differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/0_002.wav b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/0_002.wav new file mode 100644 index 0000000000000000000000000000000000000000..85069f834e8275c5e25abdc2ea3f91f9a30e4858 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/0_002.wav differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/0_003.wav b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/0_003.wav new file mode 100644 index 0000000000000000000000000000000000000000..d052174cd253e77013e29e3cb2fe132f58f15553 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/0_003.wav differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/2_001.wav b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/2_001.wav new file mode 100644 index 0000000000000000000000000000000000000000..2051995d4a11e1e50f5446d4047023b876876e50 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/2_001.wav differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/2_002.wav b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/2_002.wav new file mode 100644 index 0000000000000000000000000000000000000000..3b9b8a842d0544905c2875c5bd51ac7274542c6d Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/2_002.wav differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/2_003.wav b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/2_003.wav new file mode 100644 index 0000000000000000000000000000000000000000..cc30278ba73d38666d84ed296062e3b17256e1ec Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/2_003.wav differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/4_001.wav b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/4_001.wav new file mode 100644 index 0000000000000000000000000000000000000000..06a048df4bbed3e6df8333e80e8fc1ecb8bb7071 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/4_001.wav differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/4_002.wav b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/4_002.wav new file mode 100644 index 0000000000000000000000000000000000000000..4430e6bcc7f9ef30ae099f026314163001be2271 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/4_002.wav differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/4_003.wav b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/4_003.wav new file mode 100644 index 0000000000000000000000000000000000000000..83bb44af0ffb1d487608d8819a40ee32da69f11c Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/4_003.wav differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/6_001.wav b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/6_001.wav new file mode 100644 index 0000000000000000000000000000000000000000..2385a1b188da76509d7837c3c9cda38bea5968c5 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/6_001.wav differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/6_002.wav b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/6_002.wav new file mode 100644 index 0000000000000000000000000000000000000000..ff8c6c6b3d106e865e23a42c690258b8cec1295f Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/6_002.wav differ diff --git a/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/6_003.wav b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/6_003.wav new file mode 100644 index 0000000000000000000000000000000000000000..a671ac74038e0c40e973940ff2f9cb1379a352e9 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff/voice_samples/6_003.wav differ diff --git a/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/icons/9.png b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/icons/9.png new file mode 100644 index 0000000000000000000000000000000000000000..5616d057b7f0333858eec97bad1cc4cf9616af7e Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/icons/9.png differ diff --git a/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/metas.json b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/metas.json new file mode 100644 index 0000000000000000000000000000000000000000..218fe4c1f710f9c31f7825b11fa259acf5a9758b --- /dev/null +++ b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/metas.json @@ -0,0 +1,3 @@ +{ + "supported_features": { "permitted_synthesis_morphing": "ALL" } +} diff --git a/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/policy.md b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/policy.md new file mode 100644 index 0000000000000000000000000000000000000000..68114802c449a6799db4cf7aae3cecbb71db0e70 --- /dev/null +++ b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/policy.md @@ -0,0 +1,3 @@ +dummy4 policy + +https://voicevox.hiroshiba.jp/ diff --git a/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/portrait.png b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/portrait.png new file mode 100644 index 0000000000000000000000000000000000000000..0d529a93d905b670170ba2f442f7e13388137b80 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/portrait.png differ diff --git a/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/voice_samples/9_001.wav b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/voice_samples/9_001.wav new file mode 100644 index 0000000000000000000000000000000000000000..9b7ee16f079f21336ced2650f727c2c4b5db27be Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/voice_samples/9_001.wav differ diff --git a/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/voice_samples/9_002.wav b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/voice_samples/9_002.wav new file mode 100644 index 0000000000000000000000000000000000000000..0e95e7a82c8db7fdce3e8968778ea61fa3a1f4b1 Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/voice_samples/9_002.wav differ diff --git a/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/voice_samples/9_003.wav b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/voice_samples/9_003.wav new file mode 100644 index 0000000000000000000000000000000000000000..83cdf67f7387293b5810f50a346dcfa95f866f4f Binary files /dev/null and b/voicevox_nemo_engine/speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/voice_samples/9_003.wav differ diff --git a/voicevox_nemo_engine/test/__init__.py b/voicevox_nemo_engine/test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/voicevox_nemo_engine/test/e2e/__init__.py b/voicevox_nemo_engine/test/e2e/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/voicevox_nemo_engine/test/e2e/conftest.py b/voicevox_nemo_engine/test/e2e/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..af21590c15bb1bd77f9be103ab8a79d1492aac3c --- /dev/null +++ b/voicevox_nemo_engine/test/e2e/conftest.py @@ -0,0 +1,29 @@ +from pathlib import Path + +import pytest +from fastapi.testclient import TestClient +from run import generate_app + +from voicevox_engine.preset import PresetManager +from voicevox_engine.setting import SettingLoader +from voicevox_engine.synthesis_engine import make_synthesis_engines +from voicevox_engine.utility.core_version_utility import get_latest_core_version + + +@pytest.fixture(scope="session") +def client(): + synthesis_engines = make_synthesis_engines(use_gpu=False) + latest_core_version = get_latest_core_version(versions=synthesis_engines.keys()) + setting_loader = SettingLoader(Path("./default_setting.yml")) + preset_manager = PresetManager( # FIXME: impl MockPresetManager + preset_path=Path("./presets.yaml"), + ) + + return TestClient( + generate_app( + synthesis_engines=synthesis_engines, + latest_core_version=latest_core_version, + setting_loader=setting_loader, + preset_manager=preset_manager, + ) + ) diff --git a/voicevox_nemo_engine/test/e2e/test_validate_version.py b/voicevox_nemo_engine/test/e2e/test_validate_version.py new file mode 100644 index 0000000000000000000000000000000000000000..b431a4a446bb0e5521fce766a2a32ee978935b50 --- /dev/null +++ b/voicevox_nemo_engine/test/e2e/test_validate_version.py @@ -0,0 +1,9 @@ +from fastapi.testclient import TestClient + +from voicevox_engine import __version__ + + +def test_fetch_version_success(client: TestClient): + response = client.get("/version") + assert response.status_code == 200 + assert response.json() == __version__ diff --git a/voicevox_nemo_engine/test/presets-test-1.yaml b/voicevox_nemo_engine/test/presets-test-1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..18ea6942db167966148e32eb2de30a22217a1ef5 --- /dev/null +++ b/voicevox_nemo_engine/test/presets-test-1.yaml @@ -0,0 +1,21 @@ +- id: 1 + name: test + speaker_uuid: 7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff + style_id: 0 + speedScale: 1 + pitchScale: 0 + intonationScale: 1 + volumeScale: 1 + prePhonemeLength: 0.1 + postPhonemeLength: 0.1 + +- id: 2 + name: test2 + speaker_uuid: 7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff + style_id: 2 + speedScale: 1.5 + pitchScale: 0 + intonationScale: 1 + volumeScale: 0.7 + prePhonemeLength: 0.5 + postPhonemeLength: 0.5 diff --git a/voicevox_nemo_engine/test/presets-test-2.yaml b/voicevox_nemo_engine/test/presets-test-2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..289894c3b151421f00c30407eb9c869c11579ca6 --- /dev/null +++ b/voicevox_nemo_engine/test/presets-test-2.yaml @@ -0,0 +1,21 @@ +- id: 1 + name: test + speaker_uuid: 7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff + style_id: not_int + speedScale: 1 + pitchScale: 0 + intonationScale: 1 + volumeScale: 1 + prePhonemeLength: 0.1 + postPhonemeLength: 0.1 + +- id: 2 + name: test2 + speaker_uuid: 7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff + style_id: 2 + speedScale: 1.5 + pitchScale: 0 + intonationScale: 1 + volumeScale: 0.7 + prePhonemeLength: 0.5 + postPhonemeLength: 0.5 diff --git a/voicevox_nemo_engine/test/presets-test-3.yaml b/voicevox_nemo_engine/test/presets-test-3.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f4bfc37fcd80f4a86799c5ffe1bbf2b2fded069e --- /dev/null +++ b/voicevox_nemo_engine/test/presets-test-3.yaml @@ -0,0 +1,21 @@ +- id: 1 + name: test + speaker_uuid: 7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff + style_id: 0 + speedScale: 1 + pitchScale: 0 + intonationScale: 1 + volumeScale: 1 + prePhonemeLength: 0.1 + postPhonemeLength: 0.1 + +- id: 1 + name: test2 + speaker_uuid: 7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff + style_id: 2 + speedScale: 1.5 + pitchScale: 0 + intonationScale: 1 + volumeScale: 0.7 + prePhonemeLength: 0.5 + postPhonemeLength: 0.5 diff --git a/voicevox_nemo_engine/test/presets-test-4.yaml b/voicevox_nemo_engine/test/presets-test-4.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/voicevox_nemo_engine/test/setting-test-load-1.yaml b/voicevox_nemo_engine/test/setting-test-load-1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3421e7a6a32073e3413444495b3bb37d80d4d351 --- /dev/null +++ b/voicevox_nemo_engine/test/setting-test-load-1.yaml @@ -0,0 +1,2 @@ +allow_origin: null +cors_policy_mode: localapps diff --git a/voicevox_nemo_engine/test/setting-test-load-2.yaml b/voicevox_nemo_engine/test/setting-test-load-2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1066e5d8ba36edec19cdbc54ac8c27963bbc3056 --- /dev/null +++ b/voicevox_nemo_engine/test/setting-test-load-2.yaml @@ -0,0 +1,2 @@ +allow_origin: null +cors_policy_mode: all diff --git a/voicevox_nemo_engine/test/setting-test-load-3.yaml b/voicevox_nemo_engine/test/setting-test-load-3.yaml new file mode 100644 index 0000000000000000000000000000000000000000..47bc8fb9ac2ac7c4a480660da65b465ef4d72533 --- /dev/null +++ b/voicevox_nemo_engine/test/setting-test-load-3.yaml @@ -0,0 +1,2 @@ +allow_origin: "192.168.254.255 192.168.255.255" +cors_policy_mode: localapps diff --git a/voicevox_nemo_engine/test/test_acoustic_feature_extractor.py b/voicevox_nemo_engine/test/test_acoustic_feature_extractor.py new file mode 100644 index 0000000000000000000000000000000000000000..a82e7afe62eed4f1be1506d7cd34335c769d17d0 --- /dev/null +++ b/voicevox_nemo_engine/test/test_acoustic_feature_extractor.py @@ -0,0 +1,266 @@ +import os +from pathlib import Path +from typing import List, Type +from unittest import TestCase + +from voicevox_engine.acoustic_feature_extractor import ( + BasePhoneme, + JvsPhoneme, + OjtPhoneme, +) + + +class TestBasePhoneme(TestCase): + def setUp(self): + super().setUp() + self.str_hello_hiho = "sil k o N n i ch i w a pau h i h o d e s U sil" + self.base_hello_hiho = [ + BasePhoneme(s, i, i + 1) for i, s in enumerate(self.str_hello_hiho.split()) + ] + self.lab_str = """ + 0.00 1.00 pau + 1.00 2.00 k + 2.00 3.00 o + 3.00 4.00 N + 4.00 5.00 n + 5.00 6.00 i + 6.00 7.00 ch + 7.00 8.00 i + 8.00 9.00 w + 9.00 10.00 a + 10.00 11.00 pau + 11.00 12.00 h + 12.00 13.00 i + 13.00 14.00 h + 14.00 15.00 o + 15.00 16.00 d + 16.00 17.00 e + 17.00 18.00 s + 18.00 19.00 U + 19.00 20.00 pau + """.replace( + " ", "" + )[ + 1:-1 + ] # ダブルクオーテーションx3で囲われている部分で、空白をすべて置き換え、先頭と最後の"\n"を除外する + + def test_repr_(self): + self.assertEqual( + self.base_hello_hiho[1].__repr__(), "Phoneme(phoneme='k', start=1, end=2)" + ) + self.assertEqual( + self.base_hello_hiho[10].__repr__(), + "Phoneme(phoneme='pau', start=10, end=11)", + ) + + def test_convert(self): + with self.assertRaises(NotImplementedError): + BasePhoneme.convert(self.base_hello_hiho) + + def test_duration(self): + self.assertEqual(self.base_hello_hiho[1].duration, 1) + + def test_parse(self): + parse_str_1 = "0 1 pau" + parse_str_2 = "32.67543 33.48933 e" + parsed_base_1 = BasePhoneme.parse(parse_str_1) + parsed_base_2 = BasePhoneme.parse(parse_str_2) + self.assertEqual(parsed_base_1.phoneme, "pau") + self.assertEqual(parsed_base_1.start, 0.0) + self.assertEqual(parsed_base_1.end, 1.0) + self.assertEqual(parsed_base_2.phoneme, "e") + self.assertEqual(parsed_base_2.start, 32.68) + self.assertEqual(parsed_base_2.end, 33.49) + + def lab_test_base( + self, + file_path: str, + phonemes: List["BasePhoneme"], + phoneme_class: Type["BasePhoneme"], + ): + phoneme_class.save_lab_list(phonemes, Path(file_path)) + with open(file_path, mode="r") as f: + self.assertEqual(f.read(), self.lab_str) + result_phoneme = phoneme_class.load_lab_list(Path(file_path)) + self.assertEqual(result_phoneme, phonemes) + os.remove(file_path) + + +class TestJvsPhoneme(TestBasePhoneme): + def setUp(self): + super().setUp() + base_hello_hiho = [ + JvsPhoneme(s, i, i + 1) for i, s in enumerate(self.str_hello_hiho.split()) + ] + self.jvs_hello_hiho = JvsPhoneme.convert(base_hello_hiho) + + def test_phoneme_list(self): + self.assertEqual(JvsPhoneme.phoneme_list[1], "I") + self.assertEqual(JvsPhoneme.phoneme_list[14], "gy") + self.assertEqual(JvsPhoneme.phoneme_list[26], "p") + self.assertEqual(JvsPhoneme.phoneme_list[38], "z") + + def test_const(self): + self.assertEqual(JvsPhoneme.num_phoneme, 39) + self.assertEqual(JvsPhoneme.space_phoneme, "pau") + + def test_convert(self): + converted_str_hello_hiho = " ".join([p.phoneme for p in self.jvs_hello_hiho]) + self.assertEqual( + converted_str_hello_hiho, "pau k o N n i ch i w a pau h i h o d e s U pau" + ) + + def test_equal(self): + # jvs_hello_hihoの2番目の"k"と比較 + true_jvs_phoneme = JvsPhoneme("k", 1, 2) + # OjtPhonemeと比べる、比較はBasePhoneme内で実装されているので、比較結果はTrue + true_ojt_phoneme = OjtPhoneme("k", 1, 2) + + false_jvs_phoneme_1 = JvsPhoneme("a", 1, 2) + false_jvs_phoneme_2 = JvsPhoneme("k", 2, 3) + self.assertTrue(self.jvs_hello_hiho[1] == true_jvs_phoneme) + self.assertTrue(self.jvs_hello_hiho[1] == true_ojt_phoneme) + self.assertFalse(self.jvs_hello_hiho[1] == false_jvs_phoneme_1) + self.assertFalse(self.jvs_hello_hiho[1] == false_jvs_phoneme_2) + + def test_verify(self): + for phoneme in self.jvs_hello_hiho: + phoneme.verify() + + def test_phoneme_id(self): + jvs_str_hello_hiho = " ".join([str(p.phoneme_id) for p in self.jvs_hello_hiho]) + self.assertEqual( + jvs_str_hello_hiho, "0 19 25 2 23 17 7 17 36 4 0 15 17 15 25 9 11 30 3 0" + ) + + def test_onehot(self): + phoneme_id_list = [ + 0, + 19, + 25, + 2, + 23, + 17, + 7, + 17, + 36, + 4, + 0, + 15, + 17, + 15, + 25, + 9, + 11, + 30, + 3, + 0, + ] + for i, phoneme in enumerate(self.jvs_hello_hiho): + for j in range(JvsPhoneme.num_phoneme): + if phoneme_id_list[i] == j: + self.assertEqual(phoneme.onehot[j], True) + else: + self.assertEqual(phoneme.onehot[j], False) + + def test_parse(self): + parse_str_1 = "0 1 pau" + parse_str_2 = "15.32654 16.39454 a" + parsed_jvs_1 = JvsPhoneme.parse(parse_str_1) + parsed_jvs_2 = JvsPhoneme.parse(parse_str_2) + self.assertEqual(parsed_jvs_1.phoneme_id, 0) + self.assertEqual(parsed_jvs_2.phoneme_id, 4) + + def test_lab_list(self): + self.lab_test_base("./jvs_lab_test", self.jvs_hello_hiho, JvsPhoneme) + + +class TestOjtPhoneme(TestBasePhoneme): + def setUp(self): + super().setUp() + self.str_hello_hiho = "sil k o N n i ch i w a pau h i h o d e s U sil" + base_hello_hiho = [ + OjtPhoneme(s, i, i + 1) for i, s in enumerate(self.str_hello_hiho.split()) + ] + self.ojt_hello_hiho = OjtPhoneme.convert(base_hello_hiho) + + def test_phoneme_list(self): + self.assertEqual(OjtPhoneme.phoneme_list[1], "A") + self.assertEqual(OjtPhoneme.phoneme_list[14], "e") + self.assertEqual(OjtPhoneme.phoneme_list[26], "m") + self.assertEqual(OjtPhoneme.phoneme_list[38], "ts") + self.assertEqual(OjtPhoneme.phoneme_list[41], "v") + + def test_const(self): + self.assertEqual(OjtPhoneme.num_phoneme, 45) + self.assertEqual(OjtPhoneme.space_phoneme, "pau") + + def test_convert(self): + ojt_str_hello_hiho = " ".join([p.phoneme for p in self.ojt_hello_hiho]) + self.assertEqual( + ojt_str_hello_hiho, "pau k o N n i ch i w a pau h i h o d e s U pau" + ) + + def test_equal(self): + # ojt_hello_hihoの10番目の"a"と比較 + true_ojt_phoneme = OjtPhoneme("a", 9, 10) + # JvsPhonemeと比べる、比較はBasePhoneme内で実装されているので、比較結果はTrue + true_jvs_phoneme = JvsPhoneme("a", 9, 10) + + false_ojt_phoneme_1 = OjtPhoneme("k", 9, 10) + false_ojt_phoneme_2 = OjtPhoneme("a", 10, 11) + self.assertTrue(self.ojt_hello_hiho[9] == true_ojt_phoneme) + self.assertTrue(self.ojt_hello_hiho[9] == true_jvs_phoneme) + self.assertFalse(self.ojt_hello_hiho[9] == false_ojt_phoneme_1) + self.assertFalse(self.ojt_hello_hiho[9] == false_ojt_phoneme_2) + + def test_verify(self): + for phoneme in self.ojt_hello_hiho: + phoneme.verify() + + def test_phoneme_id(self): + ojt_str_hello_hiho = " ".join([str(p.phoneme_id) for p in self.ojt_hello_hiho]) + self.assertEqual( + ojt_str_hello_hiho, "0 23 30 4 28 21 10 21 42 7 0 19 21 19 30 12 14 35 6 0" + ) + + def test_onehot(self): + phoneme_id_list = [ + 0, + 23, + 30, + 4, + 28, + 21, + 10, + 21, + 42, + 7, + 0, + 19, + 21, + 19, + 30, + 12, + 14, + 35, + 6, + 0, + ] + for i, phoneme in enumerate(self.ojt_hello_hiho): + for j in range(OjtPhoneme.num_phoneme): + if phoneme_id_list[i] == j: + self.assertEqual(phoneme.onehot[j], True) + else: + self.assertEqual(phoneme.onehot[j], False) + + def test_parse(self): + parse_str_1 = "0 1 pau" + parse_str_2 = "32.67543 33.48933 e" + parsed_ojt_1 = OjtPhoneme.parse(parse_str_1) + parsed_ojt_2 = OjtPhoneme.parse(parse_str_2) + self.assertEqual(parsed_ojt_1.phoneme_id, 0) + self.assertEqual(parsed_ojt_2.phoneme_id, 14) + + def tes_lab_list(self): + self.lab_test_base("./ojt_lab_test", self.ojt_hello_hiho, OjtPhoneme) diff --git a/voicevox_nemo_engine/test/test_connect_base64_waves.py b/voicevox_nemo_engine/test/test_connect_base64_waves.py new file mode 100644 index 0000000000000000000000000000000000000000..ac9dfb8413e92f7da7912ff1446f38868782c8b0 --- /dev/null +++ b/voicevox_nemo_engine/test/test_connect_base64_waves.py @@ -0,0 +1,130 @@ +import base64 +import io +from unittest import TestCase + +import numpy as np +import numpy.testing +import soundfile +from soxr import resample + +from voicevox_engine.utility import ConnectBase64WavesException, connect_base64_waves + + +def generate_sine_wave_ndarray( + seconds: float, samplerate: int, frequency: float +) -> np.ndarray: + x = np.linspace(0, seconds, int(seconds * samplerate), endpoint=False) + wave = np.sin(2 * np.pi * frequency * x).astype(np.float32) + + return wave + + +def encode_bytes(wave_ndarray: np.ndarray, samplerate: int) -> bytes: + wave_bio = io.BytesIO() + soundfile.write( + file=wave_bio, + data=wave_ndarray, + samplerate=samplerate, + format="WAV", + subtype="FLOAT", + ) + wave_bio.seek(0) + + return wave_bio.getvalue() + + +def generate_sine_wave_bytes( + seconds: float, samplerate: int, frequency: float +) -> bytes: + wave_ndarray = generate_sine_wave_ndarray(seconds, samplerate, frequency) + return encode_bytes(wave_ndarray, samplerate) + + +def encode_base64(wave_bytes: bytes) -> str: + return base64.standard_b64encode(wave_bytes).decode("utf-8") + + +def generate_sine_wave_base64(seconds: float, samplerate: int, frequency: float) -> str: + wave_bytes = generate_sine_wave_bytes(seconds, samplerate, frequency) + wave_base64 = encode_base64(wave_bytes) + return wave_base64 + + +class TestConnectBase64Waves(TestCase): + def test_connect(self): + samplerate = 1000 + wave = generate_sine_wave_ndarray( + seconds=2, samplerate=samplerate, frequency=10 + ) + wave_base64 = encode_base64(encode_bytes(wave, samplerate=samplerate)) + + wave_x2_ref = np.concatenate([wave, wave]) + + wave_x2, _ = connect_base64_waves(waves=[wave_base64, wave_base64]) + + self.assertEqual(wave_x2_ref.shape, wave_x2.shape) + + self.assertTrue((wave_x2_ref == wave_x2).all()) + + def test_no_wave_error(self): + self.assertRaises(ConnectBase64WavesException, connect_base64_waves, waves=[]) + + def test_invalid_base64_error(self): + wave_1000hz = generate_sine_wave_base64( + seconds=2, samplerate=1000, frequency=10 + ) + wave_1000hz_broken = wave_1000hz[1:] # remove head 1 char + + self.assertRaises( + ConnectBase64WavesException, + connect_base64_waves, + waves=[ + wave_1000hz_broken, + ], + ) + + def test_invalid_wave_file_error(self): + wave_1000hz = generate_sine_wave_bytes(seconds=2, samplerate=1000, frequency=10) + wave_1000hz_broken_bytes = wave_1000hz[1:] # remove head 1 byte + wave_1000hz_broken = encode_base64(wave_1000hz_broken_bytes) + + self.assertRaises( + ConnectBase64WavesException, + connect_base64_waves, + waves=[ + wave_1000hz_broken, + ], + ) + + def test_different_frequency(self): + wave_24000hz = generate_sine_wave_ndarray( + seconds=1, samplerate=24000, frequency=10 + ) + wave_1000hz = generate_sine_wave_ndarray( + seconds=2, samplerate=1000, frequency=10 + ) + wave_24000_base64 = encode_base64(encode_bytes(wave_24000hz, samplerate=24000)) + wave_1000_base64 = encode_base64(encode_bytes(wave_1000hz, samplerate=1000)) + + wave_1000hz_to24000hz = resample(wave_1000hz, 1000, 24000) + wave_x2_ref = np.concatenate([wave_24000hz, wave_1000hz_to24000hz]) + + wave_x2, _ = connect_base64_waves(waves=[wave_24000_base64, wave_1000_base64]) + + self.assertEqual(wave_x2_ref.shape, wave_x2.shape) + numpy.testing.assert_array_almost_equal(wave_x2_ref, wave_x2) + + def test_different_channels(self): + wave_1000hz = generate_sine_wave_ndarray( + seconds=2, samplerate=1000, frequency=10 + ) + wave_2ch_1000hz = np.array([wave_1000hz, wave_1000hz]).T + wave_1ch_base64 = encode_base64(encode_bytes(wave_1000hz, samplerate=1000)) + wave_2ch_base64 = encode_base64(encode_bytes(wave_2ch_1000hz, samplerate=1000)) + + wave_x2_ref = np.concatenate([wave_2ch_1000hz, wave_2ch_1000hz]) + + wave_x2, _ = connect_base64_waves(waves=[wave_1ch_base64, wave_2ch_base64]) + + self.assertEqual(wave_x2_ref.shape, wave_x2.shape) + self.assertTrue((wave_x2_ref == wave_x2).all()) diff --git a/voicevox_nemo_engine/test/test_core_version_utility.py b/voicevox_nemo_engine/test/test_core_version_utility.py new file mode 100644 index 0000000000000000000000000000000000000000..e96ba8009e1614788e1e2b7ea9a11ae6d77dfe5c --- /dev/null +++ b/voicevox_nemo_engine/test/test_core_version_utility.py @@ -0,0 +1,40 @@ +from unittest import TestCase + +from voicevox_engine.utility import get_latest_core_version, parse_core_version + + +class TestCoreVersion(TestCase): + def test_parse_core_version(self): + parse_core_version("0.0.0") + parse_core_version("0.1.0") + parse_core_version("0.10.0") + parse_core_version("0.10.0-preview.1") + parse_core_version("0.14.0") + parse_core_version("0.14.0-preview.1") + parse_core_version("0.14.0-preview.10") + + def test_get_latest_core_version(self): + self.assertEqual( + get_latest_core_version( + versions=[ + "0.0.0", + "0.1.0", + "0.10.0", + "0.10.0-preview.1", + "0.14.0", + "0.14.0-preview.1", + "0.14.0-preview.10", + ] + ), + "0.14.0", + ) + + self.assertEqual( + get_latest_core_version( + versions=[ + "0.14.0", + "0.15.0-preview.1", + ] + ), + "0.15.0-preview.1", + ) diff --git a/voicevox_nemo_engine/test/test_downloadable_library.py b/voicevox_nemo_engine/test/test_downloadable_library.py new file mode 100644 index 0000000000000000000000000000000000000000..f3f47efe2fb63ce7968239e61ee3341ce94e8449 --- /dev/null +++ b/voicevox_nemo_engine/test/test_downloadable_library.py @@ -0,0 +1,196 @@ +import copy +import glob +import json +import os +from io import BytesIO +from pathlib import Path +from tempfile import TemporaryDirectory +from unittest import TestCase +from zipfile import ZipFile + +from fastapi import HTTPException + +from voicevox_engine.downloadable_library import LibraryManager + +vvlib_manifest_name = "vvlib_manifest.json" + + +class TestLibraryManager(TestCase): + def setUp(self): + super().setUp() + self.tmp_dir = TemporaryDirectory() + self.tmp_dir_path = Path(self.tmp_dir.name) + self.engine_name = "Test Engine" + self.library_manger = LibraryManager( + self.tmp_dir_path, + "0.15.0", + "Test", + self.engine_name, + "c7b58856-bd56-4aa1-afb7-b8415f824b06", + ) + self.library_filename = Path("test/test.vvlib") + with open("test/vvlib_manifest.json") as f: + self.vvlib_manifest = json.loads(f.read()) + self.library_uuid = self.vvlib_manifest["uuid"] + with ZipFile(self.library_filename, "w") as zf: + speaker_infos = glob.glob("speaker_info/**", recursive=True) + for info in speaker_infos: + zf.write(info) + zf.writestr(vvlib_manifest_name, json.dumps(self.vvlib_manifest)) + self.library_file = open(self.library_filename, "br") + + def tearDown(self): + self.tmp_dir.cleanup() + self.library_file.close() + self.library_filename.unlink() + + def create_vvlib_without_manifest(self, filename: str): + with ZipFile(filename, "w") as zf_out, ZipFile( + self.library_filename, "r" + ) as zf_in: + for file in zf_in.infolist(): + buffer = zf_in.read(file.filename) + if file.filename != vvlib_manifest_name: + zf_out.writestr(file, buffer) + + def create_vvlib_manifest(self, **kwargs): + vvlib_manifest = copy.deepcopy(self.vvlib_manifest) + return {**vvlib_manifest, **kwargs} + + def test_installed_libraries(self): + self.assertEqual(self.library_manger.installed_libraries(), {}) + + self.library_manger.install_library( + self.library_uuid, + self.library_file, + ) + # 内容はdownloadable_library.jsonを元に生成されるので、内容は確認しない + self.assertEqual( + list(self.library_manger.installed_libraries().keys())[0], self.library_uuid + ) + + self.library_manger.uninstall_library(self.library_uuid) + self.assertEqual(self.library_manger.installed_libraries(), {}) + + def test_install_library(self): + # エンジンが把握していないライブラリのテスト + invalid_uuid = "52398bd5-3cc3-406c-a159-dfec5ace4bab" + with self.assertRaises(HTTPException) as e: + self.library_manger.install_library(invalid_uuid, self.library_file) + self.assertEqual(e.exception.detail, f"指定された音声ライブラリ {invalid_uuid} が見つかりません。") + + # 不正なZIPファイルのテスト + with self.assertRaises(HTTPException) as e: + self.library_manger.install_library(self.library_uuid, BytesIO()) + self.assertEqual(e.exception.detail, f"音声ライブラリ {self.library_uuid} は不正なファイルです。") + + # vvlib_manifestの存在確認のテスト + invalid_vvlib_name = "test/invalid.vvlib" + self.create_vvlib_without_manifest(invalid_vvlib_name) + with open(invalid_vvlib_name, "br") as f, self.assertRaises(HTTPException) as e: + self.library_manger.install_library(self.library_uuid, f) + self.assertEqual( + e.exception.detail, + f"指定された音声ライブラリ {self.library_uuid} にvvlib_manifest.jsonが存在しません。", + ) + + # vvlib_manifestのパースのテスト + # Duplicate name: 'vvlib_manifest.json'とWarningを吐かれるので、毎回作り直す + self.create_vvlib_without_manifest(invalid_vvlib_name) + with ZipFile(invalid_vvlib_name, "a") as zf: + zf.writestr(vvlib_manifest_name, "test") + + with open(invalid_vvlib_name, "br") as f, self.assertRaises(HTTPException) as e: + self.library_manger.install_library(self.library_uuid, f) + self.assertEqual( + e.exception.detail, + f"指定された音声ライブラリ {self.library_uuid} のvvlib_manifest.jsonは不正です。", + ) + + # vvlib_manifestのパースのテスト + invalid_vvlib_manifest = self.create_vvlib_manifest(version=10) + self.create_vvlib_without_manifest(invalid_vvlib_name) + with ZipFile(invalid_vvlib_name, "a") as zf: + zf.writestr(vvlib_manifest_name, json.dumps(invalid_vvlib_manifest)) + + with open(invalid_vvlib_name, "br") as f, self.assertRaises(HTTPException) as e: + self.library_manger.install_library(self.library_uuid, f) + self.assertEqual( + e.exception.detail, + f"指定された音声ライブラリ {self.library_uuid} のvvlib_manifest.jsonに不正なデータが含まれています。", + ) + + # vvlib_manifestの不正なversionのテスト + invalid_vvlib_manifest = self.create_vvlib_manifest(version="10") + self.create_vvlib_without_manifest(invalid_vvlib_name) + with ZipFile(invalid_vvlib_name, "a") as zf: + zf.writestr(vvlib_manifest_name, json.dumps(invalid_vvlib_manifest)) + + with open(invalid_vvlib_name, "br") as f, self.assertRaises(HTTPException) as e: + self.library_manger.install_library(self.library_uuid, f) + self.assertEqual( + e.exception.detail, f"指定された音声ライブラリ {self.library_uuid} のversionが不正です。" + ) + + # vvlib_manifestの不正なmanifest_versionのテスト + invalid_vvlib_manifest = self.create_vvlib_manifest(manifest_version="10") + self.create_vvlib_without_manifest(invalid_vvlib_name) + with ZipFile(invalid_vvlib_name, "a") as zf: + zf.writestr(vvlib_manifest_name, json.dumps(invalid_vvlib_manifest)) + + with open(invalid_vvlib_name, "br") as f, self.assertRaises(HTTPException) as e: + self.library_manger.install_library(self.library_uuid, f) + self.assertEqual( + e.exception.detail, + f"指定された音声ライブラリ {self.library_uuid} のmanifest_versionが不正です。", + ) + + # vvlib_manifestの未対応のmanifest_versionのテスト + invalid_vvlib_manifest = self.create_vvlib_manifest( + manifest_version="999.999.999" + ) + self.create_vvlib_without_manifest(invalid_vvlib_name) + with ZipFile(invalid_vvlib_name, "a") as zf: + zf.writestr(vvlib_manifest_name, json.dumps(invalid_vvlib_manifest)) + + with open(invalid_vvlib_name, "br") as f, self.assertRaises(HTTPException) as e: + self.library_manger.install_library(self.library_uuid, f) + self.assertEqual( + e.exception.detail, f"指定された音声ライブラリ {self.library_uuid} は未対応です。" + ) + + # vvlib_manifestのインストール先エンジンの検証のテスト + invalid_vvlib_manifest = self.create_vvlib_manifest( + engine_uuid="26f7823b-20c6-40c5-bf86-6dd5d9d45c18" + ) + self.create_vvlib_without_manifest(invalid_vvlib_name) + with ZipFile(invalid_vvlib_name, "a") as zf: + zf.writestr(vvlib_manifest_name, json.dumps(invalid_vvlib_manifest)) + + with open(invalid_vvlib_name, "br") as f, self.assertRaises(HTTPException) as e: + self.library_manger.install_library(self.library_uuid, f) + self.assertEqual( + e.exception.detail, + f"指定された音声ライブラリ {self.library_uuid} は{self.engine_name}向けではありません。", + ) + + # 正しいライブラリをインストールして問題が起きないか + library_path = self.library_manger.install_library( + self.library_uuid, self.library_file + ) + self.assertEqual(self.tmp_dir_path / self.library_uuid, library_path) + + self.library_manger.uninstall_library(self.library_uuid) + + os.remove(invalid_vvlib_name) + + def test_uninstall_library(self): + # TODO: アンインストール出来ないライブラリをテストできるようにしたい + with self.assertRaises(HTTPException) as e: + self.library_manger.uninstall_library(self.library_uuid) + self.assertEqual( + e.exception.detail, f"指定された音声ライブラリ {self.library_uuid} はインストールされていません。" + ) + + self.library_manger.install_library(self.library_uuid, self.library_file) + self.library_manger.uninstall_library(self.library_uuid) diff --git a/voicevox_nemo_engine/test/test_full_context_label.py b/voicevox_nemo_engine/test/test_full_context_label.py new file mode 100644 index 0000000000000000000000000000000000000000..7cdde34f4644ccf7b3048d707f99b0171e25114e --- /dev/null +++ b/voicevox_nemo_engine/test/test_full_context_label.py @@ -0,0 +1,404 @@ +from copy import deepcopy +from itertools import chain +from unittest import TestCase + +from voicevox_engine.full_context_label import ( + AccentPhrase, + BreathGroup, + Mora, + Phoneme, + Utterance, +) + + +class TestBasePhonemes(TestCase): + def setUp(self): + super().setUp() + # pyopenjtalk.extract_fullcontext("こんにちは、ヒホです。")の結果 + # 出来る限りテスト内で他のライブラリに依存しないため、 + # またテスト内容を透明化するために、テストケースを生成している + self.test_case_hello_hiho = [ + # sil (無音) + "xx^xx-sil+k=o/A:xx+xx+xx/B:xx-xx_xx/C:xx_xx+xx/D:09+xx_xx/E:xx_xx!xx_xx-xx" + + "/F:xx_xx#xx_xx@xx_xx|xx_xx/G:5_5%0_xx_xx/H:xx_xx/I:xx-xx" + + "@xx+xx&xx-xx|xx+xx/J:1_5/K:2+2-9", + # k + "xx^sil-k+o=N/A:-4+1+5/B:xx-xx_xx/C:09_xx+xx/D:09+xx_xx/E:xx_xx!xx_xx-xx" + + "/F:5_5#0_xx@1_1|1_5/G:4_1%0_xx_0/H:xx_xx/I:1-5" + + "@1+2&1-2|1+9/J:1_4/K:2+2-9", + # o + "sil^k-o+N=n/A:-4+1+5/B:xx-xx_xx/C:09_xx+xx/D:09+xx_xx/E:xx_xx!xx_xx-xx" + + "/F:5_5#0_xx@1_1|1_5/G:4_1%0_xx_0/H:xx_xx/I:1-5" + + "@1+2&1-2|1+9/J:1_4/K:2+2-9", + # N (ん) + "k^o-N+n=i/A:-3+2+4/B:xx-xx_xx/C:09_xx+xx/D:09+xx_xx/E:xx_xx!xx_xx-xx" + + "/F:5_5#0_xx@1_1|1_5/G:4_1%0_xx_0/H:xx_xx/I:1-5" + + "@1+2&1-2|1+9/J:1_4/K:2+2-9", + # n + "o^N-n+i=ch/A:-2+3+3/B:xx-xx_xx/C:09_xx+xx/D:09+xx_xx/E:xx_xx!xx_xx-xx" + + "/F:5_5#0_xx@1_1|1_5/G:4_1%0_xx_0/H:xx_xx/I:1-5" + + "@1+2&1-2|1+9/J:1_4/K:2+2-9", + # i + "N^n-i+ch=i/A:-2+3+3/B:xx-xx_xx/C:09_xx+xx/D:09+xx_xx/E:xx_xx!xx_xx-xx" + + "/F:5_5#0_xx@1_1|1_5/G:4_1%0_xx_0/H:xx_xx/I:1-5" + + "@1+2&1-2|1+9/J:1_4/K:2+2-9", + # ch + "n^i-ch+i=w/A:-1+4+2/B:xx-xx_xx/C:09_xx+xx/D:09+xx_xx/E:xx_xx!xx_xx-xx" + + "/F:5_5#0_xx@1_1|1_5/G:4_1%0_xx_0/H:xx_xx/I:1-5" + + "@1+2&1-2|1+9/J:1_4/K:2+2-9", + # i + "i^ch-i+w=a/A:-1+4+2/B:xx-xx_xx/C:09_xx+xx/D:09+xx_xx/E:xx_xx!xx_xx-xx" + + "/F:5_5#0_xx@1_1|1_5/G:4_1%0_xx_0/H:xx_xx/I:1-5" + + "@1+2&1-2|1+9/J:1_4/K:2+2-9", + # w + "ch^i-w+a=pau/A:0+5+1/B:xx-xx_xx/C:09_xx+xx/D:09+xx_xx/E:xx_xx!xx_xx-xx" + + "/F:5_5#0_xx@1_1|1_5/G:4_1%0_xx_0/H:xx_xx/I:1-5" + + "@1+2&1-2|1+9/J:1_4/K:2+2-9", + # a + "i^w-a+pau=h/A:0+5+1/B:xx-xx_xx/C:09_xx+xx/D:09+xx_xx/E:xx_xx!xx_xx-xx" + + "/F:5_5#0_xx@1_1|1_5/G:4_1%0_xx_0/H:xx_xx/I:1-5" + + "@1+2&1-2|1+9/J:1_4/K:2+2-9", + # pau (読点) + "w^a-pau+h=i/A:xx+xx+xx/B:09-xx_xx/C:xx_xx+xx/D:09+xx_xx/E:5_5!0_xx-xx" + + "/F:xx_xx#xx_xx@xx_xx|xx_xx/G:4_1%0_xx_xx/H:1_5/I:xx-xx" + + "@xx+xx&xx-xx|xx+xx/J:1_4/K:2+2-9", + # h + "a^pau-h+i=h/A:0+1+4/B:09-xx_xx/C:09_xx+xx/D:22+xx_xx/E:5_5!0_xx-0" + + "/F:4_1#0_xx@1_1|1_4/G:xx_xx%xx_xx_xx/H:1_5/I:1-4" + + "@2+1&2-1|6+4/J:xx_xx/K:2+2-9", + # i + "pau^h-i+h=o/A:0+1+4/B:09-xx_xx/C:09_xx+xx/D:22+xx_xx/E:5_5!0_xx-0" + + "/F:4_1#0_xx@1_1|1_4/G:xx_xx%xx_xx_xx/H:1_5/I:1-4" + + "@2+1&2-1|6+4/J:xx_xx/K:2+2-9", + # h + "h^i-h+o=d/A:1+2+3/B:09-xx_xx/C:22_xx+xx/D:10+7_2/E:5_5!0_xx-0" + + "/F:4_1#0_xx@1_1|1_4/G:xx_xx%xx_xx_xx/H:1_5/I:1-4" + + "@2+1&2-1|6+4/J:xx_xx/K:2+2-9", + # o + "i^h-o+d=e/A:1+2+3/B:09-xx_xx/C:22_xx+xx/D:10+7_2/E:5_5!0_xx-0" + + "/F:4_1#0_xx@1_1|1_4/G:xx_xx%xx_xx_xx/H:1_5/I:1-4" + + "@2+1&2-1|6+4/J:xx_xx/K:2+2-9", + # d + "h^o-d+e=s/A:2+3+2/B:22-xx_xx/C:10_7+2/D:xx+xx_xx/E:5_5!0_xx-0" + + "/F:4_1#0_xx@1_1|1_4/G:xx_xx%xx_xx_xx/H:1_5/I:1-4" + + "@2+1&2-1|6+4/J:xx_xx/K:2+2-9", + # e + "o^d-e+s=U/A:2+3+2/B:22-xx_xx/C:10_7+2/D:xx+xx_xx/E:5_5!0_xx-0" + + "/F:4_1#0_xx@1_1|1_4/G:xx_xx%xx_xx_xx/H:1_5/I:1-4" + + "@2+1&2-1|6+4/J:xx_xx/K:2+2-9", + # s + "d^e-s+U=sil/A:3+4+1/B:22-xx_xx/C:10_7+2/D:xx+xx_xx/E:5_5!0_xx-0" + + "/F:4_1#0_xx@1_1|1_4/G:xx_xx%xx_xx_xx/H:1_5/I:1-4" + + "@2+1&2-1|6+4/J:xx_xx/K:2+2-9", + # U (無声母音) + "e^s-U+sil=xx/A:3+4+1/B:22-xx_xx/C:10_7+2/D:xx+xx_xx/E:5_5!0_xx-0" + + "/F:4_1#0_xx@1_1|1_4/G:xx_xx%xx_xx_xx/H:1_5/I:1-4" + + "@2+1&2-1|6+4/J:xx_xx/K:2+2-9", + # sil (無音) + "s^U-sil+xx=xx/A:xx+xx+xx/B:10-7_2/C:xx_xx+xx/D:xx+xx_xx/E:4_1!0_xx-xx" + + "/F:xx_xx#xx_xx@xx_xx|xx_xx/G:xx_xx%xx_xx_xx/H:1_4/I:xx-xx" + + "@xx+xx&xx-xx|xx+xx/J:xx_xx/K:2+2-9", + ] + self.phonemes_hello_hiho = [ + Phoneme.from_label(label) for label in self.test_case_hello_hiho + ] + + +class TestPhoneme(TestBasePhonemes): + def test_phoneme(self): + self.assertEqual( + " ".join([phoneme.phoneme for phoneme in self.phonemes_hello_hiho]), + "sil k o N n i ch i w a pau h i h o d e s U sil", + ) + + def test_is_pause(self): + self.assertEqual( + [phoneme.is_pause() for phoneme in self.phonemes_hello_hiho], + [ + True, # sil + False, # k + False, # o + False, # N + False, # n + False, # i + False, # ch + False, # i + False, # w + False, # a + True, # pau + False, # h + False, # i + False, # h + False, # o + False, # d + False, # e + False, # s + False, # u + True, # sil + ], + ) + + def test_label(self) -> None: + self.assertEqual( + [phoneme.label for phoneme in self.phonemes_hello_hiho], + self.test_case_hello_hiho, + ) + + +class TestMora(TestBasePhonemes): + def setUp(self) -> None: + super().setUp() + # contexts["a2"] == "1" ko + self.mora_hello_1 = Mora( + consonant=self.phonemes_hello_hiho[1], vowel=self.phonemes_hello_hiho[2] + ) + # contexts["a2"] == "2" N + self.mora_hello_2 = Mora(consonant=None, vowel=self.phonemes_hello_hiho[3]) + # contexts["a2"] == "3" ni + self.mora_hello_3 = Mora( + consonant=self.phonemes_hello_hiho[4], vowel=self.phonemes_hello_hiho[5] + ) + # contexts["a2"] == "4" chi + self.mora_hello_4 = Mora( + consonant=self.phonemes_hello_hiho[6], vowel=self.phonemes_hello_hiho[7] + ) + # contexts["a2"] == "5" wa + self.mora_hello_5 = Mora( + consonant=self.phonemes_hello_hiho[8], vowel=self.phonemes_hello_hiho[9] + ) + # contexts["a2"] == "1" hi + self.mora_hiho_1 = Mora( + consonant=self.phonemes_hello_hiho[11], vowel=self.phonemes_hello_hiho[12] + ) + # contexts["a2"] == "2" ho + self.mora_hiho_2 = Mora( + consonant=self.phonemes_hello_hiho[13], vowel=self.phonemes_hello_hiho[14] + ) + # contexts["a2"] == "3" de + self.mora_hiho_3 = Mora( + consonant=self.phonemes_hello_hiho[15], vowel=self.phonemes_hello_hiho[16] + ) + # contexts["a2"] == "1" sU + self.mora_hiho_4 = Mora( + consonant=self.phonemes_hello_hiho[17], vowel=self.phonemes_hello_hiho[18] + ) + + def assert_phonemes(self, mora: Mora, mora_str: str) -> None: + self.assertEqual( + "".join([phoneme.phoneme for phoneme in mora.phonemes]), mora_str + ) + + def assert_labels(self, mora: Mora, label_start: int, label_end: int) -> None: + self.assertEqual(mora.labels, self.test_case_hello_hiho[label_start:label_end]) + + def test_phonemes(self) -> None: + self.assert_phonemes(self.mora_hello_1, "ko") + self.assert_phonemes(self.mora_hello_2, "N") + self.assert_phonemes(self.mora_hello_3, "ni") + self.assert_phonemes(self.mora_hello_4, "chi") + self.assert_phonemes(self.mora_hello_5, "wa") + self.assert_phonemes(self.mora_hiho_1, "hi") + self.assert_phonemes(self.mora_hiho_2, "ho") + self.assert_phonemes(self.mora_hiho_3, "de") + self.assert_phonemes(self.mora_hiho_4, "sU") + + def test_labels(self) -> None: + self.assert_labels(self.mora_hello_1, 1, 3) + self.assert_labels(self.mora_hello_2, 3, 4) + self.assert_labels(self.mora_hello_3, 4, 6) + self.assert_labels(self.mora_hello_4, 6, 8) + self.assert_labels(self.mora_hello_5, 8, 10) + self.assert_labels(self.mora_hiho_1, 11, 13) + self.assert_labels(self.mora_hiho_2, 13, 15) + self.assert_labels(self.mora_hiho_3, 15, 17) + self.assert_labels(self.mora_hiho_4, 17, 19) + + def test_set_context(self): + # 値を書き換えるので、他のテストに影響を出さないためにdeepcopyする + mora_hello_1 = deepcopy(self.mora_hello_1) + # phonemeにあたる"p3"を書き換える + mora_hello_1.set_context("p3", "a") + self.assert_phonemes(mora_hello_1, "aa") + + +class TestAccentPhrase(TestBasePhonemes): + def setUp(self) -> None: + super().setUp() + # TODO: ValueErrorを吐く作為的ではない自然な例の模索 + # 存在しないなら放置でよい + self.accent_phrase_hello = AccentPhrase.from_phonemes( + self.phonemes_hello_hiho[1:10] + ) + self.accent_phrase_hiho = AccentPhrase.from_phonemes( + self.phonemes_hello_hiho[11:19] + ) + + def test_accent(self): + self.assertEqual(self.accent_phrase_hello.accent, 5) + self.assertEqual(self.accent_phrase_hiho.accent, 1) + + def test_set_context(self): + accent_phrase_hello = deepcopy(self.accent_phrase_hello) + # phonemeにあたる"p3"を書き換える + accent_phrase_hello.set_context("p3", "a") + self.assertEqual( + "".join([phoneme.phoneme for phoneme in accent_phrase_hello.phonemes]), + "aaaaaaaaa", + ) + + def test_phonemes(self): + self.assertEqual( + " ".join( + [phoneme.phoneme for phoneme in self.accent_phrase_hello.phonemes] + ), + "k o N n i ch i w a", + ) + self.assertEqual( + " ".join([phoneme.phoneme for phoneme in self.accent_phrase_hiho.phonemes]), + "h i h o d e s U", + ) + + def test_labels(self): + self.assertEqual( + self.accent_phrase_hello.labels, self.test_case_hello_hiho[1:10] + ) + self.assertEqual( + self.accent_phrase_hiho.labels, self.test_case_hello_hiho[11:19] + ) + + def test_merge(self): + # 「こんにちはヒホです」 + # 読点を無くしたものと同等 + merged_accent_phrase = self.accent_phrase_hello.merge(self.accent_phrase_hiho) + self.assertEqual(merged_accent_phrase.accent, 5) + self.assertEqual( + " ".join([phoneme.phoneme for phoneme in merged_accent_phrase.phonemes]), + "k o N n i ch i w a h i h o d e s U", + ) + self.assertEqual( + merged_accent_phrase.labels, + self.test_case_hello_hiho[1:10] + self.test_case_hello_hiho[11:19], + ) + + +class TestBreathGroup(TestBasePhonemes): + def setUp(self) -> None: + super().setUp() + self.breath_group_hello = BreathGroup.from_phonemes( + self.phonemes_hello_hiho[1:10] + ) + self.breath_group_hiho = BreathGroup.from_phonemes( + self.phonemes_hello_hiho[11:19] + ) + + def test_set_context(self): + # 値を書き換えるので、他のテストに影響を出さないためにdeepcopyする + breath_group_hello = deepcopy(self.breath_group_hello) + # phonemeにあたる"p3"を書き換える + breath_group_hello.set_context("p3", "a") + self.assertEqual( + "".join([phoneme.phoneme for phoneme in breath_group_hello.phonemes]), + "aaaaaaaaa", + ) + + def test_phonemes(self): + self.assertEqual( + " ".join([phoneme.phoneme for phoneme in self.breath_group_hello.phonemes]), + "k o N n i ch i w a", + ) + self.assertEqual( + " ".join([phoneme.phoneme for phoneme in self.breath_group_hiho.phonemes]), + "h i h o d e s U", + ) + + def test_labels(self): + self.assertEqual( + self.breath_group_hello.labels, self.test_case_hello_hiho[1:10] + ) + self.assertEqual( + self.breath_group_hiho.labels, self.test_case_hello_hiho[11:19] + ) + + +class TestUtterance(TestBasePhonemes): + def setUp(self) -> None: + super().setUp() + self.utterance_hello_hiho = Utterance.from_phonemes(self.phonemes_hello_hiho) + + def test_phonemes(self): + self.assertEqual( + " ".join( + [phoneme.phoneme for phoneme in self.utterance_hello_hiho.phonemes] + ), + "sil k o N n i ch i w a pau h i h o d e s U sil", + ) + changed_utterance = Utterance.from_phonemes(self.utterance_hello_hiho.phonemes) + self.assertEqual(len(changed_utterance.breath_groups), 2) + accent_phrases = list( + chain.from_iterable( + breath_group.accent_phrases + for breath_group in changed_utterance.breath_groups + ) + ) + for prev, cent, post in zip( + [None] + accent_phrases[:-1], + accent_phrases, + accent_phrases[1:] + [None], + ): + mora_num = len(cent.moras) + accent = cent.accent + + if prev is not None: + for phoneme in prev.phonemes: + self.assertEqual(phoneme.contexts["g1"], str(mora_num)) + self.assertEqual(phoneme.contexts["g2"], str(accent)) + + if post is not None: + for phoneme in post.phonemes: + self.assertEqual(phoneme.contexts["e1"], str(mora_num)) + self.assertEqual(phoneme.contexts["e2"], str(accent)) + + for phoneme in cent.phonemes: + self.assertEqual( + phoneme.contexts["k2"], + str( + sum( + [ + len(breath_group.accent_phrases) + for breath_group in changed_utterance.breath_groups + ] + ) + ), + ) + + for prev, cent, post in zip( + [None] + changed_utterance.breath_groups[:-1], + changed_utterance.breath_groups, + changed_utterance.breath_groups[1:] + [None], + ): + accent_phrase_num = len(cent.accent_phrases) + + if prev is not None: + for phoneme in prev.phonemes: + self.assertEqual(phoneme.contexts["j1"], str(accent_phrase_num)) + + if post is not None: + for phoneme in post.phonemes: + self.assertEqual(phoneme.contexts["h1"], str(accent_phrase_num)) + + for phoneme in cent.phonemes: + self.assertEqual(phoneme.contexts["i1"], str(accent_phrase_num)) + self.assertEqual( + phoneme.contexts["i5"], + str(accent_phrases.index(cent.accent_phrases[0]) + 1), + ) + self.assertEqual( + phoneme.contexts["i6"], + str( + len(accent_phrases) + - accent_phrases.index(cent.accent_phrases[0]) + ), + ) + + def test_labels(self): + self.assertEqual(self.utterance_hello_hiho.labels, self.test_case_hello_hiho) diff --git a/voicevox_nemo_engine/test/test_kana_parser.py b/voicevox_nemo_engine/test/test_kana_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..ef800b60003b5d14b90a8eeb86e0fa29a919f878 --- /dev/null +++ b/voicevox_nemo_engine/test/test_kana_parser.py @@ -0,0 +1,688 @@ +from typing import List +from unittest import TestCase + +from voicevox_engine import kana_parser +from voicevox_engine.kana_parser import create_kana +from voicevox_engine.model import AccentPhrase, Mora, ParseKanaError, ParseKanaErrorCode + + +def parse_kana(text: str) -> List[AccentPhrase]: + accent_phrases = kana_parser.parse_kana(text) + return accent_phrases + + +class TestParseKana(TestCase): + def test_phrase_length(self): + self.assertEqual(len(parse_kana("ア'/ア'")), 2) + self.assertEqual(len(parse_kana("ア'、ア'")), 2) + self.assertEqual(len(parse_kana("ア'/ア'/ア'/ア'/ア'")), 5) + self.assertEqual(len(parse_kana("ス'")), 1) + self.assertEqual(len(parse_kana("_ス'")), 1) + self.assertEqual(len(parse_kana("ギェ'")), 1) + self.assertEqual(len(parse_kana("ギェ'、ギェ'/ギェ'")), 3) + + def test_accent(self): + self.assertEqual(parse_kana("シャ'シシュシェショ")[0].accent, 1) + self.assertEqual(parse_kana("シャ'_シシュシェショ")[0].accent, 1) + self.assertEqual(parse_kana("シャシ'シュシェショ")[0].accent, 2) + self.assertEqual(parse_kana("シャ_シ'シュシェショ")[0].accent, 2) + self.assertEqual(parse_kana("シャシシュ'シェショ")[0].accent, 3) + self.assertEqual(parse_kana("シャ_シシュ'シェショ")[0].accent, 3) + self.assertEqual(parse_kana("シャシシュシェショ'")[0].accent, 5) + self.assertEqual(parse_kana("シャ_シシュシェショ'")[0].accent, 5) + + def test_mora_length(self): + self.assertEqual(len(parse_kana("シャ'シシュシェショ")[0].moras), 5) + self.assertEqual(len(parse_kana("シャ'_シシュシェショ")[0].moras), 5) + self.assertEqual(len(parse_kana("シャシ'シュシェショ")[0].moras), 5) + self.assertEqual(len(parse_kana("シャ_シ'シュシェショ")[0].moras), 5) + self.assertEqual(len(parse_kana("シャシシュシェショ'")[0].moras), 5) + self.assertEqual(len(parse_kana("シャ_シシュシェショ'")[0].moras), 5) + + def test_pause(self): + self.assertIsNone(parse_kana("ア'/ア'")[0].pause_mora) + self.assertIsNone(parse_kana("ア'/ア'")[1].pause_mora) + self.assertIsNotNone(parse_kana("ア'、ア'")[0].pause_mora) + self.assertIsNone(parse_kana("ア'、ア'")[1].pause_mora) + + def test_unvoice(self): + self.assertEqual(parse_kana("ス'")[0].moras[0].vowel, "u") + self.assertEqual(parse_kana("_ス'")[0].moras[0].vowel, "U") + + def test_roundtrip(self): + for text in ["コンニチワ'", "ワタシワ'/シャチョオデ'_ス", "トテモ'、エラ'インデス"]: + self.assertEqual(create_kana(parse_kana(text)), text) + + for text in ["ヲ'", "ェ'"]: + self.assertEqual(create_kana(parse_kana(text)), text) + + def _accent_phrase_marks_base( + self, text: str, expected_accent_phrases: List[AccentPhrase] + ) -> None: + accent_phrases = kana_parser.parse_kana(text) + self.assertEqual(expected_accent_phrases, accent_phrases) + + def test_accent_phrase_marks(self): + def a_slash_a_accent_phrases(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + ] + + expected_accent_phrases = a_slash_a_accent_phrases() + self._accent_phrase_marks_base( + text="ア'/ア'", + expected_accent_phrases=expected_accent_phrases, + ) + + def a_jp_comma_a_accent_phrases(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=Mora( + text="、", + consonant=None, + consonant_length=None, + vowel="pau", + vowel_length=0.0, + pitch=0.0, + ), + ), + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + ] + + expected_accent_phrases = a_jp_comma_a_accent_phrases() + self._accent_phrase_marks_base( + text="ア'、ア'", + expected_accent_phrases=expected_accent_phrases, + ) + + def a_slash_a_slash_a_slash_a_slash_a_accent_phrases(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + ] + + expected_accent_phrases = a_slash_a_slash_a_slash_a_slash_a_accent_phrases() + self._accent_phrase_marks_base( + text="ア'/ア'/ア'/ア'/ア'", + expected_accent_phrases=expected_accent_phrases, + ) + + def su_accent_phrases(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ス", + consonant="s", + consonant_length=0.0, + vowel="u", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + ] + + expected_accent_phrases = su_accent_phrases() + self._accent_phrase_marks_base( + text="ス'", + expected_accent_phrases=expected_accent_phrases, + ) + + def under_score_su_accent_phrases(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ス", + consonant="s", + consonant_length=0.0, + vowel="U", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + ] + + expected_accent_phrases = under_score_su_accent_phrases() + self._accent_phrase_marks_base( + text="_ス'", + expected_accent_phrases=expected_accent_phrases, + ) + + def gye_accent_phrases(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ギェ", + consonant="gy", + consonant_length=0.0, + vowel="e", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + ] + + expected_accent_phrases = gye_accent_phrases() + self._accent_phrase_marks_base( + text="ギェ'", + expected_accent_phrases=expected_accent_phrases, + ) + + def gye_gye_gye_accent_phrases(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ギェ", + consonant="gy", + consonant_length=0.0, + vowel="e", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=Mora( + text="、", + consonant=None, + consonant_length=None, + vowel="pau", + vowel_length=0.0, + pitch=0.0, + ), + ), + AccentPhrase( + moras=[ + Mora( + text="ギェ", + consonant="gy", + consonant_length=0.0, + vowel="e", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + AccentPhrase( + moras=[ + Mora( + text="ギェ", + consonant="gy", + consonant_length=0.0, + vowel="e", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + ] + + expected_accent_phrases = gye_gye_gye_accent_phrases() + self._accent_phrase_marks_base( + text="ギェ'、ギェ'/ギェ'", + expected_accent_phrases=expected_accent_phrases, + ) + + def test_interrogative_accent_phrase_marks(self): + def a_question_mark_accent_phrases(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + is_interrogative=True, + ), + ] + + expected_accent_phrases = a_question_mark_accent_phrases() + self._accent_phrase_marks_base( + text="ア'?", + expected_accent_phrases=expected_accent_phrases, + ) + + def gye_gye_gye_question_mark_accent_phrases(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ギェ", + consonant="gy", + consonant_length=0.0, + vowel="e", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=Mora( + text="、", + consonant=None, + consonant_length=None, + vowel="pau", + vowel_length=0.0, + pitch=0.0, + ), + ), + AccentPhrase( + moras=[ + Mora( + text="ギェ", + consonant="gy", + consonant_length=0.0, + vowel="e", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + AccentPhrase( + moras=[ + Mora( + text="ギェ", + consonant="gy", + consonant_length=0.0, + vowel="e", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + is_interrogative=True, + ), + ] + + expected_accent_phrases = gye_gye_gye_question_mark_accent_phrases() + self._accent_phrase_marks_base( + text="ギェ'、ギェ'/ギェ'?", + expected_accent_phrases=expected_accent_phrases, + ) + + def a_pause_a_question_pause_a_question_a_question_mark_accent_phrases(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=Mora( + text="、", + consonant=None, + consonant_length=None, + vowel="pau", + vowel_length=0.0, + pitch=0.0, + ), + ), + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=Mora( + text="、", + consonant=None, + consonant_length=None, + vowel="pau", + vowel_length=0.0, + pitch=0.0, + ), + is_interrogative=True, + ), + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + is_interrogative=True, + ), + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + is_interrogative=True, + ), + ] + + expected_accent_phrases = ( + a_pause_a_question_pause_a_question_a_question_mark_accent_phrases() + ) + self._accent_phrase_marks_base( + text="ア'、ア'?、ア'?/ア'?", + expected_accent_phrases=expected_accent_phrases, + ) + + +class TestParseKanaException(TestCase): + def _assert_error_code(self, kana: str, code: ParseKanaErrorCode): + with self.assertRaises(ParseKanaError) as err: + parse_kana(kana) + self.assertEqual(err.exception.errcode, code) + + def test_exceptions(self): + self._assert_error_code("アクセント", ParseKanaErrorCode.ACCENT_NOTFOUND) + self._assert_error_code("'アクセント", ParseKanaErrorCode.ACCENT_TOP) + self._assert_error_code("ア'ク'セント", ParseKanaErrorCode.ACCENT_TWICE) + self._assert_error_code("ひ'らがな", ParseKanaErrorCode.UNKNOWN_TEXT) + self._assert_error_code("__ス'", ParseKanaErrorCode.UNKNOWN_TEXT) + self._assert_error_code("ア'/", ParseKanaErrorCode.EMPTY_PHRASE) + self._assert_error_code("/ア'", ParseKanaErrorCode.EMPTY_PHRASE) + self._assert_error_code("", ParseKanaErrorCode.EMPTY_PHRASE) + + with self.assertRaises(ParseKanaError) as err: + parse_kana("ヒト'ツメ/フタツメ") + self.assertEqual(err.exception.errcode, ParseKanaErrorCode.ACCENT_NOTFOUND) + self.assertEqual(err.exception.kwargs, {"text": "フタツメ"}) + + with self.assertRaises(ParseKanaError) as err: + parse_kana("ア'/") + self.assertEqual(err.exception.errcode, ParseKanaErrorCode.EMPTY_PHRASE) + self.assertEqual(err.exception.kwargs, {"position": "2"}) + + with self.assertRaises(ParseKanaError) as err: + kana_parser.parse_kana("ア?ア'") + self.assertEqual( + err.exception.errcode, ParseKanaErrorCode.INTERROGATION_MARK_NOT_AT_END + ) + + +class TestCreateKana(TestCase): + def test_create_kana_interrogative(self): + def koreha_arimasuka_accent_phrases(): + return [ + AccentPhrase( + moras=[ + Mora( + text="コ", + consonant="k", + consonant_length=2.5, + vowel="o", + vowel_length=2.5, + pitch=2.5, + ), + Mora( + text="レ", + consonant="r", + consonant_length=2.5, + vowel="e", + vowel_length=2.5, + pitch=2.5, + ), + Mora( + text="ワ", + consonant="w", + consonant_length=2.5, + vowel="a", + vowel_length=2.5, + pitch=2.5, + ), + ], + accent=3, + pause_mora=None, + is_interrogative=False, + ), + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=2.5, + pitch=2.5, + ), + Mora( + text="リ", + consonant="r", + consonant_length=2.5, + vowel="i", + vowel_length=2.5, + pitch=2.5, + ), + Mora( + text="マ", + consonant="m", + consonant_length=2.5, + vowel="a", + vowel_length=2.5, + pitch=2.5, + ), + Mora( + text="ス", + consonant="s", + consonant_length=2.5, + vowel="U", + vowel_length=2.5, + pitch=2.5, + ), + Mora( + text="カ", + consonant="k", + consonant_length=2.5, + vowel="a", + vowel_length=2.5, + pitch=2.5, + ), + ], + accent=3, + pause_mora=None, + is_interrogative=False, + ), + ] + + accent_phrases = koreha_arimasuka_accent_phrases() + self.assertEqual(create_kana(accent_phrases), "コレワ'/アリマ'_スカ") + + accent_phrases = koreha_arimasuka_accent_phrases() + accent_phrases[-1].is_interrogative = True + self.assertEqual(create_kana(accent_phrases), "コレワ'/アリマ'_スカ?") + + def kya_accent_phrases(): + return [ + AccentPhrase( + moras=[ + Mora( + text="キャ", + consonant="ky", + consonant_length=2.5, + vowel="a", + vowel_length=2.5, + pitch=2.5, + ), + Mora( + text="ッ", + consonant=None, + consonant_length=None, + vowel="cl", + vowel_length=0.1, + pitch=0, + ), + ], + accent=1, + pause_mora=None, + is_interrogative=False, + ), + ] + + accent_phrases = kya_accent_phrases() + self.assertEqual(create_kana(accent_phrases), "キャ'ッ") + + accent_phrases = kya_accent_phrases() + accent_phrases[-1].is_interrogative = True + self.assertEqual(create_kana(accent_phrases), "キャ'ッ?") diff --git a/voicevox_nemo_engine/test/test_mock_synthesis_engine.py b/voicevox_nemo_engine/test/test_mock_synthesis_engine.py new file mode 100644 index 0000000000000000000000000000000000000000..ce6c598254c7cce196d2063711996ad787ce8815 --- /dev/null +++ b/voicevox_nemo_engine/test/test_mock_synthesis_engine.py @@ -0,0 +1,140 @@ +from unittest import TestCase + +from voicevox_engine.dev.synthesis_engine import MockSynthesisEngine +from voicevox_engine.kana_parser import create_kana +from voicevox_engine.model import AccentPhrase, AudioQuery, Mora + + +class TestMockSynthesisEngine(TestCase): + def setUp(self): + super().setUp() + + self.accent_phrases_hello_hiho = [ + AccentPhrase( + moras=[ + Mora( + text="コ", + consonant="k", + consonant_length=0.0, + vowel="o", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="ン", + consonant=None, + consonant_length=None, + vowel="N", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="ニ", + consonant="n", + consonant_length=0.0, + vowel="i", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="チ", + consonant="ch", + consonant_length=0.0, + vowel="i", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="ワ", + consonant="w", + consonant_length=0.0, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=5, + pause_mora=Mora( + text="、", + consonant=None, + consonant_length=None, + vowel="pau", + vowel_length=0.0, + pitch=0.0, + ), + ), + AccentPhrase( + moras=[ + Mora( + text="ヒ", + consonant="h", + consonant_length=0.0, + vowel="i", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="ホ", + consonant="h", + consonant_length=0.0, + vowel="o", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="デ", + consonant="d", + consonant_length=0.0, + vowel="e", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="ス", + consonant="s", + consonant_length=0.0, + vowel="U", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + ] + self.engine = MockSynthesisEngine(speakers="", supported_devices="") + + def test_replace_phoneme_length(self): + self.assertEqual( + self.engine.replace_phoneme_length( + accent_phrases=self.accent_phrases_hello_hiho, + style_id=0, + ), + self.accent_phrases_hello_hiho, + ) + + def test_replace_mora_pitch(self): + self.assertEqual( + self.engine.replace_mora_pitch( + accent_phrases=self.accent_phrases_hello_hiho, + style_id=0, + ), + self.accent_phrases_hello_hiho, + ) + + def test_synthesis(self): + self.engine.synthesis( + AudioQuery( + accent_phrases=self.accent_phrases_hello_hiho, + speedScale=1, + pitchScale=0, + intonationScale=1, + volumeScale=1, + prePhonemeLength=0.1, + postPhonemeLength=0.1, + outputSamplingRate=24000, + outputStereo=False, + kana=create_kana(self.accent_phrases_hello_hiho), + ), + style_id=0, + ) diff --git a/voicevox_nemo_engine/test/test_mora_list.py b/voicevox_nemo_engine/test/test_mora_list.py new file mode 100644 index 0000000000000000000000000000000000000000..25b287fa0e8b0febb1895ac84223823915e548ea --- /dev/null +++ b/voicevox_nemo_engine/test/test_mora_list.py @@ -0,0 +1,20 @@ +from unittest import TestCase + +from voicevox_engine.mora_list import openjtalk_mora2text + + +class TestOpenJTalkMoraList(TestCase): + def test_mora2text(self): + self.assertEqual("ッ", openjtalk_mora2text["cl"]) + self.assertEqual("ティ", openjtalk_mora2text["ti"]) + self.assertEqual("トゥ", openjtalk_mora2text["tu"]) + self.assertEqual("ディ", openjtalk_mora2text["di"]) + # GitHub issue #60 + self.assertEqual("ギェ", openjtalk_mora2text["gye"]) + self.assertEqual("イェ", openjtalk_mora2text["ye"]) + + def test_mora2text_injective(self): + """異なるモーラが同じ読みがなに対応しないか確認する""" + values = list(openjtalk_mora2text.values()) + uniq_values = list(set(values)) + self.assertCountEqual(values, uniq_values) diff --git a/voicevox_nemo_engine/test/test_mora_to_text.py b/voicevox_nemo_engine/test/test_mora_to_text.py new file mode 100644 index 0000000000000000000000000000000000000000..691681dd1b202731eb5dde45e083b4d6c7526743 --- /dev/null +++ b/voicevox_nemo_engine/test/test_mora_to_text.py @@ -0,0 +1,29 @@ +from unittest import TestCase + +# TODO: import from voicevox_engine.synthesis_engine.mora +from voicevox_engine.synthesis_engine.synthesis_engine_base import mora_to_text + + +class TestMoraToText(TestCase): + def test_voice(self): + self.assertEqual(mora_to_text("a"), "ア") + self.assertEqual(mora_to_text("i"), "イ") + self.assertEqual(mora_to_text("ka"), "カ") + self.assertEqual(mora_to_text("N"), "ン") + self.assertEqual(mora_to_text("cl"), "ッ") + self.assertEqual(mora_to_text("gye"), "ギェ") + self.assertEqual(mora_to_text("ye"), "イェ") + self.assertEqual(mora_to_text("wo"), "ウォ") + + def test_unvoice(self): + self.assertEqual(mora_to_text("A"), "ア") + self.assertEqual(mora_to_text("I"), "イ") + self.assertEqual(mora_to_text("kA"), "カ") + self.assertEqual(mora_to_text("gyE"), "ギェ") + self.assertEqual(mora_to_text("yE"), "イェ") + self.assertEqual(mora_to_text("wO"), "ウォ") + + def test_invalid_mora(self): + """変なモーラが来ても例外を投げない""" + self.assertEqual(mora_to_text("x"), "x") + self.assertEqual(mora_to_text(""), "") diff --git a/voicevox_nemo_engine/test/test_preset.py b/voicevox_nemo_engine/test/test_preset.py new file mode 100644 index 0000000000000000000000000000000000000000..3a162829c18798a704ef86d958efa87dbc1dca25 --- /dev/null +++ b/voicevox_nemo_engine/test/test_preset.py @@ -0,0 +1,303 @@ +from os import remove +from pathlib import Path +from shutil import copyfile +from tempfile import TemporaryDirectory +from unittest import TestCase + +from voicevox_engine.preset import Preset, PresetError, PresetManager + + +class TestPresetManager(TestCase): + def setUp(self): + self.tmp_dir = TemporaryDirectory() + self.tmp_dir_path = Path(self.tmp_dir.name) + + def tearDown(self): + self.tmp_dir.cleanup() + + def test_validation(self): + preset_manager = PresetManager(preset_path=Path("test/presets-test-1.yaml")) + presets = preset_manager.load_presets() + self.assertFalse(presets is None) + + def test_validation_same(self): + preset_manager = PresetManager(preset_path=Path("test/presets-test-1.yaml")) + presets = preset_manager.load_presets() + presets2 = preset_manager.load_presets() + self.assertFalse(presets is None) + self.assertEqual(presets, presets2) + + def test_validation_2(self): + preset_manager = PresetManager(preset_path=Path("test/presets-test-2.yaml")) + with self.assertRaises(PresetError, msg="プリセットの設定ファイルにミスがあります"): + preset_manager.load_presets() + + def test_preset_id(self): + preset_manager = PresetManager(preset_path=Path("test/presets-test-3.yaml")) + with self.assertRaises(PresetError, msg="プリセットのidに重複があります"): + preset_manager.load_presets() + + def test_empty_file(self): + preset_manager = PresetManager(preset_path=Path("test/presets-test-4.yaml")) + with self.assertRaises(PresetError, msg="プリセットの設定ファイルが空の内容です"): + preset_manager.load_presets() + + def test_not_exist_file(self): + preset_manager = PresetManager(preset_path=Path("test/presets-dummy.yaml")) + with self.assertRaises(PresetError, msg="プリセットの設定ファイルが見つかりません"): + preset_manager.load_presets() + + def test_add_preset(self): + temp_path = self.tmp_dir_path / "presets-test-temp.yaml" + copyfile(Path("test/presets-test-1.yaml"), temp_path) + preset_manager = PresetManager(preset_path=temp_path) + preset = Preset( + **{ + "id": 10, + "name": "test10", + "speaker_uuid": "7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff", + "style_id": 2, + "speedScale": 1, + "pitchScale": 1, + "intonationScale": 0.5, + "volumeScale": 1, + "prePhonemeLength": 0.1, + "postPhonemeLength": 0.1, + } + ) + id = preset_manager.add_preset(preset) + self.assertEqual(id, 10) + self.assertEqual(len(preset_manager.presets), 3) + for _preset in preset_manager.presets: + if _preset.id == id: + self.assertEqual(_preset, preset) + remove(temp_path) + + def test_add_preset_load_failure(self): + preset_manager = PresetManager(preset_path=Path("test/presets-test-2.yaml")) + with self.assertRaises(PresetError, msg="プリセットの設定ファイルにミスがあります"): + preset_manager.add_preset( + Preset( + **{ + "id": 1, + "name": "", + "speaker_uuid": "", + "style_id": 0, + "speedScale": 0, + "pitchScale": 0, + "intonationScale": 0, + "volumeScale": 0, + "prePhonemeLength": 0, + "postPhonemeLength": 0, + } + ) + ) + + def test_add_preset_conflict_id(self): + temp_path = self.tmp_dir_path / "presets-test-temp.yaml" + copyfile(Path("test/presets-test-1.yaml"), temp_path) + preset_manager = PresetManager(preset_path=temp_path) + preset = Preset( + **{ + "id": 2, + "name": "test3", + "speaker_uuid": "7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff", + "style_id": 2, + "speedScale": 1, + "pitchScale": 1, + "intonationScale": 0.5, + "volumeScale": 1, + "prePhonemeLength": 0.1, + "postPhonemeLength": 0.1, + } + ) + id = preset_manager.add_preset(preset) + self.assertEqual(id, 3) + self.assertEqual(len(preset_manager.presets), 3) + for _preset in preset_manager.presets: + if _preset.id == id: + self.assertEqual(_preset, preset) + remove(temp_path) + + def test_add_preset_conflict_id2(self): + temp_path = self.tmp_dir_path / "presets-test-temp.yaml" + copyfile(Path("test/presets-test-1.yaml"), temp_path) + preset_manager = PresetManager(preset_path=temp_path) + preset = Preset( + **{ + "id": -1, + "name": "test3", + "speaker_uuid": "7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff", + "style_id": 2, + "speedScale": 1, + "pitchScale": 1, + "intonationScale": 0.5, + "volumeScale": 1, + "prePhonemeLength": 0.1, + "postPhonemeLength": 0.1, + } + ) + id = preset_manager.add_preset(preset) + self.assertEqual(id, 3) + self.assertEqual(len(preset_manager.presets), 3) + for _preset in preset_manager.presets: + if _preset.id == id: + self.assertEqual(_preset, preset) + remove(temp_path) + + def test_add_preset_write_failure(self): + temp_path = self.tmp_dir_path / "presets-test-temp.yaml" + copyfile(Path("test/presets-test-1.yaml"), temp_path) + preset_manager = PresetManager(preset_path=temp_path) + preset = Preset( + **{ + "id": 10, + "name": "test10", + "speaker_uuid": "7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff", + "style_id": 2, + "speedScale": 1, + "pitchScale": 1, + "intonationScale": 0.5, + "volumeScale": 1, + "prePhonemeLength": 0.1, + "postPhonemeLength": 0.1, + } + ) + preset_manager.load_presets() + preset_manager.load_presets = lambda: [] + preset_manager.preset_path = "" + with self.assertRaises(PresetError, msg="プリセットの設定ファイルに書き込み失敗しました"): + preset_manager.add_preset(preset) + self.assertEqual(len(preset_manager.presets), 2) + remove(temp_path) + + def test_update_preset(self): + temp_path = self.tmp_dir_path / "presets-test-temp.yaml" + copyfile(Path("test/presets-test-1.yaml"), temp_path) + preset_manager = PresetManager(preset_path=temp_path) + preset = Preset( + **{ + "id": 1, + "name": "test1 new", + "speaker_uuid": "7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff", + "style_id": 2, + "speedScale": 1, + "pitchScale": 1, + "intonationScale": 0.5, + "volumeScale": 1, + "prePhonemeLength": 0.1, + "postPhonemeLength": 0.1, + } + ) + id = preset_manager.update_preset(preset) + self.assertEqual(id, 1) + self.assertEqual(len(preset_manager.presets), 2) + for _preset in preset_manager.presets: + if _preset.id == id: + self.assertEqual(_preset, preset) + remove(temp_path) + + def test_update_preset_load_failure(self): + preset_manager = PresetManager(preset_path=Path("test/presets-test-2.yaml")) + with self.assertRaises(PresetError, msg="プリセットの設定ファイルにミスがあります"): + preset_manager.update_preset( + Preset( + **{ + "id": 1, + "name": "", + "speaker_uuid": "", + "style_id": 0, + "speedScale": 0, + "pitchScale": 0, + "intonationScale": 0, + "volumeScale": 0, + "prePhonemeLength": 0, + "postPhonemeLength": 0, + } + ) + ) + + def test_update_preset_not_found(self): + temp_path = self.tmp_dir_path / "presets-test-temp.yaml" + copyfile(Path("test/presets-test-1.yaml"), temp_path) + preset_manager = PresetManager(preset_path=temp_path) + preset = Preset( + **{ + "id": 10, + "name": "test1 new", + "speaker_uuid": "7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff", + "style_id": 2, + "speedScale": 1, + "pitchScale": 1, + "intonationScale": 0.5, + "volumeScale": 1, + "prePhonemeLength": 0.1, + "postPhonemeLength": 0.1, + } + ) + with self.assertRaises(PresetError, msg="更新先のプリセットが存在しません"): + preset_manager.update_preset(preset) + self.assertEqual(len(preset_manager.presets), 2) + remove(temp_path) + + def test_update_preset_write_failure(self): + temp_path = self.tmp_dir_path / "presets-test-temp.yaml" + copyfile(Path("test/presets-test-1.yaml"), temp_path) + preset_manager = PresetManager(preset_path=temp_path) + preset = Preset( + **{ + "id": 1, + "name": "test1 new", + "speaker_uuid": "7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff", + "style_id": 2, + "speedScale": 1, + "pitchScale": 1, + "intonationScale": 0.5, + "volumeScale": 1, + "prePhonemeLength": 0.1, + "postPhonemeLength": 0.1, + } + ) + preset_manager.load_presets() + preset_manager.load_presets = lambda: [] + preset_manager.preset_path = "" + with self.assertRaises(PresetError, msg="プリセットの設定ファイルに書き込み失敗しました"): + preset_manager.update_preset(preset) + self.assertEqual(len(preset_manager.presets), 2) + self.assertEqual(preset_manager.presets[0].name, "test") + remove(temp_path) + + def test_delete_preset(self): + temp_path = self.tmp_dir_path / "presets-test-temp.yaml" + copyfile(Path("test/presets-test-1.yaml"), temp_path) + preset_manager = PresetManager(preset_path=temp_path) + id = preset_manager.delete_preset(1) + self.assertEqual(id, 1) + self.assertEqual(len(preset_manager.presets), 1) + remove(temp_path) + + def test_delete_preset_load_failure(self): + preset_manager = PresetManager(preset_path=Path("test/presets-test-2.yaml")) + with self.assertRaises(PresetError, msg="プリセットの設定ファイルにミスがあります"): + preset_manager.delete_preset(10) + + def test_delete_preset_not_found(self): + temp_path = self.tmp_dir_path / "presets-test-temp.yaml" + copyfile(Path("test/presets-test-1.yaml"), temp_path) + preset_manager = PresetManager(preset_path=temp_path) + with self.assertRaises(PresetError, msg="削除対象のプリセットが存在しません"): + preset_manager.delete_preset(10) + self.assertEqual(len(preset_manager.presets), 2) + remove(temp_path) + + def test_delete_preset_write_failure(self): + temp_path = self.tmp_dir_path / "presets-test-temp.yaml" + copyfile(Path("test/presets-test-1.yaml"), temp_path) + preset_manager = PresetManager(preset_path=temp_path) + preset_manager.load_presets() + preset_manager.load_presets = lambda: [] + preset_manager.preset_path = "" + with self.assertRaises(PresetError, msg="プリセットの設定ファイルに書き込み失敗しました"): + preset_manager.delete_preset(1) + self.assertEqual(len(preset_manager.presets), 2) + remove(temp_path) diff --git a/voicevox_nemo_engine/test/test_setting.py b/voicevox_nemo_engine/test/test_setting.py new file mode 100644 index 0000000000000000000000000000000000000000..494e3095e1e26b74bb70436f5ff317bca26b13c7 --- /dev/null +++ b/voicevox_nemo_engine/test/test_setting.py @@ -0,0 +1,72 @@ +from pathlib import Path +from tempfile import TemporaryDirectory +from unittest import TestCase + +from voicevox_engine.setting import CorsPolicyMode, Setting, SettingLoader + + +class TestSettingLoader(TestCase): + def setUp(self): + self.tmp_dir = TemporaryDirectory() + self.tmp_dir_path = Path(self.tmp_dir.name) + + def test_loading_1(self): + setting_loader = SettingLoader(Path("not_exist.yaml")) + settings = setting_loader.load_setting_file() + + self.assertEqual( + settings.dict(), + {"allow_origin": None, "cors_policy_mode": CorsPolicyMode.localapps}, + ) + + def test_loading_2(self): + setting_loader = SettingLoader( + setting_file_path=Path("test/setting-test-load-1.yaml") + ) + settings = setting_loader.load_setting_file() + + self.assertEqual( + settings.dict(), + {"allow_origin": None, "cors_policy_mode": CorsPolicyMode.localapps}, + ) + + def test_loading_3(self): + setting_loader = SettingLoader( + setting_file_path=Path("test/setting-test-load-2.yaml") + ) + settings = setting_loader.load_setting_file() + + self.assertEqual( + settings.dict(), + {"allow_origin": None, "cors_policy_mode": "all"}, + ) + + def test_loading_4(self): + setting_loader = SettingLoader( + setting_file_path=Path("test/setting-test-load-3.yaml") + ) + settings = setting_loader.load_setting_file() + + self.assertEqual( + settings.dict(), + { + "allow_origin": "192.168.254.255 192.168.255.255", + "cors_policy_mode": CorsPolicyMode.localapps, + }, + ) + + def test_dump(self): + setting_loader = SettingLoader( + setting_file_path=Path(self.tmp_dir_path / "setting-test-dump.yaml") + ) + settings = Setting(cors_policy_mode=CorsPolicyMode.localapps) + setting_loader.dump_setting_file(settings) + + self.assertTrue(setting_loader.setting_file_path.is_file()) + self.assertEqual( + setting_loader.load_setting_file().dict(), + {"allow_origin": None, "cors_policy_mode": CorsPolicyMode.localapps}, + ) + + def tearDown(self): + self.tmp_dir.cleanup() diff --git a/voicevox_nemo_engine/test/test_synthesis_engine.py b/voicevox_nemo_engine/test/test_synthesis_engine.py new file mode 100644 index 0000000000000000000000000000000000000000..c7d992293b56ad5eaaebadbb251fae5236254bae --- /dev/null +++ b/voicevox_nemo_engine/test/test_synthesis_engine.py @@ -0,0 +1,654 @@ +import math +from copy import deepcopy +from random import random +from typing import Union +from unittest import TestCase +from unittest.mock import Mock + +import numpy + +from voicevox_engine.acoustic_feature_extractor import OjtPhoneme +from voicevox_engine.model import AccentPhrase, AudioQuery, Mora +from voicevox_engine.synthesis_engine import SynthesisEngine + +# TODO: import from voicevox_engine.synthesis_engine.mora +from voicevox_engine.synthesis_engine.synthesis_engine import ( + mora_phoneme_list, + pre_process, + split_mora, + to_flatten_moras, + to_phoneme_data_list, + unvoiced_mora_phoneme_list, +) + + +def yukarin_s_mock(length: int, phoneme_list: numpy.ndarray, style_id: numpy.ndarray): + result = [] + # mockとしての適当な処理、特に意味はない + for i in range(length): + result.append(float(phoneme_list[i] * 0.5 + style_id)) + return numpy.array(result) + + +def yukarin_sa_mock( + length: int, + vowel_phoneme_list: numpy.ndarray, + consonant_phoneme_list: numpy.ndarray, + start_accent_list: numpy.ndarray, + end_accent_list: numpy.ndarray, + start_accent_phrase_list: numpy.ndarray, + end_accent_phrase_list: numpy.ndarray, + style_id: numpy.ndarray, +): + result = [] + # mockとしての適当な処理、特に意味はない + for i in range(length): + result.append( + float( + ( + vowel_phoneme_list[0][i] + + consonant_phoneme_list[0][i] + + start_accent_list[0][i] + + end_accent_list[0][i] + + start_accent_phrase_list[0][i] + + end_accent_phrase_list[0][i] + ) + * 0.5 + + style_id + ) + ) + return numpy.array(result)[numpy.newaxis] + + +def decode_mock( + length: int, + phoneme_size: int, + f0: numpy.ndarray, + phoneme: numpy.ndarray, + style_id: Union[numpy.ndarray, int], +): + result = [] + # mockとしての適当な処理、特に意味はない + for i in range(length): + # decode forwardはデータサイズがlengthの256倍になるのでとりあえず256回データをresultに入れる + for _ in range(256): + result.append( + float( + f0[i][0] * (numpy.where(phoneme[i] == 1)[0] / phoneme_size) + + style_id + ) + ) + return numpy.array(result) + + +class MockCore: + yukarin_s_forward = Mock(side_effect=yukarin_s_mock) + yukarin_sa_forward = Mock(side_effect=yukarin_sa_mock) + decode_forward = Mock(side_effect=decode_mock) + + def metas(self): + return "" + + def supported_devices(self): + return "" + + def is_model_loaded(self, style_id): + return True + + +class TestSynthesisEngine(TestCase): + def setUp(self): + super().setUp() + self.str_list_hello_hiho = ( + "sil k o N n i ch i w a pau h i h o d e s U sil".split() + ) + self.phoneme_data_list_hello_hiho = [ + OjtPhoneme(phoneme=p, start=i, end=i + 1) + for i, p in enumerate( + "pau k o N n i ch i w a pau h i h o d e s U pau".split() + ) + ] + self.accent_phrases_hello_hiho = [ + AccentPhrase( + moras=[ + Mora( + text="コ", + consonant="k", + consonant_length=0.0, + vowel="o", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="ン", + consonant=None, + consonant_length=None, + vowel="N", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="ニ", + consonant="n", + consonant_length=0.0, + vowel="i", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="チ", + consonant="ch", + consonant_length=0.0, + vowel="i", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="ワ", + consonant="w", + consonant_length=0.0, + vowel="a", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=5, + pause_mora=Mora( + text="、", + consonant=None, + consonant_length=None, + vowel="pau", + vowel_length=0.0, + pitch=0.0, + ), + ), + AccentPhrase( + moras=[ + Mora( + text="ヒ", + consonant="h", + consonant_length=0.0, + vowel="i", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="ホ", + consonant="h", + consonant_length=0.0, + vowel="o", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="デ", + consonant="d", + consonant_length=0.0, + vowel="e", + vowel_length=0.0, + pitch=0.0, + ), + Mora( + text="ス", + consonant="s", + consonant_length=0.0, + vowel="U", + vowel_length=0.0, + pitch=0.0, + ), + ], + accent=1, + pause_mora=None, + ), + ] + core = MockCore() + self.yukarin_s_mock = core.yukarin_s_forward + self.yukarin_sa_mock = core.yukarin_sa_forward + self.decode_mock = core.decode_forward + self.synthesis_engine = SynthesisEngine( + core=core, + ) + + def test_to_flatten_moras(self): + flatten_moras = to_flatten_moras(self.accent_phrases_hello_hiho) + self.assertEqual( + flatten_moras, + self.accent_phrases_hello_hiho[0].moras + + [self.accent_phrases_hello_hiho[0].pause_mora] + + self.accent_phrases_hello_hiho[1].moras, + ) + + def test_to_phoneme_data_list(self): + phoneme_data_list = to_phoneme_data_list(self.str_list_hello_hiho) + self.assertEqual(phoneme_data_list, self.phoneme_data_list_hello_hiho) + + def test_split_mora(self): + consonant_phoneme_list, vowel_phoneme_list, vowel_indexes = split_mora( + self.phoneme_data_list_hello_hiho + ) + + self.assertEqual(vowel_indexes, [0, 2, 3, 5, 7, 9, 10, 12, 14, 16, 18, 19]) + self.assertEqual( + vowel_phoneme_list, + [ + OjtPhoneme(phoneme="pau", start=0, end=1), + OjtPhoneme(phoneme="o", start=2, end=3), + OjtPhoneme(phoneme="N", start=3, end=4), + OjtPhoneme(phoneme="i", start=5, end=6), + OjtPhoneme(phoneme="i", start=7, end=8), + OjtPhoneme(phoneme="a", start=9, end=10), + OjtPhoneme(phoneme="pau", start=10, end=11), + OjtPhoneme(phoneme="i", start=12, end=13), + OjtPhoneme(phoneme="o", start=14, end=15), + OjtPhoneme(phoneme="e", start=16, end=17), + OjtPhoneme(phoneme="U", start=18, end=19), + OjtPhoneme(phoneme="pau", start=19, end=20), + ], + ) + self.assertEqual( + consonant_phoneme_list, + [ + None, + OjtPhoneme(phoneme="k", start=1, end=2), + None, + OjtPhoneme(phoneme="n", start=4, end=5), + OjtPhoneme(phoneme="ch", start=6, end=7), + OjtPhoneme(phoneme="w", start=8, end=9), + None, + OjtPhoneme(phoneme="h", start=11, end=12), + OjtPhoneme(phoneme="h", start=13, end=14), + OjtPhoneme(phoneme="d", start=15, end=16), + OjtPhoneme(phoneme="s", start=17, end=18), + None, + ], + ) + + def test_pre_process(self): + flatten_moras, phoneme_data_list = pre_process( + deepcopy(self.accent_phrases_hello_hiho) + ) + + mora_index = 0 + phoneme_index = 1 + + self.assertEqual(phoneme_data_list[0], OjtPhoneme("pau", 0, 1)) + for accent_phrase in self.accent_phrases_hello_hiho: + moras = accent_phrase.moras + for mora in moras: + self.assertEqual(flatten_moras[mora_index], mora) + mora_index += 1 + if mora.consonant is not None: + self.assertEqual( + phoneme_data_list[phoneme_index], + OjtPhoneme(mora.consonant, phoneme_index, phoneme_index + 1), + ) + phoneme_index += 1 + self.assertEqual( + phoneme_data_list[phoneme_index], + OjtPhoneme(mora.vowel, phoneme_index, phoneme_index + 1), + ) + phoneme_index += 1 + if accent_phrase.pause_mora: + self.assertEqual(flatten_moras[mora_index], accent_phrase.pause_mora) + mora_index += 1 + self.assertEqual( + phoneme_data_list[phoneme_index], + OjtPhoneme("pau", phoneme_index, phoneme_index + 1), + ) + phoneme_index += 1 + self.assertEqual( + phoneme_data_list[phoneme_index], + OjtPhoneme("pau", phoneme_index, phoneme_index + 1), + ) + + def test_replace_phoneme_length(self): + result = self.synthesis_engine.replace_phoneme_length( + accent_phrases=deepcopy(self.accent_phrases_hello_hiho), style_id=1 + ) + + # yukarin_sに渡される値の検証 + yukarin_s_args = self.yukarin_s_mock.call_args[1] + list_length = yukarin_s_args["length"] + phoneme_list = yukarin_s_args["phoneme_list"] + self.assertEqual(list_length, 20) + self.assertEqual(list_length, len(phoneme_list)) + numpy.testing.assert_array_equal( + phoneme_list, + numpy.array( + [ + 0, + 23, + 30, + 4, + 28, + 21, + 10, + 21, + 42, + 7, + 0, + 19, + 21, + 19, + 30, + 12, + 14, + 35, + 6, + 0, + ], + dtype=numpy.int64, + ), + ) + self.assertEqual(yukarin_s_args["style_id"], 1) + + # flatten_morasを使わずに愚直にaccent_phrasesにデータを反映させてみる + true_result = deepcopy(self.accent_phrases_hello_hiho) + index = 1 + + def result_value(i: int): + return float(phoneme_list[i] * 0.5 + 1) + + for accent_phrase in true_result: + moras = accent_phrase.moras + for mora in moras: + if mora.consonant is not None: + mora.consonant_length = result_value(index) + index += 1 + mora.vowel_length = result_value(index) + index += 1 + if accent_phrase.pause_mora is not None: + accent_phrase.pause_mora.vowel_length = result_value(index) + index += 1 + + self.assertEqual(result, true_result) + + def test_replace_mora_pitch(self): + # 空のリストでエラーを吐かないか + empty_accent_phrases = [] + self.assertEqual( + self.synthesis_engine.replace_mora_pitch( + accent_phrases=empty_accent_phrases, style_id=1 + ), + [], + ) + + result = self.synthesis_engine.replace_mora_pitch( + accent_phrases=deepcopy(self.accent_phrases_hello_hiho), style_id=1 + ) + + # yukarin_saに渡される値の検証 + yukarin_sa_args = self.yukarin_sa_mock.call_args[1] + list_length = yukarin_sa_args["length"] + vowel_phoneme_list = yukarin_sa_args["vowel_phoneme_list"][0] + consonant_phoneme_list = yukarin_sa_args["consonant_phoneme_list"][0] + start_accent_list = yukarin_sa_args["start_accent_list"][0] + end_accent_list = yukarin_sa_args["end_accent_list"][0] + start_accent_phrase_list = yukarin_sa_args["start_accent_phrase_list"][0] + end_accent_phrase_list = yukarin_sa_args["end_accent_phrase_list"][0] + self.assertEqual(list_length, 12) + self.assertEqual(list_length, len(vowel_phoneme_list)) + self.assertEqual(list_length, len(consonant_phoneme_list)) + self.assertEqual(list_length, len(start_accent_list)) + self.assertEqual(list_length, len(end_accent_list)) + self.assertEqual(list_length, len(start_accent_phrase_list)) + self.assertEqual(list_length, len(end_accent_phrase_list)) + self.assertEqual(yukarin_sa_args["style_id"], 1) + + numpy.testing.assert_array_equal( + vowel_phoneme_list, + numpy.array( + [ + 0, + 30, + 4, + 21, + 21, + 7, + 0, + 21, + 30, + 14, + 6, + 0, + ] + ), + ) + numpy.testing.assert_array_equal( + consonant_phoneme_list, + numpy.array( + [ + -1, + 23, + -1, + 28, + 10, + 42, + -1, + 19, + 19, + 12, + 35, + -1, + ] + ), + ) + numpy.testing.assert_array_equal( + start_accent_list, numpy.array([0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0]) + ) + numpy.testing.assert_array_equal( + end_accent_list, numpy.array([0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0]) + ) + numpy.testing.assert_array_equal( + start_accent_phrase_list, numpy.array([0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0]) + ) + numpy.testing.assert_array_equal( + end_accent_phrase_list, numpy.array([0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0]) + ) + + # flatten_morasを使わずに愚直にaccent_phrasesにデータを反映させてみる + true_result = deepcopy(self.accent_phrases_hello_hiho) + index = 1 + + def result_value(i: int): + # unvoiced_mora_phoneme_listのPhoneme ID版 + unvoiced_mora_phoneme_id_list = [ + OjtPhoneme(p, 0, 0).phoneme_id for p in unvoiced_mora_phoneme_list + ] + if vowel_phoneme_list[i] in unvoiced_mora_phoneme_id_list: + return 0 + return ( + vowel_phoneme_list[i] + + consonant_phoneme_list[i] + + start_accent_list[i] + + end_accent_list[i] + + start_accent_phrase_list[i] + + end_accent_phrase_list[i] + ) * 0.5 + 1 + + for accent_phrase in true_result: + moras = accent_phrase.moras + for mora in moras: + mora.pitch = result_value(index) + index += 1 + if accent_phrase.pause_mora is not None: + accent_phrase.pause_mora.pitch = result_value(index) + index += 1 + + self.assertEqual(result, true_result) + + def synthesis_test_base(self, audio_query: AudioQuery): + accent_phrases = audio_query.accent_phrases + + # decode forwardのために適当にpitchとlengthを設定し、リストで持っておく + phoneme_length_list = [0.0] + phoneme_id_list = [0] + f0_list = [0.0] + for accent_phrase in accent_phrases: + moras = accent_phrase.moras + for mora in moras: + if mora.consonant is not None: + mora.consonant_length = 0.1 + phoneme_length_list.append(0.1) + phoneme_id_list.append(OjtPhoneme(mora.consonant, 0, 0).phoneme_id) + mora.vowel_length = 0.2 + phoneme_length_list.append(0.2) + phoneme_id_list.append(OjtPhoneme(mora.vowel, 0, 0).phoneme_id) + if mora.vowel not in unvoiced_mora_phoneme_list: + mora.pitch = 5.0 + random() + f0_list.append(mora.pitch) + if accent_phrase.pause_mora is not None: + accent_phrase.pause_mora.vowel_length = 0.2 + phoneme_length_list.append(0.2) + phoneme_id_list.append(OjtPhoneme("pau", 0, 0).phoneme_id) + f0_list.append(0.0) + phoneme_length_list.append(0.0) + phoneme_id_list.append(0) + f0_list.append(0.0) + + phoneme_length_list[0] = audio_query.prePhonemeLength + phoneme_length_list[-1] = audio_query.postPhonemeLength + + for i in range(len(phoneme_length_list)): + phoneme_length_list[i] /= audio_query.speedScale + + result = self.synthesis_engine.synthesis(query=audio_query, style_id=1) + + # decodeに渡される値の検証 + decode_args = self.decode_mock.call_args[1] + list_length = decode_args["length"] + self.assertEqual( + list_length, + int(sum([round(p * 24000 / 256) for p in phoneme_length_list])), + ) + + num_phoneme = OjtPhoneme.num_phoneme + # mora_phoneme_listのPhoneme ID版 + mora_phoneme_id_list = [ + OjtPhoneme(p, 0, 0).phoneme_id for p in mora_phoneme_list + ] + + # numpy.repeatをfor文でやる + f0 = [] + phoneme = [] + f0_index = 0 + mean_f0 = [] + for i, phoneme_length in enumerate(phoneme_length_list): + f0_single = numpy.array(f0_list[f0_index], dtype=numpy.float32) * ( + 2**audio_query.pitchScale + ) + for _ in range(int(round(phoneme_length * (24000 / 256)))): + f0.append([f0_single]) + phoneme_s = [] + for _ in range(num_phoneme): + phoneme_s.append(0) + # one hot + phoneme_s[phoneme_id_list[i]] = 1 + phoneme.append(phoneme_s) + # consonantとvowelを判別し、vowelであればf0_indexを一つ進める + if phoneme_id_list[i] in mora_phoneme_id_list: + if f0_single > 0: + mean_f0.append(f0_single) + f0_index += 1 + + mean_f0 = numpy.array(mean_f0, dtype=numpy.float32).mean() + f0 = numpy.array(f0, dtype=numpy.float32) + for i in range(len(f0)): + if f0[i][0] != 0.0: + f0[i][0] = (f0[i][0] - mean_f0) * audio_query.intonationScale + mean_f0 + + phoneme = numpy.array(phoneme, dtype=numpy.float32) + + # 乱数の影響で数値の位置がずれが生じるので、大半(4/5)があっていればよしとする + # また、上の部分のint(round(phoneme_length * (24000 / 256)))の影響で + # 本来のf0/phonemeとテスト生成したf0/phonemeの長さが変わることがあり、 + # テスト生成したものが若干長くなることがあるので、本来のものの長さを基準にassertする + assert_f0_count = 0 + decode_f0 = decode_args["f0"] + for i in range(len(decode_f0)): + # 乱数の影響等で数値にずれが生じるので、10の-5乗までの近似値であれば許容する + assert_f0_count += math.isclose(f0[i][0], decode_f0[i][0], rel_tol=10e-5) + self.assertTrue(assert_f0_count >= int(len(decode_f0) / 5) * 4) + assert_phoneme_count = 0 + decode_phoneme = decode_args["phoneme"] + for i in range(len(decode_phoneme)): + assert_true_count = 0 + for j in range(len(decode_phoneme[i])): + assert_true_count += bool(phoneme[i][j] == decode_phoneme[i][j]) + assert_phoneme_count += assert_true_count == num_phoneme + self.assertTrue(assert_phoneme_count >= int(len(decode_phoneme) / 5) * 4) + self.assertEqual(decode_args["style_id"], 1) + + # decode forwarderのmockを使う + true_result = decode_mock(list_length, num_phoneme, f0, phoneme, 1) + + true_result *= audio_query.volumeScale + + # TODO: resampyの部分は値の検証しようがないので、パスする + if audio_query.outputSamplingRate != 24000: + return + + assert_result_count = 0 + for i in range(len(true_result)): + if audio_query.outputStereo: + assert_result_count += math.isclose( + true_result[i], result[i][0], rel_tol=10e-5 + ) and math.isclose(true_result[i], result[i][1], rel_tol=10e-5) + else: + assert_result_count += math.isclose( + true_result[i], result[i], rel_tol=10e-5 + ) + self.assertTrue(assert_result_count >= int(len(true_result) / 5) * 4) + + def test_synthesis(self): + audio_query = AudioQuery( + accent_phrases=deepcopy(self.accent_phrases_hello_hiho), + speedScale=1.0, + pitchScale=1.0, + intonationScale=1.0, + volumeScale=1.0, + prePhonemeLength=0.1, + postPhonemeLength=0.1, + outputSamplingRate=24000, + outputStereo=False, + # このテスト内では使わないので生成不要 + kana="", + ) + + self.synthesis_test_base(audio_query) + + # speed scaleのテスト + audio_query.speedScale = 1.2 + self.synthesis_test_base(audio_query) + + # pitch scaleのテスト + audio_query.pitchScale = 1.5 + audio_query.speedScale = 1.0 + self.synthesis_test_base(audio_query) + + # intonation scaleのテスト + audio_query.pitchScale = 1.0 + audio_query.intonationScale = 1.4 + self.synthesis_test_base(audio_query) + + # volume scaleのテスト + audio_query.intonationScale = 1.0 + audio_query.volumeScale = 2.0 + self.synthesis_test_base(audio_query) + + # pre/post phoneme lengthのテスト + audio_query.volumeScale = 1.0 + audio_query.prePhonemeLength = 0.5 + audio_query.postPhonemeLength = 0.5 + self.synthesis_test_base(audio_query) + + # output sampling rateのテスト + audio_query.prePhonemeLength = 0.1 + audio_query.postPhonemeLength = 0.1 + audio_query.outputSamplingRate = 48000 + self.synthesis_test_base(audio_query) + + # output stereoのテスト + audio_query.outputSamplingRate = 24000 + audio_query.outputStereo = True + self.synthesis_test_base(audio_query) diff --git a/voicevox_nemo_engine/test/test_synthesis_engine_base.py b/voicevox_nemo_engine/test/test_synthesis_engine_base.py new file mode 100644 index 0000000000000000000000000000000000000000..8202891b7d95c6b62f692b21c527ae908be6cb7c --- /dev/null +++ b/voicevox_nemo_engine/test/test_synthesis_engine_base.py @@ -0,0 +1,411 @@ +from typing import List, Union +from unittest import TestCase +from unittest.mock import Mock + +import numpy + +from voicevox_engine.model import AccentPhrase, AudioQuery, Mora +from voicevox_engine.synthesis_engine import SynthesisEngine + + +def yukarin_s_mock(length: int, phoneme_list: numpy.ndarray, style_id: numpy.ndarray): + result = [] + # mockとしての適当な処理、特に意味はない + for i in range(length): + result.append(round(float(phoneme_list[i] * 0.0625 + style_id), 2)) + return numpy.array(result) + + +def yukarin_sa_mock( + length: int, + vowel_phoneme_list: numpy.ndarray, + consonant_phoneme_list: numpy.ndarray, + start_accent_list: numpy.ndarray, + end_accent_list: numpy.ndarray, + start_accent_phrase_list: numpy.ndarray, + end_accent_phrase_list: numpy.ndarray, + style_id: numpy.ndarray, +): + result = [] + # mockとしての適当な処理、特に意味はない + for i in range(length): + result.append( + round( + float( + ( + vowel_phoneme_list[0][i] + + consonant_phoneme_list[0][i] + + start_accent_list[0][i] + + end_accent_list[0][i] + + start_accent_phrase_list[0][i] + + end_accent_phrase_list[0][i] + ) + * 0.0625 + + style_id + ), + 2, + ) + ) + return numpy.array(result)[numpy.newaxis] + + +def decode_mock( + length: int, + phoneme_size: int, + f0: numpy.ndarray, + phoneme: numpy.ndarray, + style_id: Union[numpy.ndarray, int], +): + result = [] + # mockとしての適当な処理、特に意味はない + for i in range(length): + # decode forwardはデータサイズがlengthの256倍になるのでとりあえず256回データをresultに入れる + for _ in range(256): + result.append( + float( + f0[i][0] * (numpy.where(phoneme[i] == 1)[0] / phoneme_size) + + style_id + ) + ) + return numpy.array(result) + + +def koreha_arimasuka_base_expected(): + return [ + AccentPhrase( + moras=[ + Mora( + text="コ", + consonant="k", + consonant_length=2.44, + vowel="o", + vowel_length=2.88, + pitch=4.38, + ), + Mora( + text="レ", + consonant="r", + consonant_length=3.06, + vowel="e", + vowel_length=1.88, + pitch=4.0, + ), + Mora( + text="ワ", + consonant="w", + consonant_length=3.62, + vowel="a", + vowel_length=1.44, + pitch=4.19, + ), + ], + accent=3, + pause_mora=None, + is_interrogative=False, + ), + AccentPhrase( + moras=[ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=1.44, + pitch=1.44, + ), + Mora( + text="リ", + consonant="r", + consonant_length=3.06, + vowel="i", + vowel_length=2.31, + pitch=4.44, + ), + Mora( + text="マ", + consonant="m", + consonant_length=2.62, + vowel="a", + vowel_length=1.44, + pitch=3.12, + ), + Mora( + text="ス", + consonant="s", + consonant_length=3.19, + vowel="U", + vowel_length=1.38, + pitch=0.0, + ), + Mora( + text="カ", + consonant="k", + consonant_length=2.44, + vowel="a", + vowel_length=1.44, + pitch=2.94, + ), + ], + accent=3, + pause_mora=None, + is_interrogative=False, + ), + ] + + +def create_mock_query(accent_phrases): + return AudioQuery( + accent_phrases=accent_phrases, + speedScale=1, + pitchScale=0, + intonationScale=1, + volumeScale=1, + prePhonemeLength=0.1, + postPhonemeLength=0.1, + outputSamplingRate=24000, + outputStereo=False, + kana="", + ) + + +class MockCore: + yukarin_s_forward = Mock(side_effect=yukarin_s_mock) + yukarin_sa_forward = Mock(side_effect=yukarin_sa_mock) + decode_forward = Mock(side_effect=decode_mock) + + def metas(self): + return "" + + def supported_devices(self): + return "" + + def is_model_loaded(self, style_id): + return True + + +class TestSynthesisEngineBase(TestCase): + def setUp(self): + super().setUp() + self.synthesis_engine = SynthesisEngine( + core=MockCore(), + ) + self.synthesis_engine._synthesis_impl = Mock() + + def create_accent_phrases_test_base(self, text: str, expected: List[AccentPhrase]): + actual = self.synthesis_engine.create_accent_phrases(text, 1) + self.assertEqual( + expected, + actual, + "case(text:" + text + ")", + ) + + def create_synthesis_test_base( + self, + text: str, + expected: List[AccentPhrase], + enable_interrogative_upspeak: bool, + ): + """音声合成時に疑問文モーラ処理を行っているかどうかを検証 + (https://github.com/VOICEVOX/voicevox_engine/issues/272#issuecomment-1022610866) + """ + accent_phrases = self.synthesis_engine.create_accent_phrases(text, 1) + query = create_mock_query(accent_phrases=accent_phrases) + self.synthesis_engine.synthesis( + query, 0, enable_interrogative_upspeak=enable_interrogative_upspeak + ) + # _synthesis_implの第一引数に与えられたqueryを検証 + actual = self.synthesis_engine._synthesis_impl.call_args[0][0].accent_phrases + + self.assertEqual( + expected, + actual, + "case(text:" + text + ")", + ) + + def test_create_accent_phrases(self): + """accent_phrasesの作成時では疑問文モーラ処理を行わない + (https://github.com/VOICEVOX/voicevox_engine/issues/272#issuecomment-1022610866) + """ + expected = koreha_arimasuka_base_expected() + expected[-1].is_interrogative = True + self.create_accent_phrases_test_base(text="これはありますか?", expected=expected) + + def test_synthesis_interrogative(self): + expected = koreha_arimasuka_base_expected() + expected[-1].is_interrogative = True + expected[-1].moras += [ + Mora( + text="ア", + consonant=None, + consonant_length=None, + vowel="a", + vowel_length=0.15, + pitch=expected[-1].moras[-1].pitch + 0.3, + ) + ] + self.create_synthesis_test_base( + text="これはありますか?", + expected=expected, + enable_interrogative_upspeak=True, + ) + + expected = koreha_arimasuka_base_expected() + expected[-1].is_interrogative = True + self.create_synthesis_test_base( + text="これはありますか?", + expected=expected, + enable_interrogative_upspeak=False, + ) + + expected = koreha_arimasuka_base_expected() + self.create_synthesis_test_base( + text="これはありますか", + expected=expected, + enable_interrogative_upspeak=True, + ) + + def nn_base_expected(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ン", + consonant=None, + consonant_length=None, + vowel="N", + vowel_length=1.25, + pitch=1.44, + ) + ], + accent=1, + pause_mora=None, + is_interrogative=False, + ) + ] + + expected = nn_base_expected() + self.create_synthesis_test_base( + text="ん", + expected=expected, + enable_interrogative_upspeak=True, + ) + + expected = nn_base_expected() + expected[-1].is_interrogative = True + expected[-1].moras += [ + Mora( + text="ン", + consonant=None, + consonant_length=None, + vowel="N", + vowel_length=0.15, + pitch=expected[-1].moras[-1].pitch + 0.3, + ) + ] + self.create_synthesis_test_base( + text="ん?", + expected=expected, + enable_interrogative_upspeak=True, + ) + + expected = nn_base_expected() + expected[-1].is_interrogative = True + self.create_synthesis_test_base( + text="ん?", + expected=expected, + enable_interrogative_upspeak=False, + ) + + def ltu_base_expected(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ッ", + consonant=None, + consonant_length=None, + vowel="cl", + vowel_length=1.69, + pitch=0.0, + ) + ], + accent=1, + pause_mora=None, + is_interrogative=False, + ) + ] + + expected = ltu_base_expected() + self.create_synthesis_test_base( + text="っ", + expected=expected, + enable_interrogative_upspeak=True, + ) + + expected = ltu_base_expected() + expected[-1].is_interrogative = True + self.create_synthesis_test_base( + text="っ?", + expected=expected, + enable_interrogative_upspeak=True, + ) + + expected = ltu_base_expected() + expected[-1].is_interrogative = True + self.create_synthesis_test_base( + text="っ?", + expected=expected, + enable_interrogative_upspeak=False, + ) + + def su_base_expected(): + return [ + AccentPhrase( + moras=[ + Mora( + text="ス", + consonant="s", + consonant_length=3.19, + vowel="u", + vowel_length=3.5, + pitch=5.94, + ) + ], + accent=1, + pause_mora=None, + is_interrogative=False, + ) + ] + + expected = su_base_expected() + self.create_synthesis_test_base( + text="す", + expected=expected, + enable_interrogative_upspeak=True, + ) + + expected = su_base_expected() + expected[-1].is_interrogative = True + expected[-1].moras += [ + Mora( + text="ウ", + consonant=None, + consonant_length=None, + vowel="u", + vowel_length=0.15, + pitch=expected[-1].moras[-1].pitch + 0.3, + ) + ] + self.create_synthesis_test_base( + text="す?", + expected=expected, + enable_interrogative_upspeak=True, + ) + + expected = su_base_expected() + expected[-1].is_interrogative = True + self.create_synthesis_test_base( + text="す?", + expected=expected, + enable_interrogative_upspeak=False, + ) diff --git a/voicevox_nemo_engine/test/test_user_dict.py b/voicevox_nemo_engine/test/test_user_dict.py new file mode 100644 index 0000000000000000000000000000000000000000..4280bbe53e9b2d71df7b9c996f56ade7b802d561 --- /dev/null +++ b/voicevox_nemo_engine/test/test_user_dict.py @@ -0,0 +1,348 @@ +import json +from copy import deepcopy +from pathlib import Path +from tempfile import TemporaryDirectory +from typing import Dict +from unittest import TestCase + +from fastapi import HTTPException +from pyopenjtalk import g2p, unset_user_dict + +from voicevox_engine.model import UserDictWord, WordTypes +from voicevox_engine.part_of_speech_data import MAX_PRIORITY, part_of_speech_data +from voicevox_engine.user_dict import ( + apply_word, + create_word, + delete_word, + import_user_dict, + read_dict, + rewrite_word, + update_dict, +) + +# jsonとして保存される正しい形式の辞書データ +valid_dict_dict_json = { + "aab7dda2-0d97-43c8-8cb7-3f440dab9b4e": { + "surface": "test", + "cost": part_of_speech_data[WordTypes.PROPER_NOUN].cost_candidates[5], + "part_of_speech": "名詞", + "part_of_speech_detail_1": "固有名詞", + "part_of_speech_detail_2": "一般", + "part_of_speech_detail_3": "*", + "inflectional_type": "*", + "inflectional_form": "*", + "stem": "*", + "yomi": "テスト", + "pronunciation": "テスト", + "accent_type": 1, + "accent_associative_rule": "*", + }, +} + +# APIでやり取りされる正しい形式の辞書データ +valid_dict_dict_api = deepcopy(valid_dict_dict_json) +del valid_dict_dict_api["aab7dda2-0d97-43c8-8cb7-3f440dab9b4e"]["cost"] +valid_dict_dict_api["aab7dda2-0d97-43c8-8cb7-3f440dab9b4e"]["priority"] = 5 + +import_word = UserDictWord( + surface="test2", + priority=5, + part_of_speech="名詞", + part_of_speech_detail_1="固有名詞", + part_of_speech_detail_2="一般", + part_of_speech_detail_3="*", + inflectional_type="*", + inflectional_form="*", + stem="*", + yomi="テストツー", + pronunciation="テストツー", + accent_type=1, + accent_associative_rule="*", +) + + +def get_new_word(user_dict: Dict[str, UserDictWord]): + assert len(user_dict) == 2 or ( + len(user_dict) == 1 and "aab7dda2-0d97-43c8-8cb7-3f440dab9b4e" not in user_dict + ) + for word_uuid in user_dict.keys(): + if word_uuid == "aab7dda2-0d97-43c8-8cb7-3f440dab9b4e": + continue + return user_dict[word_uuid] + raise AssertionError + + +class TestUserDict(TestCase): + def setUp(self): + self.tmp_dir = TemporaryDirectory() + self.tmp_dir_path = Path(self.tmp_dir.name) + + def tearDown(self): + unset_user_dict() + self.tmp_dir.cleanup() + + def test_read_not_exist_json(self): + self.assertEqual( + read_dict(user_dict_path=(self.tmp_dir_path / "not_exist.json")), + {}, + ) + + def test_create_word(self): + # 将来的に品詞などが追加された時にテストを増やす + self.assertEqual( + create_word(surface="test", pronunciation="テスト", accent_type=1), + UserDictWord( + surface="test", + priority=5, + part_of_speech="名詞", + part_of_speech_detail_1="固有名詞", + part_of_speech_detail_2="一般", + part_of_speech_detail_3="*", + inflectional_type="*", + inflectional_form="*", + stem="*", + yomi="テスト", + pronunciation="テスト", + accent_type=1, + accent_associative_rule="*", + ), + ) + + def test_apply_word_without_json(self): + user_dict_path = self.tmp_dir_path / "test_apply_word_without_json.json" + apply_word( + surface="test", + pronunciation="テスト", + accent_type=1, + user_dict_path=user_dict_path, + compiled_dict_path=(self.tmp_dir_path / "test_apply_word_without_json.dic"), + ) + res = read_dict(user_dict_path=user_dict_path) + self.assertEqual(len(res), 1) + new_word = get_new_word(res) + self.assertEqual( + ( + new_word.surface, + new_word.pronunciation, + new_word.accent_type, + ), + ("test", "テスト", 1), + ) + + def test_apply_word_with_json(self): + user_dict_path = self.tmp_dir_path / "test_apply_word_with_json.json" + user_dict_path.write_text( + json.dumps(valid_dict_dict_json, ensure_ascii=False), encoding="utf-8" + ) + apply_word( + surface="test2", + pronunciation="テストツー", + accent_type=3, + user_dict_path=user_dict_path, + compiled_dict_path=(self.tmp_dir_path / "test_apply_word_with_json.dic"), + ) + res = read_dict(user_dict_path=user_dict_path) + self.assertEqual(len(res), 2) + new_word = get_new_word(res) + self.assertEqual( + ( + new_word.surface, + new_word.pronunciation, + new_word.accent_type, + ), + ("test2", "テストツー", 3), + ) + + def test_rewrite_word_invalid_id(self): + user_dict_path = self.tmp_dir_path / "test_rewrite_word_invalid_id.json" + user_dict_path.write_text( + json.dumps(valid_dict_dict_json, ensure_ascii=False), encoding="utf-8" + ) + self.assertRaises( + HTTPException, + rewrite_word, + word_uuid="c2be4dc5-d07d-4767-8be1-04a1bb3f05a9", + surface="test2", + pronunciation="テストツー", + accent_type=2, + user_dict_path=user_dict_path, + compiled_dict_path=(self.tmp_dir_path / "test_rewrite_word_invalid_id.dic"), + ) + + def test_rewrite_word_valid_id(self): + user_dict_path = self.tmp_dir_path / "test_rewrite_word_valid_id.json" + user_dict_path.write_text( + json.dumps(valid_dict_dict_json, ensure_ascii=False), encoding="utf-8" + ) + rewrite_word( + word_uuid="aab7dda2-0d97-43c8-8cb7-3f440dab9b4e", + surface="test2", + pronunciation="テストツー", + accent_type=2, + user_dict_path=user_dict_path, + compiled_dict_path=(self.tmp_dir_path / "test_rewrite_word_valid_id.dic"), + ) + new_word = read_dict(user_dict_path=user_dict_path)[ + "aab7dda2-0d97-43c8-8cb7-3f440dab9b4e" + ] + self.assertEqual( + (new_word.surface, new_word.pronunciation, new_word.accent_type), + ("test2", "テストツー", 2), + ) + + def test_delete_word_invalid_id(self): + user_dict_path = self.tmp_dir_path / "test_delete_word_invalid_id.json" + user_dict_path.write_text( + json.dumps(valid_dict_dict_json, ensure_ascii=False), encoding="utf-8" + ) + self.assertRaises( + HTTPException, + delete_word, + word_uuid="c2be4dc5-d07d-4767-8be1-04a1bb3f05a9", + user_dict_path=user_dict_path, + compiled_dict_path=(self.tmp_dir_path / "test_delete_word_invalid_id.dic"), + ) + + def test_delete_word_valid_id(self): + user_dict_path = self.tmp_dir_path / "test_delete_word_valid_id.json" + user_dict_path.write_text( + json.dumps(valid_dict_dict_json, ensure_ascii=False), encoding="utf-8" + ) + delete_word( + word_uuid="aab7dda2-0d97-43c8-8cb7-3f440dab9b4e", + user_dict_path=user_dict_path, + compiled_dict_path=(self.tmp_dir_path / "test_delete_word_valid_id.dic"), + ) + self.assertEqual(len(read_dict(user_dict_path=user_dict_path)), 0) + + def test_priority(self): + for pos in part_of_speech_data: + for i in range(MAX_PRIORITY + 1): + self.assertEqual( + create_word( + surface="test", + pronunciation="テスト", + accent_type=1, + word_type=pos, + priority=i, + ).priority, + i, + ) + + def test_import_dict(self): + user_dict_path = self.tmp_dir_path / "test_import_dict.json" + compiled_dict_path = self.tmp_dir_path / "test_import_dict.dic" + user_dict_path.write_text( + json.dumps(valid_dict_dict_json, ensure_ascii=False), encoding="utf-8" + ) + import_user_dict( + {"b1affe2a-d5f0-4050-926c-f28e0c1d9a98": import_word}, + override=False, + user_dict_path=user_dict_path, + compiled_dict_path=compiled_dict_path, + ) + self.assertEqual( + read_dict(user_dict_path)["b1affe2a-d5f0-4050-926c-f28e0c1d9a98"], + import_word, + ) + self.assertEqual( + read_dict(user_dict_path)["aab7dda2-0d97-43c8-8cb7-3f440dab9b4e"], + UserDictWord(**valid_dict_dict_api["aab7dda2-0d97-43c8-8cb7-3f440dab9b4e"]), + ) + + def test_import_dict_no_override(self): + user_dict_path = self.tmp_dir_path / "test_import_dict_no_override.json" + compiled_dict_path = self.tmp_dir_path / "test_import_dict_no_override.dic" + user_dict_path.write_text( + json.dumps(valid_dict_dict_json, ensure_ascii=False), encoding="utf-8" + ) + import_user_dict( + {"aab7dda2-0d97-43c8-8cb7-3f440dab9b4e": import_word}, + override=False, + user_dict_path=user_dict_path, + compiled_dict_path=compiled_dict_path, + ) + self.assertEqual( + read_dict(user_dict_path)["aab7dda2-0d97-43c8-8cb7-3f440dab9b4e"], + UserDictWord(**valid_dict_dict_api["aab7dda2-0d97-43c8-8cb7-3f440dab9b4e"]), + ) + + def test_import_dict_override(self): + user_dict_path = self.tmp_dir_path / "test_import_dict_override.json" + compiled_dict_path = self.tmp_dir_path / "test_import_dict_override.dic" + user_dict_path.write_text( + json.dumps(valid_dict_dict_json, ensure_ascii=False), encoding="utf-8" + ) + import_user_dict( + {"aab7dda2-0d97-43c8-8cb7-3f440dab9b4e": import_word}, + override=True, + user_dict_path=user_dict_path, + compiled_dict_path=compiled_dict_path, + ) + self.assertEqual( + read_dict(user_dict_path)["aab7dda2-0d97-43c8-8cb7-3f440dab9b4e"], + import_word, + ) + + def test_import_invalid_word(self): + user_dict_path = self.tmp_dir_path / "test_import_invalid_dict.json" + compiled_dict_path = self.tmp_dir_path / "test_import_invalid_dict.dic" + invalid_accent_associative_rule_word = deepcopy(import_word) + invalid_accent_associative_rule_word.accent_associative_rule = "invalid" + user_dict_path.write_text( + json.dumps(valid_dict_dict_json, ensure_ascii=False), encoding="utf-8" + ) + self.assertRaises( + AssertionError, + import_user_dict, + { + "aab7dda2-0d97-43c8-8cb7-3f440dab9b4e": invalid_accent_associative_rule_word + }, + override=True, + user_dict_path=user_dict_path, + compiled_dict_path=compiled_dict_path, + ) + invalid_pos_word = deepcopy(import_word) + invalid_pos_word.context_id = 2 + invalid_pos_word.part_of_speech = "フィラー" + invalid_pos_word.part_of_speech_detail_1 = "*" + invalid_pos_word.part_of_speech_detail_2 = "*" + invalid_pos_word.part_of_speech_detail_3 = "*" + self.assertRaises( + ValueError, + import_user_dict, + {"aab7dda2-0d97-43c8-8cb7-3f440dab9b4e": invalid_pos_word}, + override=True, + user_dict_path=user_dict_path, + compiled_dict_path=compiled_dict_path, + ) + + def test_update_dict(self): + user_dict_path = self.tmp_dir_path / "test_update_dict.json" + compiled_dict_path = self.tmp_dir_path / "test_update_dict.dic" + update_dict( + user_dict_path=user_dict_path, compiled_dict_path=compiled_dict_path + ) + test_text = "テスト用の文字列" + success_pronunciation = "デフォルトノジショデハゼッタイニセイセイサレナイヨミ" + + # 既に辞書に登録されていないか確認する + self.assertNotEqual(g2p(text=test_text, kana=True), success_pronunciation) + + apply_word( + surface=test_text, + pronunciation=success_pronunciation, + accent_type=1, + priority=10, + user_dict_path=user_dict_path, + compiled_dict_path=compiled_dict_path, + ) + self.assertEqual(g2p(text=test_text, kana=True), success_pronunciation) + + # 疑似的にエンジンを再起動する + unset_user_dict() + update_dict( + user_dict_path=user_dict_path, compiled_dict_path=compiled_dict_path + ) + + self.assertEqual(g2p(text=test_text, kana=True), success_pronunciation) diff --git a/voicevox_nemo_engine/test/test_user_dict_model.py b/voicevox_nemo_engine/test/test_user_dict_model.py new file mode 100644 index 0000000000000000000000000000000000000000..9a3a49021d0c74ff15507d259ac2437eeaa03557 --- /dev/null +++ b/voicevox_nemo_engine/test/test_user_dict_model.py @@ -0,0 +1,108 @@ +from copy import deepcopy +from unittest import TestCase + +from pydantic import ValidationError + +from voicevox_engine.kana_parser import parse_kana +from voicevox_engine.model import UserDictWord + + +class TestUserDictWords(TestCase): + def setUp(self): + self.test_model = { + "surface": "テスト", + "priority": 0, + "part_of_speech": "名詞", + "part_of_speech_detail_1": "固有名詞", + "part_of_speech_detail_2": "一般", + "part_of_speech_detail_3": "*", + "inflectional_type": "*", + "inflectional_form": "*", + "stem": "*", + "yomi": "テスト", + "pronunciation": "テスト", + "accent_type": 0, + "accent_associative_rule": "*", + } + + def test_valid_word(self): + test_value = deepcopy(self.test_model) + try: + UserDictWord(**test_value) + except ValidationError as e: + self.fail(f"Unexpected Validation Error\n{str(e)}") + + def test_convert_to_zenkaku(self): + test_value = deepcopy(self.test_model) + test_value["surface"] = "test" + self.assertEqual(UserDictWord(**test_value).surface, "test") + + def test_count_mora(self): + test_value = deepcopy(self.test_model) + self.assertEqual(UserDictWord(**test_value).mora_count, 3) + + def test_count_mora_x(self): + test_value = deepcopy(self.test_model) + for s in [chr(i) for i in range(12449, 12533)]: + if s in ["ァ", "ィ", "ゥ", "ェ", "ォ", "ッ", "ャ", "ュ", "ョ", "ヮ"]: + continue + for x in "ァィゥェォャュョ": + expected_count = 0 + test_value["pronunciation"] = s + x + for accent_phrase in parse_kana( + test_value["pronunciation"] + "'", + ): + expected_count += len(accent_phrase.moras) + with self.subTest(s=s, x=x): + self.assertEqual( + UserDictWord(**test_value).mora_count, + expected_count, + ) + + def test_count_mora_xwa(self): + test_value = deepcopy(self.test_model) + test_value["pronunciation"] = "クヮンセイ" + expected_count = 0 + for accent_phrase in parse_kana( + test_value["pronunciation"] + "'", + ): + expected_count += len(accent_phrase.moras) + self.assertEqual( + UserDictWord(**test_value).mora_count, + expected_count, + ) + + def test_invalid_pronunciation_not_katakana(self): + test_value = deepcopy(self.test_model) + test_value["pronunciation"] = "ぼいぼ" + with self.assertRaises(ValidationError): + UserDictWord(**test_value) + + def test_invalid_pronunciation_invalid_sutegana(self): + test_value = deepcopy(self.test_model) + test_value["pronunciation"] = "アィウェォ" + with self.assertRaises(ValidationError): + UserDictWord(**test_value) + + def test_invalid_pronunciation_invalid_xwa(self): + test_value = deepcopy(self.test_model) + test_value["pronunciation"] = "アヮ" + with self.assertRaises(ValidationError): + UserDictWord(**test_value) + + def test_count_mora_voiced_sound(self): + test_value = deepcopy(self.test_model) + test_value["pronunciation"] = "ボイボ" + self.assertEqual(UserDictWord(**test_value).mora_count, 3) + + def test_invalid_accent_type(self): + test_value = deepcopy(self.test_model) + test_value["accent_type"] = 4 + with self.assertRaises(ValidationError): + UserDictWord(**test_value) + + def test_invalid_accent_type_2(self): + test_value = deepcopy(self.test_model) + test_value["accent_type"] = -1 + with self.assertRaises(ValidationError): + UserDictWord(**test_value) diff --git a/voicevox_nemo_engine/test/test_word_types.py b/voicevox_nemo_engine/test/test_word_types.py new file mode 100644 index 0000000000000000000000000000000000000000..1f2635b680e9b82d23ae3825f2a746b171d6ed3a --- /dev/null +++ b/voicevox_nemo_engine/test/test_word_types.py @@ -0,0 +1,9 @@ +from unittest import TestCase + +from voicevox_engine.model import WordTypes +from voicevox_engine.part_of_speech_data import part_of_speech_data + + +class TestWordTypes(TestCase): + def test_word_types(self): + self.assertCountEqual(list(WordTypes), list(part_of_speech_data.keys())) diff --git a/voicevox_nemo_engine/test/vvlib_manifest.json b/voicevox_nemo_engine/test/vvlib_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..f12d59eebed45f672a9c4ee61acc81a725552468 --- /dev/null +++ b/voicevox_nemo_engine/test/vvlib_manifest.json @@ -0,0 +1,9 @@ +{ + "manifest_version": "0.15.0", + "name": "Test vvlib", + "version": "0.0.1", + "uuid": "2bb8bccf-1c3f-4bc9-959a-f388e37af3ad", + "engine_name": "Test Engine", + "brand_name": "Test", + "engine_uuid": "c7b58856-bd56-4aa1-afb7-b8415f824b06" +} \ No newline at end of file diff --git a/voicevox_nemo_engine/ui_template/ui.html b/voicevox_nemo_engine/ui_template/ui.html new file mode 100644 index 0000000000000000000000000000000000000000..a37b9e1040cf1952564f4507ee55ade0384c90a7 --- /dev/null +++ b/voicevox_nemo_engine/ui_template/ui.html @@ -0,0 +1,120 @@ + + + + + VOICEVOX Engine 設定 + + + + + + + + + + + 設定の変更の更新にはエンジンの再起動が必要です。 + + + + CORS Policy Mode + + + 現在値: {{ cors_policy_mode }} + + localapps + all + + + + allまたはlocalappsを指定。allはすべてを許可します。 + + + localappsはオリジン間リソース共有ポリシーを、app://.とlocalhost関連に限定します。 + + + その他のオリジンはallow_originオプションで追加できます。デフォルトはlocalapps。 + + + + + + Allow Origin + + + 許可するオリジンを指定します。複数指定する場合は、直後にスペースで区切って追加できます。 + + + + + + + + + 設定の保存 + + + + + 設定を保存します。よろしいですか? + + + + + + + + 保存 + + + + + diff --git a/voicevox_nemo_engine/voicevox_engine/__init__.py b/voicevox_nemo_engine/voicevox_engine/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ca702104050d218302f1b0850d0b679eb8c1c617 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/__init__.py @@ -0,0 +1 @@ +__version__ = "latest" diff --git a/voicevox_nemo_engine/voicevox_engine/acoustic_feature_extractor.py b/voicevox_nemo_engine/voicevox_engine/acoustic_feature_extractor.py new file mode 100644 index 0000000000000000000000000000000000000000..8fa37fbae8badda63d9fe7173cf407eb25343144 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/acoustic_feature_extractor.py @@ -0,0 +1,332 @@ +from abc import abstractmethod +from enum import Enum +from pathlib import Path +from typing import List, Sequence + +import numpy + + +class BasePhoneme(object): + """ + 音素の応用クラス群の抽象基底クラス + + Attributes + ---------- + phoneme_list : Sequence[str] + 音素のリスト + num_phoneme : int + 音素リストの要素数 + space_phoneme : str + 読点に値する音素 + """ + + phoneme_list: Sequence[str] + num_phoneme: int + space_phoneme: str + + def __init__( + self, + phoneme: str, + start: float, + end: float, + ): + self.phoneme = phoneme + self.start = numpy.round(start, decimals=2) + self.end = numpy.round(end, decimals=2) + + def __repr__(self): + return f"Phoneme(phoneme='{self.phoneme}', start={self.start}, end={self.end})" + + def __eq__(self, o: object): + return isinstance(o, BasePhoneme) and ( + self.phoneme == o.phoneme and self.start == o.start and self.end == o.end + ) + + def verify(self): + """ + 音素クラスとして、データが正しいかassertする + """ + assert self.phoneme in self.phoneme_list, f"{self.phoneme} is not defined." + + @property + def phoneme_id(self): + """ + phoneme_id (phoneme list内でのindex)を取得する + Returns + ------- + id : int + phoneme_idを返す + """ + return self.phoneme_list.index(self.phoneme) + + @property + def duration(self): + """ + 音素継続期間を取得する + Returns + ------- + duration : int + 音素継続期間を返す + """ + return self.end - self.start + + @property + def onehot(self): + """ + phoneme listの長さ分の0埋め配列のうち、phoneme id番目がTrue(1)の配列を返す + Returns + ------- + onehot : numpu.ndarray + 関数内で変更された配列を返す + """ + array = numpy.zeros(self.num_phoneme, dtype=bool) + array[self.phoneme_id] = True + return array + + @classmethod + def parse(cls, s: str): + """ + 文字列をパースして音素クラスを作る + Parameters + ---------- + s : str + パースしたい文字列 + + Returns + ------- + phoneme : BasePhoneme + パース結果を用いた音素クラスを返す + + Examples + -------- + >>> BasePhoneme.parse('1.7425000 1.9125000 o:') + Phoneme(phoneme='o:', start=1.74, end=1.91) + """ + words = s.split() + return cls( + start=float(words[0]), + end=float(words[1]), + phoneme=words[2], + ) + + @classmethod + @abstractmethod + def convert(cls, phonemes: List["BasePhoneme"]) -> List["BasePhoneme"]: + raise NotImplementedError + + @classmethod + def load_lab_list(cls, path: Path): + """ + labファイルを読み込む + Parameters + ---------- + path : Path + 読み込みたいlabファイルのパス + + Returns + ------- + phonemes : List[BasePhoneme] + パース結果を用いた音素クラスを返す + """ + phonemes = [cls.parse(s) for s in path.read_text().split("\n") if len(s) > 0] + phonemes = cls.convert(phonemes) + + for phoneme in phonemes: + phoneme.verify() + return phonemes + + @classmethod + def save_lab_list(cls, phonemes: List["BasePhoneme"], path: Path): + """ + 音素クラスのリストをlabファイル形式で保存する + Parameters + ---------- + phonemes : List[BasePhoneme] + 保存したい音素クラスのリスト + path : Path + labファイルの保存先パス + """ + text = "\n".join( + [ + f"{numpy.round(p.start, decimals=2):.2f}\t" + f"{numpy.round(p.end, decimals=2):.2f}\t" + f"{p.phoneme}" + for p in phonemes + ] + ) + path.write_text(text) + + +class JvsPhoneme(BasePhoneme): + """ + JVS(Japanese versatile speech)コーパスに含まれる音素群クラス + + Attributes + ---------- + phoneme_list : Sequence[str] + 音素のリスト + num_phoneme : int + 音素リストの要素数 + space_phoneme : str + 読点に値する音素 + """ + + phoneme_list = ( + "pau", + "I", + "N", + "U", + "a", + "b", + "by", + "ch", + "cl", + "d", + "dy", + "e", + "f", + "g", + "gy", + "h", + "hy", + "i", + "j", + "k", + "ky", + "m", + "my", + "n", + "ny", + "o", + "p", + "py", + "r", + "ry", + "s", + "sh", + "t", + "ts", + "u", + "v", + "w", + "y", + "z", + ) + num_phoneme = len(phoneme_list) + space_phoneme = "pau" + + @classmethod + def convert(cls, phonemes: List["JvsPhoneme"]) -> List["JvsPhoneme"]: + """ + 最初と最後のsil(silent)をspace_phoneme(pau)に置き換え(変換)する + Parameters + ---------- + phonemes : List[JvsPhoneme] + 変換したいphonemeのリスト + + Returns + ------- + phonemes : List[JvsPhoneme] + 変換されたphonemeのリスト + """ + if "sil" in phonemes[0].phoneme: + phonemes[0].phoneme = cls.space_phoneme + if "sil" in phonemes[-1].phoneme: + phonemes[-1].phoneme = cls.space_phoneme + return phonemes + + +class OjtPhoneme(BasePhoneme): + """ + OpenJTalkに含まれる音素群クラス + + Attributes + ---------- + phoneme_list : Sequence[str] + 音素のリスト + num_phoneme : int + 音素リストの要素数 + space_phoneme : str + 読点に値する音素 + """ + + phoneme_list = ( + "pau", + "A", + "E", + "I", + "N", + "O", + "U", + "a", + "b", + "by", + "ch", + "cl", + "d", + "dy", + "e", + "f", + "g", + "gw", + "gy", + "h", + "hy", + "i", + "j", + "k", + "kw", + "ky", + "m", + "my", + "n", + "ny", + "o", + "p", + "py", + "r", + "ry", + "s", + "sh", + "t", + "ts", + "ty", + "u", + "v", + "w", + "y", + "z", + ) + num_phoneme = len(phoneme_list) + space_phoneme = "pau" + + @classmethod + def convert(cls, phonemes: List["OjtPhoneme"]): + """ + 最初と最後のsil(silent)をspace_phoneme(pau)に置き換え(変換)する + Parameters + ---------- + phonemes : List[OjtPhoneme] + 変換したいphonemeのリスト + + Returns + ------- + phonemes : List[OjtPhoneme] + 変換されたphonemeのリスト + """ + if "sil" in phonemes[0].phoneme: + phonemes[0].phoneme = cls.space_phoneme + if "sil" in phonemes[-1].phoneme: + phonemes[-1].phoneme = cls.space_phoneme + return phonemes + + +class PhonemeType(str, Enum): + jvs = "jvs" + openjtalk = "openjtalk" + + +phoneme_type_to_class = { + PhonemeType.jvs: JvsPhoneme, + PhonemeType.openjtalk: OjtPhoneme, +} diff --git a/voicevox_nemo_engine/voicevox_engine/cancellable_engine.py b/voicevox_nemo_engine/voicevox_engine/cancellable_engine.py new file mode 100644 index 0000000000000000000000000000000000000000..c473c3e4aa0886bdf518c67d5552daf0017b1911 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/cancellable_engine.py @@ -0,0 +1,251 @@ +import asyncio +import queue +import sys +from multiprocessing import Pipe, Process + +if sys.platform == "win32": + from multiprocessing.connection import PipeConnection as ConnectionType +else: + from multiprocessing.connection import Connection as ConnectionType + +from pathlib import Path +from tempfile import NamedTemporaryFile + +import soundfile + +# FIXME: remove FastAPI dependency +from fastapi import HTTPException, Request + +from .model import AudioQuery +from .synthesis_engine import make_synthesis_engines +from .utility import get_latest_core_version + + +class CancellableEngine: + """ + 音声合成のキャンセル機能に関するクラス + 初期化後は、synthesis関数で音声合成できる + (オリジナルと比べ引数が増えているので注意) + + パラメータ use_gpu, voicelib_dirs, voicevox_dir, + runtime_dirs, cpu_num_threads, enable_mock は、 make_synthesis_engines を参照 + + Attributes + ---------- + watch_con_list: list[tuple[Request, Process]] + Requestは接続の監視に使用され、Processは通信切断時のプロセスキルに使用される + クライアントから接続があるとListにTupleが追加される + 接続が切断、もしくは音声合成が終了すると削除される + procs_and_cons: queue.Queue[tuple[Process, ConnectionType]] + 音声合成の準備が終わっているプロセスのList + (音声合成中のプロセスは入っていない) + """ + + def __init__( + self, + init_processes: int, + use_gpu: bool, + voicelib_dirs: list[Path] | None, + voicevox_dir: Path | None, + runtime_dirs: list[Path] | None, + cpu_num_threads: int | None, + enable_mock: bool, + ) -> None: + """ + 変数の初期化を行う + また、init_processesの数だけプロセスを起動し、procs_and_consに格納する + """ + + self.use_gpu = use_gpu + self.voicelib_dirs = voicelib_dirs + self.voicevox_dir = voicevox_dir + self.runtime_dirs = runtime_dirs + self.cpu_num_threads = cpu_num_threads + self.enable_mock = enable_mock + + self.watch_con_list: list[tuple[Request, Process]] = [] + + procs_and_cons: queue.Queue[tuple[Process, ConnectionType]] = queue.Queue() + for _ in range(init_processes): + procs_and_cons.put(self.start_new_proc()) + self.procs_and_cons = procs_and_cons + + def start_new_proc( + self, + ) -> tuple[Process, ConnectionType]: + """ + 新しく開始したプロセスを返す関数 + + Returns + ------- + ret_proc: Process + 新規のプロセス + sub_proc_con1: ConnectionType + ret_procのプロセスと通信するためのPipe + """ + sub_proc_con1, sub_proc_con2 = Pipe(True) + ret_proc = Process( + target=start_synthesis_subprocess, + kwargs={ + "use_gpu": self.use_gpu, + "voicelib_dirs": self.voicelib_dirs, + "voicevox_dir": self.voicevox_dir, + "runtime_dirs": self.runtime_dirs, + "cpu_num_threads": self.cpu_num_threads, + "enable_mock": self.enable_mock, + "sub_proc_con": sub_proc_con2, + }, + daemon=True, + ) + ret_proc.start() + return ret_proc, sub_proc_con1 + + def finalize_con( + self, + req: Request, + proc: Process, + sub_proc_con: ConnectionType | None, + ) -> None: + """ + 接続が切断された時の処理を行う関数 + watch_con_listからの削除、プロセスの後処理を行う + プロセスが生きている場合はそのままprocs_and_consに加える + 死んでいる場合は新しく生成したものをprocs_and_consに加える + + Parameters + ---------- + req: fastapi.Request + 接続確立時に受け取ったものをそのまま渡せばよい + https://fastapi.tiangolo.com/advanced/using-request-directly/ + proc: Process + 音声合成を行っていたプロセス + sub_proc_con: ConnectionType, optional + 音声合成を行っていたプロセスとのPipe + 指定されていない場合、プロセスは再利用されず終了される + """ + try: + self.watch_con_list.remove((req, proc)) + except ValueError: + pass + try: + if not proc.is_alive() or sub_proc_con is None: + proc.close() + raise ValueError + # プロセスが死んでいない場合は再利用する + self.procs_and_cons.put((proc, sub_proc_con)) + except ValueError: + # プロセスが死んでいるので新しく作り直す + self.procs_and_cons.put(self.start_new_proc()) + + def _synthesis_impl( + self, + query: AudioQuery, + style_id: int, + request: Request, + core_version: str | None, + ) -> str: + """ + 音声合成を行う関数 + 通常エンジンの引数に比べ、requestが必要になっている + また、返り値がファイル名になっている + + Parameters + ---------- + query: AudioQuery + style_id: int + request: fastapi.Request + 接続確立時に受け取ったものをそのまま渡せばよい + https://fastapi.tiangolo.com/advanced/using-request-directly/ + core_version: str + + Returns + ------- + f_name: str + 生成された音声ファイルの名前 + """ + proc, sub_proc_con1 = self.procs_and_cons.get() + self.watch_con_list.append((request, proc)) + try: + sub_proc_con1.send((query, style_id, core_version)) + f_name = sub_proc_con1.recv() + except EOFError: + raise HTTPException(status_code=422, detail="既にサブプロセスは終了されています") + except Exception: + self.finalize_con(request, proc, sub_proc_con1) + raise + + self.finalize_con(request, proc, sub_proc_con1) + return f_name + + async def catch_disconnection(self): + """ + 接続監視を行うコルーチン + """ + while True: + await asyncio.sleep(1) + for con in self.watch_con_list: + req, proc = con + if await req.is_disconnected(): + try: + if proc.is_alive(): + proc.terminate() + proc.join() + proc.close() + except ValueError: + pass + finally: + self.finalize_con(req, proc, None) + + +def start_synthesis_subprocess( + use_gpu: bool, + voicelib_dirs: list[Path] | None, + voicevox_dir: Path | None, + runtime_dirs: list[Path] | None, + cpu_num_threads: int | None, + enable_mock: bool, + sub_proc_con: ConnectionType, +) -> None: + """ + 音声合成を行うサブプロセスで行うための関数 + pickle化の関係でグローバルに書いている + + 引数 use_gpu, voicelib_dirs, voicevox_dir, + runtime_dirs, cpu_num_threads, enable_mock は、 make_synthesis_engines を参照 + + Parameters + ---------- + sub_proc_con: ConnectionType + メインプロセスと通信するためのPipe + """ + + synthesis_engines = make_synthesis_engines( + use_gpu=use_gpu, + voicelib_dirs=voicelib_dirs, + voicevox_dir=voicevox_dir, + runtime_dirs=runtime_dirs, + cpu_num_threads=cpu_num_threads, + enable_mock=enable_mock, + ) + assert len(synthesis_engines) != 0, "音声合成エンジンがありません。" + latest_core_version = get_latest_core_version(versions=synthesis_engines.keys()) + while True: + try: + query, style_id, core_version = sub_proc_con.recv() + if core_version is None: + _engine = synthesis_engines[latest_core_version] + elif core_version in synthesis_engines: + _engine = synthesis_engines[core_version] + else: + # バージョンが見つからないエラー + sub_proc_con.send("") + continue + wave = _engine._synthesis_impl(query, style_id) + with NamedTemporaryFile(delete=False) as f: + soundfile.write( + file=f, data=wave, samplerate=query.outputSamplingRate, format="WAV" + ) + sub_proc_con.send(f.name) + except Exception: + sub_proc_con.close() + raise diff --git a/voicevox_nemo_engine/voicevox_engine/dev/core/__init__.py b/voicevox_nemo_engine/voicevox_engine/dev/core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..432b00b93b362ec24d63e2daf65c70dbee8f3b08 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/dev/core/__init__.py @@ -0,0 +1,17 @@ +from .mock import ( + decode_forward, + initialize, + metas, + supported_devices, + yukarin_s_forward, + yukarin_sa_forward, +) + +__all__ = [ + "decode_forward", + "initialize", + "yukarin_s_forward", + "yukarin_sa_forward", + "metas", + "supported_devices", +] diff --git a/voicevox_nemo_engine/voicevox_engine/dev/core/mock.py b/voicevox_nemo_engine/voicevox_engine/dev/core/mock.py new file mode 100644 index 0000000000000000000000000000000000000000..2bc2102f03aff3d19db8a1ae7af6beb90e7433ac --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/dev/core/mock.py @@ -0,0 +1,118 @@ +import json +from logging import getLogger +from typing import Any, Dict, List + +import numpy as np +from pyopenjtalk import tts +from soxr import resample + +DUMMY_TEXT = "これはダミーのテキストです" + + +def initialize(path: str, use_gpu: bool, *args: List[Any]) -> None: + pass + + +def yukarin_s_forward(length: int, **kwargs: Dict[str, Any]) -> np.ndarray: + logger = getLogger("uvicorn") # FastAPI / Uvicorn 内からの利用のため + logger.info( + "Sorry, yukarin_s_forward() is a mock. Return values are incorrect.", + ) + return np.ones(length) / 5 + + +def yukarin_sa_forward(length: int, **kwargs: Dict[str, Any]) -> np.ndarray: + logger = getLogger("uvicorn") # FastAPI / Uvicorn 内からの利用のため + logger.info( + "Sorry, yukarin_sa_forward() is a mock. Return values are incorrect.", + ) + return np.ones((1, length)) * 5 + + +def decode_forward(length: int, **kwargs: Dict[str, Any]) -> np.ndarray: + """ + 合成音声の波形データをNumPy配列で返します。ただし、常に固定の文言を読み上げます(DUMMY_TEXT) + 参照→SynthesisEngine のdocstring [Mock] + + Parameters + ---------- + length : int + フレームの長さ + + Returns + ------- + wave : np.ndarray + 音声合成した波形データ + + Note + ------- + ここで行う音声合成では、調声(ピッチ等)を反映しない + また、入力内容によらず常に固定の文言を読み上げる + + # pyopenjtalk.tts()の出力仕様 + dtype=np.float64, 16 bit, mono 48000 Hz + + # resampleの説明 + 非モックdecode_forwardと合わせるために、出力を24kHzに変換した。 + """ + logger = getLogger("uvicorn") # FastAPI / Uvicorn 内からの利用のため + logger.info( + "Sorry, decode_forward() is a mock. Return values are incorrect.", + ) + wave, sr = tts(DUMMY_TEXT) + wave = resample(wave.astype("int16"), 48000, 24000) + return wave + + +def metas() -> str: + return json.dumps( + [ + { + "name": "dummy1", + "styles": [ + {"name": "style0", "id": 0}, + {"name": "style1", "id": 2}, + {"name": "style2", "id": 4}, + {"name": "style3", "id": 6}, + ], + "speaker_uuid": "7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff", + "version": "mock", + }, + { + "name": "dummy2", + "styles": [ + {"name": "style0", "id": 1}, + {"name": "style1", "id": 3}, + {"name": "style2", "id": 5}, + {"name": "style3", "id": 7}, + ], + "speaker_uuid": "388f246b-8c41-4ac1-8e2d-5d79f3ff56d9", + "version": "mock", + }, + { + "name": "dummy3", + "styles": [ + {"name": "style0", "id": 8}, + ], + "speaker_uuid": "35b2c544-660e-401e-b503-0e14c635303a", + "version": "mock", + }, + { + "name": "dummy4", + "styles": [ + {"name": "style0", "id": 9}, + ], + "speaker_uuid": "b1a81618-b27b-40d2-b0ea-27a9ad408c4b", + "version": "mock", + }, + ] + ) + + +def supported_devices() -> str: + return json.dumps( + { + "cpu": True, + "cuda": False, + } + ) diff --git a/voicevox_nemo_engine/voicevox_engine/dev/synthesis_engine/__init__.py b/voicevox_nemo_engine/voicevox_engine/dev/synthesis_engine/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e7b2ac5b17594c2a9a137e23a72210209f2cbd4b --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/dev/synthesis_engine/__init__.py @@ -0,0 +1,3 @@ +from .mock import MockSynthesisEngine + +__all__ = ["MockSynthesisEngine"] diff --git a/voicevox_nemo_engine/voicevox_engine/dev/synthesis_engine/mock.py b/voicevox_nemo_engine/voicevox_engine/dev/synthesis_engine/mock.py new file mode 100644 index 0000000000000000000000000000000000000000..9f49f5953e5ad95e1f28ce720a8c51bddd8bc3cc --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/dev/synthesis_engine/mock.py @@ -0,0 +1,136 @@ +from logging import getLogger +from typing import Any, Dict, List, Optional + +import numpy as np +from pyopenjtalk import tts +from soxr import resample + +from ...model import AccentPhrase, AudioQuery +from ...synthesis_engine import SynthesisEngineBase +from ...synthesis_engine.synthesis_engine import to_flatten_moras + + +class MockSynthesisEngine(SynthesisEngineBase): + """ + SynthesisEngine [Mock] + """ + + def __init__( + self, + speakers: str, + supported_devices: Optional[str] = None, + ): + """ + __init__ [Mock] + """ + super().__init__() + + self._speakers = speakers + self._supported_devices = supported_devices + self.default_sampling_rate = 24000 + + @property + def speakers(self) -> str: + return self._speakers + + @property + def supported_devices(self) -> Optional[str]: + return self._supported_devices + + def replace_phoneme_length( + self, accent_phrases: List[AccentPhrase], style_id: int + ) -> List[AccentPhrase]: + """ + replace_phoneme_length 入力accent_phrasesを変更せずにそのまま返します [Mock] + + Parameters + ---------- + accent_phrases : List[AccentPhrase] + フレーズ句のリスト + style_id : int + スタイルID + + Returns + ------- + List[AccentPhrase] + フレーズ句のリスト(変更なし) + """ + return accent_phrases + + def replace_mora_pitch( + self, accent_phrases: List[AccentPhrase], style_id: int + ) -> List[AccentPhrase]: + """ + replace_mora_pitch 入力accent_phrasesを変更せずにそのまま返します [Mock] + + Parameters + ---------- + accent_phrases : List[AccentPhrase] + フレーズ句のリスト + style_id : int + スタイルID + + Returns + ------- + List[AccentPhrase] + フレーズ句のリスト(変更なし) + """ + return accent_phrases + + def _synthesis_impl(self, query: AudioQuery, style_id: int) -> np.ndarray: + """ + synthesis voicevox coreを使わずに、音声合成する [Mock] + + Parameters + ---------- + query : AudioQuery + /audio_query APIで得たjson + style_id : int + スタイルID + + Returns + ------- + wave [npt.NDArray[np.int16]] + 音声波形データをNumPy配列で返します + """ + # recall text in katakana + flatten_moras = to_flatten_moras(query.accent_phrases) + kana_text = "".join([mora.text for mora in flatten_moras]) + + wave = self.forward(kana_text) + + # volume + wave *= query.volumeScale + + return wave.astype("int16") + + def forward(self, text: str, **kwargs: Dict[str, Any]) -> np.ndarray: + """ + forward tts via pyopenjtalk.tts() + 参照→SynthesisEngine のdocstring [Mock] + + Parameters + ---------- + text : str + 入力文字列(例:読み上げたい文章をカタカナにした文字列、等) + + Returns + ------- + wave [npt.NDArray[np.int16]] + 音声波形データをNumPy配列で返します + + Note + ------- + ここで行う音声合成では、調声(ピッチ等)を反映しない + + # pyopenjtalk.tts()の出力仕様 + dtype=np.float64, 16 bit, mono 48000 Hz + + # resampleの説明 + 非モック実装(decode_forward)と合わせるために、出力を24kHzに変換した。 + """ + logger = getLogger("uvicorn") # FastAPI / Uvicorn 内からの利用のため + logger.info("[Mock] input text: %s" % text) + wave, sr = tts(text) + wave = resample(wave, 48000, 24000) + return wave diff --git a/voicevox_nemo_engine/voicevox_engine/downloadable_library.py b/voicevox_nemo_engine/voicevox_engine/downloadable_library.py new file mode 100644 index 0000000000000000000000000000000000000000..1e0932da24f28164bbe40d3ce794c1ab4caa970d --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/downloadable_library.py @@ -0,0 +1,187 @@ +import base64 +import json +import os +import shutil +import zipfile +from io import BytesIO +from pathlib import Path +from typing import Dict + +from fastapi import HTTPException +from pydantic import ValidationError +from semver.version import Version + +from voicevox_engine.model import DownloadableLibrary, InstalledLibrary, VvlibManifest + +__all__ = ["LibraryManager"] + +INFO_FILE = "metas.json" + + +class LibraryManager: + def __init__( + self, + library_root_dir: Path, + supported_vvlib_version: str | None, + brand_name: str, + engine_name: str, + engine_uuid: str, + ): + self.library_root_dir = library_root_dir + self.library_root_dir.mkdir(exist_ok=True) + if supported_vvlib_version is not None: + self.supported_vvlib_version = Version.parse(supported_vvlib_version) + else: + # supported_vvlib_versionがNoneの時は0.0.0として扱う + self.supported_vvlib_version = Version.parse("0.0.0") + self.engine_brand_name = brand_name + self.engine_name = engine_name + self.engine_uuid = engine_uuid + + def downloadable_libraries(self): + # == ダウンロード情報をネットワーク上から取得する場合 + # url = "https://example.com/downloadable_libraries.json" + # response = requests.get(url) + # return list(map(DownloadableLibrary.parse_obj, response.json())) + + # == ダウンロード情報をjsonファイルから取得する場合 + # with open( + # self.root_dir / "engine_manifest_assets" / "downloadable_libraries.json", + # encoding="utf-8", + # ) as f: + # return list(map(DownloadableLibrary.parse_obj, json.load(f))) + + # ダミーとして、speaker_infoのアセットを読み込む + with open( + "./engine_manifest_assets/downloadable_libraries.json", + encoding="utf-8", + ) as f: + libraries = json.load(f) + speaker_info = libraries[0]["speakers"][0]["speaker_info"] + mock_root_dir = Path("./speaker_info/7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff") + speaker_info["policy"] = (mock_root_dir / "policy.md").read_text() + speaker_info["portrait"] = base64.b64encode( + (mock_root_dir / "portrait.png").read_bytes() + ) + for style_info in speaker_info["style_infos"]: + style_id = style_info["id"] + style_info["icon"] = base64.b64encode( + (mock_root_dir / "icons" / f"{style_id}.png").read_bytes() + ) + style_info["voice_samples"] = [ + base64.b64encode( + ( + mock_root_dir / "voice_samples" / f"{style_id}_{i:0>3}.wav" + ).read_bytes() + ) + for i in range(1, 4) + ] + return list(map(DownloadableLibrary.parse_obj, libraries)) + + def installed_libraries(self) -> Dict[str, InstalledLibrary]: + library = {} + for library_dir in self.library_root_dir.iterdir(): + if library_dir.is_dir(): + library_uuid = os.path.basename(library_dir) + with open(library_dir / INFO_FILE, encoding="utf-8") as f: + library[library_uuid] = json.load(f) + # アンインストール出来ないライブラリを作る場合、何かしらの条件でFalseを設定する + library[library_uuid]["uninstallable"] = True + return library + + def install_library(self, library_id: str, file: BytesIO): + for downloadable_library in self.downloadable_libraries(): + if downloadable_library.uuid == library_id: + library_info = downloadable_library.dict() + break + else: + raise HTTPException( + status_code=404, detail=f"指定された音声ライブラリ {library_id} が見つかりません。" + ) + library_dir = self.library_root_dir / library_id + library_dir.mkdir(exist_ok=True) + with open(library_dir / INFO_FILE, "w", encoding="utf-8") as f: + json.dump(library_info, f, indent=4, ensure_ascii=False) + if not zipfile.is_zipfile(file): + raise HTTPException( + status_code=422, detail=f"音声ライブラリ {library_id} は不正なファイルです。" + ) + + with zipfile.ZipFile(file) as zf: + if zf.testzip() is not None: + raise HTTPException( + status_code=422, detail=f"音声ライブラリ {library_id} は不正なファイルです。" + ) + + # validate manifest version + vvlib_manifest = None + try: + vvlib_manifest = json.loads( + zf.read("vvlib_manifest.json").decode("utf-8") + ) + except KeyError: + raise HTTPException( + status_code=422, + detail=f"指定された音声ライブラリ {library_id} にvvlib_manifest.jsonが存在しません。", + ) + except Exception: + raise HTTPException( + status_code=422, + detail=f"指定された音声ライブラリ {library_id} のvvlib_manifest.jsonは不正です。", + ) + + try: + VvlibManifest.validate(vvlib_manifest) + except ValidationError: + raise HTTPException( + status_code=422, + detail=f"指定された音声ライブラリ {library_id} のvvlib_manifest.jsonに不正なデータが含まれています。", + ) + + if not Version.is_valid(vvlib_manifest["version"]): + raise HTTPException( + status_code=422, detail=f"指定された音声ライブラリ {library_id} のversionが不正です。" + ) + + try: + vvlib_manifest_version = Version.parse( + vvlib_manifest["manifest_version"] + ) + except ValueError: + raise HTTPException( + status_code=422, + detail=f"指定された音声ライブラリ {library_id} のmanifest_versionが不正です。", + ) + + if vvlib_manifest_version > self.supported_vvlib_version: + raise HTTPException( + status_code=422, detail=f"指定された音声ライブラリ {library_id} は未対応です。" + ) + + if vvlib_manifest["engine_uuid"] != self.engine_uuid: + raise HTTPException( + status_code=422, + detail=f"指定された音声ライブラリ {library_id} は{self.engine_name}向けではありません。", + ) + + zf.extractall(library_dir) + return library_dir + + def uninstall_library(self, library_id: str): + installed_libraries = self.installed_libraries() + if library_id not in installed_libraries.keys(): + raise HTTPException( + status_code=404, detail=f"指定された音声ライブラリ {library_id} はインストールされていません。" + ) + + if not installed_libraries[library_id]["uninstallable"]: + raise HTTPException( + status_code=403, detail=f"指定された音声ライブラリ {library_id} はアンインストールできません。" + ) + + try: + shutil.rmtree(self.library_root_dir / library_id) + except Exception: + raise HTTPException( + status_code=500, detail=f"指定された音声ライブラリ {library_id} の削除に失敗しました。" + ) diff --git a/voicevox_nemo_engine/voicevox_engine/engine_manifest/EngineManifest.py b/voicevox_nemo_engine/voicevox_engine/engine_manifest/EngineManifest.py new file mode 100644 index 0000000000000000000000000000000000000000..4a8f057216878af5a0ca9ba2053b247ac83b6408 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/engine_manifest/EngineManifest.py @@ -0,0 +1,66 @@ +# マルチエンジン環境下においては、エンジンのバージョンがエディタのバージョンより +# 古くなる可能性が十分に考えられる。その場合、エディタ側がEngineManifestの情報不足によって +# エラーを吐いて表示が崩壊する可能性がある。これを防止するため、EngineManifest関連の定義を +# 変更する際は、Optionalにする必要があることに留意しなければならない。 + +from typing import List, Optional + +from pydantic import BaseModel, Field + + +class UpdateInfo(BaseModel): + """ + エンジンのアップデート情報 + """ + + version: str = Field(title="エンジンのバージョン名") + descriptions: List[str] = Field(title="アップデートの詳細についての説明") + contributors: Optional[List[str]] = Field(title="貢献者名") + + +class LicenseInfo(BaseModel): + """ + 依存ライブラリのライセンス情報 + """ + + name: str = Field(title="依存ライブラリ名") + version: Optional[str] = Field(title="依存ライブラリのバージョン") + license: Optional[str] = Field(title="依存ライブラリのライセンス名") + text: str = Field(title="依存ライブラリのライセンス本文") + + +class SupportedFeatures(BaseModel): + """ + エンジンが持つ機能の一覧 + """ + + adjust_mora_pitch: bool = Field(title="モーラごとの音高の調整") + adjust_phoneme_length: bool = Field(title="音素ごとの長さの調整") + adjust_speed_scale: bool = Field(title="全体の話速の調整") + adjust_pitch_scale: bool = Field(title="全体の音高の調整") + adjust_intonation_scale: bool = Field(title="全体の抑揚の調整") + adjust_volume_scale: bool = Field(title="全体の音量の調整") + interrogative_upspeak: bool = Field(title="疑問文の自動調整") + synthesis_morphing: bool = Field(title="2人の話者でモーフィングした音声を合成") + manage_library: Optional[bool] = Field(title="音声ライブラリのインストール・アンインストール") + + +class EngineManifest(BaseModel): + """ + エンジン自体に関する情報 + """ + + manifest_version: str = Field(title="マニフェストのバージョン") + name: str = Field(title="エンジン名") + brand_name: str = Field(title="ブランド名") + uuid: str = Field(title="エンジンのUUID") + url: str = Field(title="エンジンのURL") + icon: str = Field(title="エンジンのアイコンをBASE64エンコードしたもの") + default_sampling_rate: int = Field(title="デフォルトのサンプリング周波数") + terms_of_service: str = Field(title="エンジンの利用規約") + update_infos: List[UpdateInfo] = Field(title="エンジンのアップデート情報") + dependency_licenses: List[LicenseInfo] = Field(title="依存関係のライセンス情報") + supported_vvlib_manifest_version: Optional[str] = Field( + title="エンジンが対応するvvlibのバージョン" + ) + supported_features: SupportedFeatures = Field(title="エンジンが持つ機能") diff --git a/voicevox_nemo_engine/voicevox_engine/engine_manifest/EngineManifestLoader.py b/voicevox_nemo_engine/voicevox_engine/engine_manifest/EngineManifestLoader.py new file mode 100644 index 0000000000000000000000000000000000000000..5f6f2199dad47f31ae985ef1e106fdf06c1dbfb7 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/engine_manifest/EngineManifestLoader.py @@ -0,0 +1,51 @@ +import json +from base64 import b64encode +from pathlib import Path + +from .EngineManifest import EngineManifest, LicenseInfo, UpdateInfo + + +class EngineManifestLoader: + def __init__(self, manifest_path: Path, root_dir: Path): + self.manifest_path = manifest_path + self.root_dir = root_dir + + def load_manifest(self) -> EngineManifest: + manifest = json.loads(self.manifest_path.read_text(encoding="utf-8")) + + manifest = EngineManifest( + manifest_version=manifest["manifest_version"], + name=manifest["name"], + brand_name=manifest["brand_name"], + uuid=manifest["uuid"], + url=manifest["url"], + default_sampling_rate=manifest["default_sampling_rate"], + icon=b64encode((self.root_dir / manifest["icon"]).read_bytes()).decode( + "utf-8" + ), + terms_of_service=(self.root_dir / manifest["terms_of_service"]).read_text( + "utf-8" + ), + update_infos=[ + UpdateInfo(**update_info) + for update_info in json.loads( + (self.root_dir / manifest["update_infos"]).read_text("utf-8") + ) + ], + # supported_vvlib_manifest_versionを持たないengine_manifestのために + # キーが存在しない場合はNoneを返すgetを使う + supported_vvlib_manifest_version=manifest.get( + "supported_vvlib_manifest_version" + ), + dependency_licenses=[ + LicenseInfo(**license_info) + for license_info in json.loads( + (self.root_dir / manifest["dependency_licenses"]).read_text("utf-8") + ) + ], + supported_features={ + key: item["value"] + for key, item in manifest["supported_features"].items() + }, + ) + return manifest diff --git a/voicevox_nemo_engine/voicevox_engine/engine_manifest/__init__.py b/voicevox_nemo_engine/voicevox_engine/engine_manifest/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..02c293179a59cbae3f28ce79ab8a31616fa69d19 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/engine_manifest/__init__.py @@ -0,0 +1,7 @@ +from .EngineManifest import EngineManifest +from .EngineManifestLoader import EngineManifestLoader + +__all__ = [ + "EngineManifest", + "EngineManifestLoader", +] diff --git a/voicevox_nemo_engine/voicevox_engine/full_context_label.py b/voicevox_nemo_engine/voicevox_engine/full_context_label.py new file mode 100644 index 0000000000000000000000000000000000000000..894a56751ad95a979487cf1cbf4e846f8e163d04 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/full_context_label.py @@ -0,0 +1,525 @@ +import re +from dataclasses import dataclass +from itertools import chain +from typing import Dict, List, Optional + +import pyopenjtalk + + +@dataclass +class Phoneme: + """ + 音素(母音・子音)クラス、音素の元となるcontextを保持する + 音素には、母音や子音以外にも無音(silent/pause)も含まれる + + Attributes + ---------- + contexts: Dict[str, str] + 音素の元 + """ + + contexts: Dict[str, str] + + @classmethod + def from_label(cls, label: str): + """ + pyopenjtalk.extract_fullcontextで得られる音素の元(ラベル)から、Phonemeクラスを作成する + Parameters + ---------- + label : str + pyopenjtalk.extract_fullcontextで得られるラベルを渡す + + Returns + ------- + phoneme: Phoneme + Phonemeクラスを返す + """ + + # フルコンテキストラベルの仕様は、 + # http://hts.sp.nitech.ac.jp/?Download の HTS-2.3のJapanese tar.bz2 (126 MB)をダウンロードして、data/lab_format.pdfを見るとリストが見つかります。 # noqa + contexts = re.search( + r"^(?P.+?)\^(?P.+?)\-(?P.+?)\+(?P.+?)\=(?P.+?)" + r"/A\:(?P.+?)\+(?P.+?)\+(?P.+?)" + r"/B\:(?P.+?)\-(?P.+?)\_(?P.+?)" + r"/C\:(?P.+?)\_(?P.+?)\+(?P.+?)" + r"/D\:(?P.+?)\+(?P.+?)\_(?P.+?)" + r"/E\:(?P.+?)\_(?P.+?)\!(?P.+?)\_(?P.+?)\-(?P.+?)" + r"/F\:(?P.+?)\_(?P.+?)\#(?P.+?)\_(?P.+?)\@(?P.+?)\_(?P.+?)\|(?P.+?)\_(?P.+?)" # noqa + r"/G\:(?P.+?)\_(?P.+?)\%(?P.+?)\_(?P.+?)\_(?P.+?)" + r"/H\:(?P.+?)\_(?P.+?)" + r"/I\:(?P.+?)\-(?P.+?)\@(?P.+?)\+(?P.+?)\&(?P.+?)\-(?P.+?)\|(?P.+?)\+(?P.+?)" # noqa + r"/J\:(?P.+?)\_(?P.+?)" + r"/K\:(?P.+?)\+(?P.+?)\-(?P.+?)$", + label, + ).groupdict() + return cls(contexts=contexts) + + @property + def label(self): + """ + pyopenjtalk.extract_fullcontextで得られるラベルと等しい + Returns + ------- + lebel: str + ラベルを返す + """ + return ( + "{p1}^{p2}-{p3}+{p4}={p5}" + "/A:{a1}+{a2}+{a3}" + "/B:{b1}-{b2}_{b3}" + "/C:{c1}_{c2}+{c3}" + "/D:{d1}+{d2}_{d3}" + "/E:{e1}_{e2}!{e3}_{e4}-{e5}" + "/F:{f1}_{f2}#{f3}_{f4}@{f5}_{f6}|{f7}_{f8}" + "/G:{g1}_{g2}%{g3}_{g4}_{g5}" + "/H:{h1}_{h2}" + "/I:{i1}-{i2}@{i3}+{i4}&{i5}-{i6}|{i7}+{i8}" + "/J:{j1}_{j2}" + "/K:{k1}+{k2}-{k3}" + ).format(**self.contexts) + + @property + def phoneme(self): + """ + 音素クラスの中で、発声に必要な要素を返す + Returns + ------- + phoneme : str + 発声に必要な要素を返す + """ + return self.contexts["p3"] + + def is_pause(self): + """ + 音素がポーズ(無音、silent/pause)であるかを返す + Returns + ------- + is_pose : bool + 音素がポーズ(無音、silent/pause)であるか(True)否か(False) + """ + return self.contexts["f1"] == "xx" + + def __repr__(self): + return f"" + + +@dataclass +class Mora: + """ + モーラクラス + モーラは1音素(母音や促音「っ」、撥音「ん」など)か、2音素(母音と子音の組み合わせ)で成り立つ + + Attributes + ---------- + consonant : Optional[Phoneme] + 子音 + vowel : Phoneme + 母音 + """ + + consonant: Optional[Phoneme] + vowel: Phoneme + + def set_context(self, key: str, value: str): + """ + Moraクラス内に含まれるPhonemeのcontextのうち、指定されたキーの値を変更する + consonantが存在する場合は、vowelと同じようにcontextを変更する + Parameters + ---------- + key : str + 変更したいcontextのキー + value : str + 変更したいcontextの値 + """ + self.vowel.contexts[key] = value + if self.consonant is not None: + self.consonant.contexts[key] = value + + @property + def phonemes(self): + """ + 音素群を返す + Returns + ------- + phonemes : List[Phoneme] + 母音しかない場合は母音のみ、子音もある場合は子音、母音の順番でPhonemeのリストを返す + """ + if self.consonant is not None: + return [self.consonant, self.vowel] + else: + return [self.vowel] + + @property + def labels(self): + """ + ラベル群を返す + Returns + ------- + labels : List[str] + Moraに含まれるすべてのラベルを返す + """ + return [p.label for p in self.phonemes] + + +@dataclass +class AccentPhrase: + """ + アクセント句クラス + 同じアクセントのMoraを複数保持する + Attributes + ---------- + moras : List[Mora] + 音韻のリスト + accent : int + アクセント + """ + + moras: List[Mora] + accent: int + is_interrogative: bool + + @classmethod + def from_phonemes(cls, phonemes: List[Phoneme]): + """ + PhonemeのリストからAccentPhraseクラスを作成する + Parameters + ---------- + phonemes : List[Phoneme] + phonemeのリストを渡す + + Returns + ------- + accent_phrase : AccentPhrase + AccentPhraseクラスを返す + """ + moras: List[Mora] = [] + + mora_phonemes: List[Phoneme] = [] + for phoneme, next_phoneme in zip(phonemes, phonemes[1:] + [None]): + # workaround for Hihosiba/voicevox_engine#57 + # (py)openjtalk によるアクセント句内のモーラへの附番は 49 番目まで + # 49 番目のモーラについて、続く音素のモーラ番号を単一モーラの特定に使えない + if int(phoneme.contexts["a2"]) == 49: + break + + mora_phonemes.append(phoneme) + + if ( + next_phoneme is None + or phoneme.contexts["a2"] != next_phoneme.contexts["a2"] + ): + if len(mora_phonemes) == 1: + consonant, vowel = None, mora_phonemes[0] + elif len(mora_phonemes) == 2: + consonant, vowel = mora_phonemes[0], mora_phonemes[1] + else: + raise ValueError(mora_phonemes) + mora = Mora(consonant=consonant, vowel=vowel) + moras.append(mora) + mora_phonemes = [] + + accent = int(moras[0].vowel.contexts["f2"]) + # workaround for Hihosiba/voicevox_engine#55 + # アクセント位置とするキー f2 の値がアクセント句内のモーラ数を超える場合がある + accent = accent if accent <= len(moras) else len(moras) + is_interrogative = moras[-1].vowel.contexts["f3"] == "1" + return cls(moras=moras, accent=accent, is_interrogative=is_interrogative) + + def set_context(self, key: str, value: str): + """ + AccentPhraseに間接的に含まれる全てのPhonemeのcontextの、指定されたキーの値を変更する + Parameters + ---------- + key : str + 変更したいcontextのキー + value : str + 変更したいcontextの値 + """ + for mora in self.moras: + mora.set_context(key, value) + + @property + def phonemes(self): + """ + 音素群を返す + Returns + ------- + phonemes : List[Phoneme] + AccentPhraseに間接的に含まれる全てのPhonemeを返す + """ + return list(chain.from_iterable(m.phonemes for m in self.moras)) + + @property + def labels(self): + """ + ラベル群を返す + Returns + ------- + labels : List[str] + AccentPhraseに間接的に含まれる全てのラベルを返す + """ + return [p.label for p in self.phonemes] + + def merge(self, accent_phrase: "AccentPhrase"): + """ + AccentPhraseを合成する + (このクラスが保持するmorasの後ろに、引数として渡されたAccentPhraseのmorasを合成する) + Parameters + ---------- + accent_phrase : AccentPhrase + 合成したいAccentPhraseを渡す + + Returns + ------- + accent_phrase : AccentPhrase + 合成されたAccentPhraseを返す + """ + return AccentPhrase( + moras=self.moras + accent_phrase.moras, + accent=self.accent, + is_interrogative=accent_phrase.is_interrogative, + ) + + +@dataclass +class BreathGroup: + """ + 発声の区切りクラス + アクセントの異なるアクセント句を複数保持する + Attributes + ---------- + accent_phrases : List[AccentPhrase] + アクセント句のリスト + """ + + accent_phrases: List[AccentPhrase] + + @classmethod + def from_phonemes(cls, phonemes: List[Phoneme]): + """ + PhonemeのリストからBreathGroupクラスを作成する + Parameters + ---------- + phonemes : List[Phoneme] + phonemeのリストを渡す + + Returns + ------- + breath_group : BreathGroup + BreathGroupクラスを返す + """ + accent_phrases: List[AccentPhrase] = [] + accent_phonemes: List[Phoneme] = [] + for phoneme, next_phoneme in zip(phonemes, phonemes[1:] + [None]): + accent_phonemes.append(phoneme) + + if ( + next_phoneme is None + or phoneme.contexts["i3"] != next_phoneme.contexts["i3"] + or phoneme.contexts["f5"] != next_phoneme.contexts["f5"] + ): + accent_phrase = AccentPhrase.from_phonemes(accent_phonemes) + accent_phrases.append(accent_phrase) + accent_phonemes = [] + + return cls(accent_phrases=accent_phrases) + + def set_context(self, key: str, value: str): + """ + BreathGroupに間接的に含まれる全てのPhonemeのcontextの、指定されたキーの値を変更する + Parameters + ---------- + key : str + 変更したいcontextのキー + value : str + 変更したいcontextの値 + """ + for accent_phrase in self.accent_phrases: + accent_phrase.set_context(key, value) + + @property + def phonemes(self): + """ + 音素群を返す + Returns + ------- + phonemes : List[Phoneme] + BreathGroupに間接的に含まれる全てのPhonemeを返す + """ + return list( + chain.from_iterable( + accent_phrase.phonemes for accent_phrase in self.accent_phrases + ) + ) + + @property + def labels(self): + """ + ラベル群を返す + Returns + ------- + labels : List[str] + BreathGroupに間接的に含まれる全てのラベルを返す + """ + return [p.label for p in self.phonemes] + + +@dataclass +class Utterance: + """ + 発声クラス + 発声の区切りと無音を複数保持する + Attributes + ---------- + breath_groups : List[BreathGroup] + 発声の区切りのリスト + pauses : List[Phoneme] + 無音のリスト + """ + + breath_groups: List[BreathGroup] + pauses: List[Phoneme] + + @classmethod + def from_phonemes(cls, phonemes: List[Phoneme]): + """ + Phonemeの完全なリストからUtteranceクラスを作成する + Parameters + ---------- + phonemes : List[Phoneme] + phonemeのリストを渡す + + Returns + ------- + utterance : Utterance + Utteranceクラスを返す + """ + pauses: List[Phoneme] = [] + + breath_groups: List[BreathGroup] = [] + group_phonemes: List[Phoneme] = [] + for phoneme in phonemes: + if not phoneme.is_pause(): + group_phonemes.append(phoneme) + + else: + pauses.append(phoneme) + + if len(group_phonemes) > 0: + breath_group = BreathGroup.from_phonemes(group_phonemes) + breath_groups.append(breath_group) + group_phonemes = [] + + return cls(breath_groups=breath_groups, pauses=pauses) + + def set_context(self, key: str, value: str): + """ + Utteranceに間接的に含まれる全てのPhonemeのcontextの、指定されたキーの値を変更する + Parameters + ---------- + key : str + 変更したいcontextのキー + value : str + 変更したいcontextの値 + """ + for breath_group in self.breath_groups: + breath_group.set_context(key, value) + + @property + def phonemes(self): + """ + 音素群を返す + Returns + ------- + phonemes : List[Phoneme] + Utteranceクラスに直接的・間接的に含まれる、全てのPhonemeを返す + """ + accent_phrases = list( + chain.from_iterable( + breath_group.accent_phrases for breath_group in self.breath_groups + ) + ) + for prev, cent, post in zip( + [None] + accent_phrases[:-1], + accent_phrases, + accent_phrases[1:] + [None], + ): + mora_num = len(cent.moras) + accent = cent.accent + + if prev is not None: + prev.set_context("g1", str(mora_num)) + prev.set_context("g2", str(accent)) + + if post is not None: + post.set_context("e1", str(mora_num)) + post.set_context("e2", str(accent)) + + cent.set_context("f1", str(mora_num)) + cent.set_context("f2", str(accent)) + for i_mora, mora in enumerate(cent.moras): + mora.set_context("a1", str(i_mora - accent + 1)) + mora.set_context("a2", str(i_mora + 1)) + mora.set_context("a3", str(mora_num - i_mora)) + + for prev, cent, post in zip( + [None] + self.breath_groups[:-1], + self.breath_groups, + self.breath_groups[1:] + [None], + ): + accent_phrase_num = len(cent.accent_phrases) + + if prev is not None: + prev.set_context("j1", str(accent_phrase_num)) + + if post is not None: + post.set_context("h1", str(accent_phrase_num)) + + cent.set_context("i1", str(accent_phrase_num)) + cent.set_context( + "i5", str(accent_phrases.index(cent.accent_phrases[0]) + 1) + ) + cent.set_context( + "i6", + str(len(accent_phrases) - accent_phrases.index(cent.accent_phrases[0])), + ) + + self.set_context( + "k2", + str( + sum( + [ + len(breath_group.accent_phrases) + for breath_group in self.breath_groups + ] + ) + ), + ) + + phonemes: List[Phoneme] = [] + for i in range(len(self.pauses)): + if self.pauses[i] is not None: + phonemes += [self.pauses[i]] + + if i < len(self.pauses) - 1: + phonemes += self.breath_groups[i].phonemes + + return phonemes + + @property + def labels(self): + """ + ラベル群を返す + Returns + ------- + labels : List[str] + Utteranceクラスに直接的・間接的に含まれる全てのラベルを返す + """ + return [p.label for p in self.phonemes] + + +def extract_full_context_label(text: str): + labels = pyopenjtalk.extract_fullcontext(text) + phonemes = [Phoneme.from_label(label=label) for label in labels] + utterance = Utterance.from_phonemes(phonemes) + return utterance diff --git a/voicevox_nemo_engine/voicevox_engine/kana_parser.py b/voicevox_nemo_engine/voicevox_engine/kana_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..7aa9e9d82c8e48195c6993dea267708b42012c5a --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/kana_parser.py @@ -0,0 +1,146 @@ +from typing import List, Optional + +from .model import AccentPhrase, Mora, ParseKanaError, ParseKanaErrorCode +from .mora_list import openjtalk_text2mora + +LOOP_LIMIT = 300 +UNVOICE_SYMBOL = "_" +ACCENT_SYMBOL = "'" +NOPAUSE_DELIMITER = "/" +PAUSE_DELIMITER = "、" +WIDE_INTERROGATION_MARK = "?" + +text2mora_with_unvoice = {} +for text, (consonant, vowel) in openjtalk_text2mora.items(): + text2mora_with_unvoice[text] = Mora( + text=text, + consonant=consonant if len(consonant) > 0 else None, + consonant_length=0 if len(consonant) > 0 else None, + vowel=vowel, + vowel_length=0, + pitch=0, + is_interrogative=False, + ) + if vowel in ["a", "i", "u", "e", "o"]: + text2mora_with_unvoice[UNVOICE_SYMBOL + text] = Mora( + text=text, + consonant=consonant if len(consonant) > 0 else None, + consonant_length=0 if len(consonant) > 0 else None, + vowel=vowel.upper(), + vowel_length=0, + pitch=0, + is_interrogative=False, + ) + + +def _text_to_accent_phrase(phrase: str) -> AccentPhrase: + """ + longest matchにより読み仮名からAccentPhraseを生成 + 入力長Nに対し計算量O(N^2) + """ + accent_index: Optional[int] = None + moras: List[Mora] = [] + + base_index = 0 # パース開始位置。ここから右の文字列をstackに詰めていく。 + stack = "" # 保留中の文字列 + matched_text: Optional[str] = None # 保留中の文字列内で最後にマッチした仮名 + + outer_loop = 0 + while base_index < len(phrase): + outer_loop += 1 + if phrase[base_index] == ACCENT_SYMBOL: + if len(moras) == 0: + raise ParseKanaError(ParseKanaErrorCode.ACCENT_TOP, text=phrase) + if accent_index is not None: + raise ParseKanaError(ParseKanaErrorCode.ACCENT_TWICE, text=phrase) + accent_index = len(moras) + base_index += 1 + continue + for watch_index in range(base_index, len(phrase)): + if phrase[watch_index] == ACCENT_SYMBOL: + break + # 普通の文字の場合 + stack += phrase[watch_index] + if stack in text2mora_with_unvoice: + matched_text = stack + # push mora + if matched_text is None: + raise ParseKanaError(ParseKanaErrorCode.UNKNOWN_TEXT, text=stack) + else: + moras.append(text2mora_with_unvoice[matched_text].copy(deep=True)) + base_index += len(matched_text) + stack = "" + matched_text = None + if outer_loop > LOOP_LIMIT: + raise ParseKanaError(ParseKanaErrorCode.INFINITE_LOOP) + if accent_index is None: + raise ParseKanaError(ParseKanaErrorCode.ACCENT_NOTFOUND, text=phrase) + else: + return AccentPhrase(moras=moras, accent=accent_index, pause_mora=None) + + +def parse_kana(text: str) -> List[AccentPhrase]: + """ + AquesTalkライクな読み仮名をパースして音長・音高未指定のaccent phraseに変換 + """ + + parsed_results: List[AccentPhrase] = [] + phrase_base = 0 + if len(text) == 0: + raise ParseKanaError(ParseKanaErrorCode.EMPTY_PHRASE, position=1) + + for i in range(len(text) + 1): + if i == len(text) or text[i] in [PAUSE_DELIMITER, NOPAUSE_DELIMITER]: + phrase = text[phrase_base:i] + if len(phrase) == 0: + raise ParseKanaError( + ParseKanaErrorCode.EMPTY_PHRASE, + position=str(len(parsed_results) + 1), + ) + phrase_base = i + 1 + + is_interrogative = WIDE_INTERROGATION_MARK in phrase + if is_interrogative: + if WIDE_INTERROGATION_MARK in phrase[:-1]: + raise ParseKanaError( + ParseKanaErrorCode.INTERROGATION_MARK_NOT_AT_END, text=phrase + ) + phrase = phrase.replace(WIDE_INTERROGATION_MARK, "") + + accent_phrase: AccentPhrase = _text_to_accent_phrase(phrase) + if i < len(text) and text[i] == PAUSE_DELIMITER: + accent_phrase.pause_mora = Mora( + text="、", + consonant=None, + consonant_length=None, + vowel="pau", + vowel_length=0, + pitch=0, + ) + accent_phrase.is_interrogative = is_interrogative + + parsed_results.append(accent_phrase) + + return parsed_results + + +def create_kana(accent_phrases: List[AccentPhrase]) -> str: + text = "" + for i, phrase in enumerate(accent_phrases): + for j, mora in enumerate(phrase.moras): + if mora.vowel in ["A", "I", "U", "E", "O"]: + text += UNVOICE_SYMBOL + + text += mora.text + if j + 1 == phrase.accent: + text += ACCENT_SYMBOL + + if phrase.is_interrogative: + text += WIDE_INTERROGATION_MARK + + if i < len(accent_phrases) - 1: + if phrase.pause_mora is None: + text += NOPAUSE_DELIMITER + else: + text += PAUSE_DELIMITER + return text diff --git a/voicevox_nemo_engine/voicevox_engine/metas/Metas.py b/voicevox_nemo_engine/voicevox_engine/metas/Metas.py new file mode 100644 index 0000000000000000000000000000000000000000..58c42f06765c3554a138471d83fc90800e6a8540 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/metas/Metas.py @@ -0,0 +1,83 @@ +from enum import Enum +from typing import List, Optional + +from pydantic import BaseModel, Field + + +class SpeakerStyle(BaseModel): + """ + スピーカーのスタイル情報 + """ + + name: str = Field(title="スタイル名") + id: int = Field(title="スタイルID") + + +class SpeakerSupportPermittedSynthesisMorphing(str, Enum): + ALL = "ALL" # 全て許可 + SELF_ONLY = "SELF_ONLY" # 同じ話者内でのみ許可 + NOTHING = "NOTHING" # 全て禁止 + + @classmethod + def _missing_(cls, value: object) -> "SpeakerSupportPermittedSynthesisMorphing": + return SpeakerSupportPermittedSynthesisMorphing.ALL + + +class SpeakerSupportedFeatures(BaseModel): + """ + 話者の対応機能の情報 + """ + + permitted_synthesis_morphing: SpeakerSupportPermittedSynthesisMorphing = Field( + title="モーフィング機能への対応", default=SpeakerSupportPermittedSynthesisMorphing(None) + ) + + +class CoreSpeaker(BaseModel): + """ + コアに含まれるスピーカー情報 + """ + + name: str = Field(title="名前") + speaker_uuid: str = Field(title="スピーカーのUUID") + styles: List[SpeakerStyle] = Field(title="スピーカースタイルの一覧") + version: str = Field("スピーカーのバージョン") + + +class EngineSpeaker(BaseModel): + """ + エンジンに含まれるスピーカー情報 + """ + + supported_features: SpeakerSupportedFeatures = Field( + title="スピーカーの対応機能", default_factory=SpeakerSupportedFeatures + ) + + +class Speaker(CoreSpeaker, EngineSpeaker): + """ + スピーカー情報 + """ + + pass + + +class StyleInfo(BaseModel): + """ + スタイルの追加情報 + """ + + id: int = Field(title="スタイルID") + icon: str = Field(title="当該スタイルのアイコンをbase64エンコードしたもの") + portrait: Optional[str] = Field(title="当該スタイルのportrait.pngをbase64エンコードしたもの") + voice_samples: List[str] = Field(title="voice_sampleのwavファイルをbase64エンコードしたもの") + + +class SpeakerInfo(BaseModel): + """ + 話者の追加情報 + """ + + policy: str = Field(title="policy.md") + portrait: str = Field(title="portrait.pngをbase64エンコードしたもの") + style_infos: List[StyleInfo] = Field(title="スタイルの追加情報") diff --git a/voicevox_nemo_engine/voicevox_engine/metas/MetasStore.py b/voicevox_nemo_engine/voicevox_engine/metas/MetasStore.py new file mode 100644 index 0000000000000000000000000000000000000000..88a7bc37daad4ab70f1e7af07d7beab7eaa06e46 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/metas/MetasStore.py @@ -0,0 +1,72 @@ +import json +from pathlib import Path +from typing import TYPE_CHECKING, Dict, List, Tuple + +from voicevox_engine.metas.Metas import CoreSpeaker, EngineSpeaker, Speaker, StyleInfo + +if TYPE_CHECKING: + from voicevox_engine.synthesis_engine.synthesis_engine_base import ( + SynthesisEngineBase, + ) + + +class MetasStore: + """ + 話者やスタイルのメタ情報を管理する + """ + + def __init__(self, engine_speakers_path: Path) -> None: + self._engine_speakers_path = engine_speakers_path + self._loaded_metas: Dict[str, EngineSpeaker] = { + folder.name: EngineSpeaker( + **json.loads((folder / "metas.json").read_text(encoding="utf-8")) + ) + for folder in engine_speakers_path.iterdir() + } + + def speaker_engine_metas(self, speaker_uuid: str) -> EngineSpeaker: + return self.loaded_metas[speaker_uuid] + + def combine_metas(self, core_metas: List[CoreSpeaker]) -> List[Speaker]: + """ + 与えられたmetaにエンジンのコア情報を付加して返す + core_metas: コアのmetas()が返すJSONのModel + """ + + return [ + Speaker( + **self.speaker_engine_metas(speaker_meta.speaker_uuid).dict(), + **speaker_meta.dict(), + ) + for speaker_meta in core_metas + ] + + # FIXME: engineではなくList[CoreSpeaker]を渡す形にすることで + # SynthesisEngineBaseによる循環importを修正する + def load_combined_metas(self, engine: "SynthesisEngineBase") -> List[Speaker]: + """ + 与えられたエンジンから、コア・エンジン両方の情報を含んだMetasを返す + """ + + core_metas = [CoreSpeaker(**speaker) for speaker in json.loads(engine.speakers)] + return self.combine_metas(core_metas) + + @property + def engine_speakers_path(self) -> Path: + return self._engine_speakers_path + + @property + def loaded_metas(self) -> Dict[str, EngineSpeaker]: + return self._loaded_metas + + +def construct_lookup(speakers: List[Speaker]) -> Dict[int, Tuple[Speaker, StyleInfo]]: + """ + `{style.id: StyleInfo}`の変換テーブル + """ + + lookup_table = dict() + for speaker in speakers: + for style in speaker.styles: + lookup_table[style.id] = (speaker, style) + return lookup_table diff --git a/voicevox_nemo_engine/voicevox_engine/metas/__init__.py b/voicevox_nemo_engine/voicevox_engine/metas/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4907fdf38d604dc7949dd361812938afd9db0abb --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/metas/__init__.py @@ -0,0 +1,6 @@ +from . import Metas, MetasStore + +__all__ = [ + "Metas", + "MetasStore", +] diff --git a/voicevox_nemo_engine/voicevox_engine/model.py b/voicevox_nemo_engine/voicevox_engine/model.py new file mode 100644 index 0000000000000000000000000000000000000000..f2d3524ee964b705a081ffeef81dc9d150f1c6f2 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/model.py @@ -0,0 +1,303 @@ +from enum import Enum +from re import findall, fullmatch +from typing import Dict, List, Optional + +from pydantic import BaseModel, Field, StrictStr, conint, validator + +from .metas.Metas import Speaker, SpeakerInfo + + +class Mora(BaseModel): + """ + モーラ(子音+母音)ごとの情報 + """ + + text: str = Field(title="文字") + consonant: Optional[str] = Field(title="子音の音素") + consonant_length: Optional[float] = Field(title="子音の音長") + vowel: str = Field(title="母音の音素") + vowel_length: float = Field(title="母音の音長") + pitch: float = Field(title="音高") # デフォルト値をつけるとts側のOpenAPIで生成されたコードの型がOptionalになる + + def __hash__(self): + items = [ + (k, tuple(v)) if isinstance(v, List) else (k, v) + for k, v in self.__dict__.items() + ] + return hash(tuple(sorted(items))) + + +class AccentPhrase(BaseModel): + """ + アクセント句ごとの情報 + """ + + moras: List[Mora] = Field(title="モーラのリスト") + accent: int = Field(title="アクセント箇所") + pause_mora: Optional[Mora] = Field(title="後ろに無音を付けるかどうか") + is_interrogative: bool = Field(default=False, title="疑問系かどうか") + + def __hash__(self): + items = [ + (k, tuple(v)) if isinstance(v, List) else (k, v) + for k, v in self.__dict__.items() + ] + return hash(tuple(sorted(items))) + + +class AudioQuery(BaseModel): + """ + 音声合成用のクエリ + """ + + accent_phrases: List[AccentPhrase] = Field(title="アクセント句のリスト") + speedScale: float = Field(title="全体の話速") + pitchScale: float = Field(title="全体の音高") + intonationScale: float = Field(title="全体の抑揚") + volumeScale: float = Field(title="全体の音量") + prePhonemeLength: float = Field(title="音声の前の無音時間") + postPhonemeLength: float = Field(title="音声の後の無音時間") + outputSamplingRate: int = Field(title="音声データの出力サンプリングレート") + outputStereo: bool = Field(title="音声データをステレオ出力するか否か") + kana: Optional[str] = Field(title="[読み取り専用]AquesTalkライクな読み仮名。音声合成クエリとしては無視される") + + def __hash__(self): + items = [ + (k, tuple(v)) if isinstance(v, List) else (k, v) + for k, v in self.__dict__.items() + ] + return hash(tuple(sorted(items))) + + +class ParseKanaErrorCode(Enum): + UNKNOWN_TEXT = "判別できない読み仮名があります: {text}" + ACCENT_TOP = "句頭にアクセントは置けません: {text}" + ACCENT_TWICE = "1つのアクセント句に二つ以上のアクセントは置けません: {text}" + ACCENT_NOTFOUND = "アクセントを指定していないアクセント句があります: {text}" + EMPTY_PHRASE = "{position}番目のアクセント句が空白です" + INTERROGATION_MARK_NOT_AT_END = "アクセント句末以外に「?」は置けません: {text}" + INFINITE_LOOP = "処理時に無限ループになってしまいました...バグ報告をお願いします。" + + +class ParseKanaError(Exception): + def __init__(self, errcode: ParseKanaErrorCode, **kwargs): + self.errcode = errcode + self.errname = errcode.name + self.kwargs: Dict[str, str] = kwargs + err_fmt: str = errcode.value + self.text = err_fmt.format(**kwargs) + + +class ParseKanaBadRequest(BaseModel): + text: str = Field(title="エラーメッセージ") + error_name: str = Field( + title="エラー名", + description="|name|description|\n|---|---|\n" + + "\n".join( + [ + "| {} | {} |".format(err.name, err.value) + for err in list(ParseKanaErrorCode) + ] + ), + ) + error_args: Dict[str, str] = Field(title="エラーを起こした箇所") + + def __init__(self, err: ParseKanaError): + super().__init__(text=err.text, error_name=err.errname, error_args=err.kwargs) + + +class MorphableTargetInfo(BaseModel): + is_morphable: bool = Field(title="指定した話者に対してモーフィングの可否") + # FIXME: add reason property + # reason: Optional[str] = Field(title="is_morphableがfalseである場合、その理由") + + +class StyleIdNotFoundError(LookupError): + def __init__(self, style_id: int, *args: object, **kywrds: object) -> None: + self.style_id = style_id + super().__init__(f"style_id {style_id} is not found.", *args, **kywrds) + + +class LibrarySpeaker(BaseModel): + """ + 音声ライブラリに含まれる話者の情報 + """ + + speaker: Speaker = Field(title="話者情報") + speaker_info: SpeakerInfo = Field(title="話者の追加情報") + + +class DownloadableLibrary(BaseModel): + """ + ダウンロード可能な音声ライブラリの情報 + """ + + name: str = Field(title="音声ライブラリの名前") + uuid: str = Field(title="音声ライブラリのUUID") + version: str = Field(title="音声ライブラリのバージョン") + download_url: str = Field(title="音声ライブラリのダウンロードURL") + bytes: int = Field(title="音声ライブラリのバイト数") + speakers: List[LibrarySpeaker] = Field(title="音声ライブラリに含まれる話者のリスト") + + +class InstalledLibrary(DownloadableLibrary): + """ + インストール済み音声ライブラリの情報 + """ + + uninstallable: bool = Field(title="アンインストール可能かどうか") + + +USER_DICT_MIN_PRIORITY = 0 +USER_DICT_MAX_PRIORITY = 10 + + +class UserDictWord(BaseModel): + """ + 辞書のコンパイルに使われる情報 + """ + + surface: str = Field(title="表層形") + priority: conint(ge=USER_DICT_MIN_PRIORITY, le=USER_DICT_MAX_PRIORITY) = Field( + title="優先度" + ) + context_id: int = Field(title="文脈ID", default=1348) + part_of_speech: str = Field(title="品詞") + part_of_speech_detail_1: str = Field(title="品詞細分類1") + part_of_speech_detail_2: str = Field(title="品詞細分類2") + part_of_speech_detail_3: str = Field(title="品詞細分類3") + inflectional_type: str = Field(title="活用型") + inflectional_form: str = Field(title="活用形") + stem: str = Field(title="原形") + yomi: str = Field(title="読み") + pronunciation: str = Field(title="発音") + accent_type: int = Field(title="アクセント型") + mora_count: Optional[int] = Field(title="モーラ数") + accent_associative_rule: str = Field(title="アクセント結合規則") + + class Config: + validate_assignment = True + + @validator("surface") + def convert_to_zenkaku(cls, surface): + return surface.translate( + str.maketrans( + "".join(chr(0x21 + i) for i in range(94)), + "".join(chr(0xFF01 + i) for i in range(94)), + ) + ) + + @validator("pronunciation", pre=True) + def check_is_katakana(cls, pronunciation): + if not fullmatch(r"[ァ-ヴー]+", pronunciation): + raise ValueError("発音は有効なカタカナでなくてはいけません。") + sutegana = ["ァ", "ィ", "ゥ", "ェ", "ォ", "ャ", "ュ", "ョ", "ヮ", "ッ"] + for i in range(len(pronunciation)): + if pronunciation[i] in sutegana: + # 「キャット」のように、捨て仮名が連続する可能性が考えられるので、 + # 「ッ」に関しては「ッ」そのものが連続している場合と、「ッ」の後にほかの捨て仮名が連続する場合のみ無効とする + if i < len(pronunciation) - 1 and ( + pronunciation[i + 1] in sutegana[:-1] + or ( + pronunciation[i] == sutegana[-1] + and pronunciation[i + 1] == sutegana[-1] + ) + ): + raise ValueError("無効な発音です。(捨て仮名の連続)") + if pronunciation[i] == "ヮ": + if i != 0 and pronunciation[i - 1] not in ["ク", "グ"]: + raise ValueError("無効な発音です。(「くゎ」「ぐゎ」以外の「ゎ」の使用)") + return pronunciation + + @validator("mora_count", pre=True, always=True) + def check_mora_count_and_accent_type(cls, mora_count, values): + if "pronunciation" not in values or "accent_type" not in values: + # 適切な場所でエラーを出すようにする + return mora_count + + if mora_count is None: + rule_others = "[イ][ェ]|[ヴ][ャュョ]|[トド][ゥ]|[テデ][ィャュョ]|[デ][ェ]|[クグ][ヮ]" + rule_line_i = "[キシチニヒミリギジビピ][ェャュョ]" + rule_line_u = "[ツフヴ][ァ]|[ウスツフヴズ][ィ]|[ウツフヴ][ェォ]" + rule_one_mora = "[ァ-ヴー]" + mora_count = len( + findall( + f"(?:{rule_others}|{rule_line_i}|{rule_line_u}|{rule_one_mora})", + values["pronunciation"], + ) + ) + + if not 0 <= values["accent_type"] <= mora_count: + raise ValueError( + "誤ったアクセント型です({})。 expect: 0 <= accent_type <= {}".format( + values["accent_type"], mora_count + ) + ) + return mora_count + + +class PartOfSpeechDetail(BaseModel): + """ + 品詞ごとの情報 + """ + + part_of_speech: str = Field(title="品詞") + part_of_speech_detail_1: str = Field(title="品詞細分類1") + part_of_speech_detail_2: str = Field(title="品詞細分類2") + part_of_speech_detail_3: str = Field(title="品詞細分類3") + # context_idは辞書の左・右文脈IDのこと + # https://github.com/VOICEVOX/open_jtalk/blob/427cfd761b78efb6094bea3c5bb8c968f0d711ab/src/mecab-naist-jdic/_left-id.def # noqa + context_id: int = Field(title="文脈ID") + cost_candidates: List[int] = Field(title="コストのパーセンタイル") + accent_associative_rules: List[str] = Field(title="アクセント結合規則の一覧") + + +class WordTypes(str, Enum): + """ + fastapiでword_type引数を検証する時に使用するクラス + """ + + PROPER_NOUN = "PROPER_NOUN" + COMMON_NOUN = "COMMON_NOUN" + VERB = "VERB" + ADJECTIVE = "ADJECTIVE" + SUFFIX = "SUFFIX" + + +class SupportedDevicesInfo(BaseModel): + """ + 対応しているデバイスの情報 + """ + + cpu: bool = Field(title="CPUに対応しているか") + cuda: bool = Field(title="CUDA(Nvidia GPU)に対応しているか") + dml: bool = Field(title="DirectML(Nvidia GPU/Radeon GPU等)に対応しているか") + + +class SupportedFeaturesInfo(BaseModel): + """ + エンジンの機能の情報 + """ + + support_adjusting_mora: bool = Field(title="モーラが調整可能かどうか") + support_adjusting_speed_scale: bool = Field(title="話速が調整可能かどうか") + support_adjusting_pitch_scale: bool = Field(title="音高が調整可能かどうか") + support_adjusting_intonation_scale: bool = Field(title="抑揚が調整可能かどうか") + support_adjusting_volume_scale: bool = Field(title="音量が調整可能かどうか") + support_adjusting_silence_scale: bool = Field(title="前後の無音時間が調節可能かどうか") + support_interrogative_upspeak: bool = Field(title="疑似疑問文に対応しているかどうか") + support_switching_device: bool = Field(title="CPU/GPUの切り替えが可能かどうか") + + +class VvlibManifest(BaseModel): + """ + vvlib(VOICEVOX Library)に関する情報 + """ + + manifest_version: StrictStr = Field(title="マニフェストバージョン") + name: StrictStr = Field(title="音声ライブラリ名") + version: StrictStr = Field(title="音声ライブラリバージョン") + uuid: StrictStr = Field(title="音声ライブラリのUUID") + brand_name: StrictStr = Field(title="エンジンのブランド名") + engine_name: StrictStr = Field(title="エンジン名") + engine_uuid: StrictStr = Field(title="エンジンのUUID") diff --git a/voicevox_nemo_engine/voicevox_engine/mora_list.py b/voicevox_nemo_engine/voicevox_engine/mora_list.py new file mode 100644 index 0000000000000000000000000000000000000000..5a49f4a3a434ef4832355fcc66c5192b1a4b3059 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/mora_list.py @@ -0,0 +1,218 @@ +""" +以下のモーラ対応表はOpenJTalkのソースコードから取得し、 +カタカナ表記とモーラが一対一対応するように改造した。 +ライセンス表記: +----------------------------------------------------------------- + The Japanese TTS System "Open JTalk" + developed by HTS Working Group + http://open-jtalk.sourceforge.net/ +----------------------------------------------------------------- + + Copyright (c) 2008-2014 Nagoya Institute of Technology + Department of Computer Science + +All rights reserved. + +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. +- Neither the name of the HTS working group nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +""" +_mora_list_minimum = [ + ["ヴォ", "v", "o"], + ["ヴェ", "v", "e"], + ["ヴィ", "v", "i"], + ["ヴァ", "v", "a"], + ["ヴ", "v", "u"], + ["ン", "", "N"], + ["ワ", "w", "a"], + ["ロ", "r", "o"], + ["レ", "r", "e"], + ["ル", "r", "u"], + ["リョ", "ry", "o"], + ["リュ", "ry", "u"], + ["リャ", "ry", "a"], + ["リェ", "ry", "e"], + ["リ", "r", "i"], + ["ラ", "r", "a"], + ["ヨ", "y", "o"], + ["ユ", "y", "u"], + ["ヤ", "y", "a"], + ["モ", "m", "o"], + ["メ", "m", "e"], + ["ム", "m", "u"], + ["ミョ", "my", "o"], + ["ミュ", "my", "u"], + ["ミャ", "my", "a"], + ["ミェ", "my", "e"], + ["ミ", "m", "i"], + ["マ", "m", "a"], + ["ポ", "p", "o"], + ["ボ", "b", "o"], + ["ホ", "h", "o"], + ["ペ", "p", "e"], + ["ベ", "b", "e"], + ["ヘ", "h", "e"], + ["プ", "p", "u"], + ["ブ", "b", "u"], + ["フォ", "f", "o"], + ["フェ", "f", "e"], + ["フィ", "f", "i"], + ["ファ", "f", "a"], + ["フ", "f", "u"], + ["ピョ", "py", "o"], + ["ピュ", "py", "u"], + ["ピャ", "py", "a"], + ["ピェ", "py", "e"], + ["ピ", "p", "i"], + ["ビョ", "by", "o"], + ["ビュ", "by", "u"], + ["ビャ", "by", "a"], + ["ビェ", "by", "e"], + ["ビ", "b", "i"], + ["ヒョ", "hy", "o"], + ["ヒュ", "hy", "u"], + ["ヒャ", "hy", "a"], + ["ヒェ", "hy", "e"], + ["ヒ", "h", "i"], + ["パ", "p", "a"], + ["バ", "b", "a"], + ["ハ", "h", "a"], + ["ノ", "n", "o"], + ["ネ", "n", "e"], + ["ヌ", "n", "u"], + ["ニョ", "ny", "o"], + ["ニュ", "ny", "u"], + ["ニャ", "ny", "a"], + ["ニェ", "ny", "e"], + ["ニ", "n", "i"], + ["ナ", "n", "a"], + ["ドゥ", "d", "u"], + ["ド", "d", "o"], + ["トゥ", "t", "u"], + ["ト", "t", "o"], + ["デョ", "dy", "o"], + ["デュ", "dy", "u"], + ["デャ", "dy", "a"], + ["デェ", "dy", "e"], + ["ディ", "d", "i"], + ["デ", "d", "e"], + ["テョ", "ty", "o"], + ["テュ", "ty", "u"], + ["テャ", "ty", "a"], + ["ティ", "t", "i"], + ["テ", "t", "e"], + ["ツォ", "ts", "o"], + ["ツェ", "ts", "e"], + ["ツィ", "ts", "i"], + ["ツァ", "ts", "a"], + ["ツ", "ts", "u"], + ["ッ", "", "cl"], + ["チョ", "ch", "o"], + ["チュ", "ch", "u"], + ["チャ", "ch", "a"], + ["チェ", "ch", "e"], + ["チ", "ch", "i"], + ["ダ", "d", "a"], + ["タ", "t", "a"], + ["ゾ", "z", "o"], + ["ソ", "s", "o"], + ["ゼ", "z", "e"], + ["セ", "s", "e"], + ["ズィ", "z", "i"], + ["ズ", "z", "u"], + ["スィ", "s", "i"], + ["ス", "s", "u"], + ["ジョ", "j", "o"], + ["ジュ", "j", "u"], + ["ジャ", "j", "a"], + ["ジェ", "j", "e"], + ["ジ", "j", "i"], + ["ショ", "sh", "o"], + ["シュ", "sh", "u"], + ["シャ", "sh", "a"], + ["シェ", "sh", "e"], + ["シ", "sh", "i"], + ["ザ", "z", "a"], + ["サ", "s", "a"], + ["ゴ", "g", "o"], + ["コ", "k", "o"], + ["ゲ", "g", "e"], + ["ケ", "k", "e"], + ["グヮ", "gw", "a"], + ["グ", "g", "u"], + ["クヮ", "kw", "a"], + ["ク", "k", "u"], + ["ギョ", "gy", "o"], + ["ギュ", "gy", "u"], + ["ギャ", "gy", "a"], + ["ギェ", "gy", "e"], + ["ギ", "g", "i"], + ["キョ", "ky", "o"], + ["キュ", "ky", "u"], + ["キャ", "ky", "a"], + ["キェ", "ky", "e"], + ["キ", "k", "i"], + ["ガ", "g", "a"], + ["カ", "k", "a"], + ["オ", "", "o"], + ["エ", "", "e"], + ["ウォ", "w", "o"], + ["ウェ", "w", "e"], + ["ウィ", "w", "i"], + ["ウ", "", "u"], + ["イェ", "y", "e"], + ["イ", "", "i"], + ["ア", "", "a"], +] +_mora_list_additional = [ + ["ヴョ", "by", "o"], + ["ヴュ", "by", "u"], + ["ヴャ", "by", "a"], + ["ヲ", "", "o"], + ["ヱ", "", "e"], + ["ヰ", "", "i"], + ["ヮ", "w", "a"], + ["ョ", "y", "o"], + ["ュ", "y", "u"], + ["ヅ", "z", "u"], + ["ヂ", "j", "i"], + ["ヶ", "k", "e"], + ["ャ", "y", "a"], + ["ォ", "", "o"], + ["ェ", "", "e"], + ["ゥ", "", "u"], + ["ィ", "", "i"], + ["ァ", "", "a"], +] + +openjtalk_mora2text = { + consonant + vowel: text for [text, consonant, vowel] in _mora_list_minimum +} +openjtalk_text2mora = { + text: (consonant, vowel) + for [text, consonant, vowel] in _mora_list_minimum + _mora_list_additional +} diff --git a/voicevox_nemo_engine/voicevox_engine/morphing.py b/voicevox_nemo_engine/voicevox_engine/morphing.py new file mode 100644 index 0000000000000000000000000000000000000000..74c82fb7d5812252a68124a3c4bd38b4135d62e9 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/morphing.py @@ -0,0 +1,206 @@ +from copy import deepcopy +from dataclasses import dataclass +from itertools import chain +from typing import Dict, List, Tuple + +import numpy as np +import pyworld as pw +from soxr import resample + +from .metas.Metas import Speaker, SpeakerSupportPermittedSynthesisMorphing, StyleInfo +from .metas.MetasStore import construct_lookup +from .model import AudioQuery, MorphableTargetInfo, StyleIdNotFoundError +from .synthesis_engine import SynthesisEngine + + +# FIXME: ndarray type hint, https://github.com/JeremyCCHsu/Python-Wrapper-for-World-Vocoder/blob/2b64f86197573497c685c785c6e0e743f407b63e/pyworld/pyworld.pyx#L398 # noqa +@dataclass(frozen=True) +class MorphingParameter: + fs: int + frame_period: float + base_f0: np.ndarray + base_aperiodicity: np.ndarray + base_spectrogram: np.ndarray + target_spectrogram: np.ndarray + + +def create_morphing_parameter( + base_wave: np.ndarray, + target_wave: np.ndarray, + fs: int, +) -> MorphingParameter: + frame_period = 1.0 + base_f0, base_time_axis = pw.harvest(base_wave, fs, frame_period=frame_period) + base_spectrogram = pw.cheaptrick(base_wave, base_f0, base_time_axis, fs) + base_aperiodicity = pw.d4c(base_wave, base_f0, base_time_axis, fs) + + target_f0, morph_time_axis = pw.harvest(target_wave, fs, frame_period=frame_period) + target_spectrogram = pw.cheaptrick(target_wave, target_f0, morph_time_axis, fs) + target_spectrogram.resize(base_spectrogram.shape) + + return MorphingParameter( + fs=fs, + frame_period=frame_period, + base_f0=base_f0, + base_aperiodicity=base_aperiodicity, + base_spectrogram=base_spectrogram, + target_spectrogram=target_spectrogram, + ) + + +def get_morphable_targets( + speakers: List[Speaker], + base_speakers: List[int], +) -> List[Dict[int, MorphableTargetInfo]]: + """ + speakers: 全話者の情報 + base_speakers: モーフィング可能か判定したいベースの話者リスト(スタイルID) + """ + speaker_lookup = construct_lookup(speakers) + + morphable_targets_arr = [] + for base_speaker in base_speakers: + morphable_targets = dict() + for style in chain.from_iterable(speaker.styles for speaker in speakers): + morphable_targets[style.id] = MorphableTargetInfo( + is_morphable=is_synthesis_morphing_permitted( + speaker_lookup=speaker_lookup, + base_speaker=base_speaker, + target_speaker=style.id, + ) + ) + morphable_targets_arr.append(morphable_targets) + + return morphable_targets_arr + + +def is_synthesis_morphing_permitted( + speaker_lookup: Dict[int, Tuple[Speaker, StyleInfo]], + base_speaker: int, + target_speaker: int, +) -> bool: + """ + 指定されたstyle_idがモーフィング可能かどうか返す + style_idが見つからない場合はStyleIdNotFoundErrorを送出する + """ + + base_speaker_data = speaker_lookup[base_speaker] + target_speaker_data = speaker_lookup[target_speaker] + + if base_speaker_data is None or target_speaker_data is None: + raise StyleIdNotFoundError( + base_speaker if base_speaker_data is None else target_speaker + ) + + base_speaker_info, _ = base_speaker_data + target_speaker_info, _ = target_speaker_data + + base_speaker_uuid = base_speaker_info.speaker_uuid + target_speaker_uuid = target_speaker_info.speaker_uuid + + base_speaker_morphing_info: SpeakerSupportPermittedSynthesisMorphing = ( + base_speaker_info.supported_features.permitted_synthesis_morphing + ) + + target_speaker_morphing_info: SpeakerSupportPermittedSynthesisMorphing = ( + target_speaker_info.supported_features.permitted_synthesis_morphing + ) + + # 禁止されている場合はFalse + if ( + base_speaker_morphing_info == SpeakerSupportPermittedSynthesisMorphing.NOTHING + or target_speaker_morphing_info + == SpeakerSupportPermittedSynthesisMorphing.NOTHING + ): + return False + # 同一話者のみの場合は同一話者判定 + if ( + base_speaker_morphing_info == SpeakerSupportPermittedSynthesisMorphing.SELF_ONLY + or target_speaker_morphing_info + == SpeakerSupportPermittedSynthesisMorphing.SELF_ONLY + ): + return base_speaker_uuid == target_speaker_uuid + # 念のため許可されているかチェック + return ( + base_speaker_morphing_info == SpeakerSupportPermittedSynthesisMorphing.ALL + and target_speaker_morphing_info == SpeakerSupportPermittedSynthesisMorphing.ALL + ) + + +def synthesis_morphing_parameter( + engine: SynthesisEngine, + query: AudioQuery, + base_speaker: int, + target_speaker: int, +) -> MorphingParameter: + query = deepcopy(query) + + # 不具合回避のためデフォルトのサンプリングレートでWORLDに掛けた後に指定のサンプリングレートに変換する + query.outputSamplingRate = engine.default_sampling_rate + + # WORLDに掛けるため合成はモノラルで行う + query.outputStereo = False + + base_wave = engine.synthesis(query=query, style_id=base_speaker).astype("float") + target_wave = engine.synthesis(query=query, style_id=target_speaker).astype("float") + + return create_morphing_parameter( + base_wave=base_wave, + target_wave=target_wave, + fs=query.outputSamplingRate, + ) + + +def synthesis_morphing( + morph_param: MorphingParameter, + morph_rate: float, + output_fs: int, + output_stereo: bool = False, +) -> np.ndarray: + """ + 指定した割合で、パラメータをもとにモーフィングした音声を生成します。 + + Parameters + ---------- + morph_param : MorphingParameter + `synthesis_morphing_parameter`または`create_morphing_parameter`で作成したパラメータ + + morph_rate : float + モーフィングの割合 + 0.0でベースの話者、1.0でターゲットの話者に近づきます。 + + Returns + ------- + generated : np.ndarray + モーフィングした音声 + + Raises + ------- + ValueError + morph_rate ∈ [0, 1] + """ + + if morph_rate < 0.0 or morph_rate > 1.0: + raise ValueError("morph_rateは0.0から1.0の範囲で指定してください") + + morph_spectrogram = ( + morph_param.base_spectrogram * (1.0 - morph_rate) + + morph_param.target_spectrogram * morph_rate + ) + + y_h = pw.synthesize( + morph_param.base_f0, + morph_spectrogram, + morph_param.base_aperiodicity, + morph_param.fs, + morph_param.frame_period, + ) + + # TODO: synthesis_engine.py でのリサンプル処理と共通化する + if output_fs != morph_param.fs: + y_h = resample(y_h, morph_param.fs, output_fs) + + if output_stereo: + y_h = np.array([y_h, y_h]).T + + return y_h diff --git a/voicevox_nemo_engine/voicevox_engine/part_of_speech_data.py b/voicevox_nemo_engine/voicevox_engine/part_of_speech_data.py new file mode 100644 index 0000000000000000000000000000000000000000..8950e47c8b1cc50f7cdd3f67c857be8baf59c321 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/part_of_speech_data.py @@ -0,0 +1,144 @@ +from typing import Dict + +from .model import ( + USER_DICT_MAX_PRIORITY, + USER_DICT_MIN_PRIORITY, + PartOfSpeechDetail, + WordTypes, +) + +MIN_PRIORITY = USER_DICT_MIN_PRIORITY +MAX_PRIORITY = USER_DICT_MAX_PRIORITY + +part_of_speech_data: Dict[WordTypes, PartOfSpeechDetail] = { + WordTypes.PROPER_NOUN: PartOfSpeechDetail( + part_of_speech="名詞", + part_of_speech_detail_1="固有名詞", + part_of_speech_detail_2="一般", + part_of_speech_detail_3="*", + context_id=1348, + cost_candidates=[ + -988, + 3488, + 4768, + 6048, + 7328, + 8609, + 8734, + 8859, + 8984, + 9110, + 14176, + ], + accent_associative_rules=[ + "*", + "C1", + "C2", + "C3", + "C4", + "C5", + ], + ), + WordTypes.COMMON_NOUN: PartOfSpeechDetail( + part_of_speech="名詞", + part_of_speech_detail_1="一般", + part_of_speech_detail_2="*", + part_of_speech_detail_3="*", + context_id=1345, + cost_candidates=[ + -4445, + 49, + 1473, + 2897, + 4321, + 5746, + 6554, + 7362, + 8170, + 8979, + 15001, + ], + accent_associative_rules=[ + "*", + "C1", + "C2", + "C3", + "C4", + "C5", + ], + ), + WordTypes.VERB: PartOfSpeechDetail( + part_of_speech="動詞", + part_of_speech_detail_1="自立", + part_of_speech_detail_2="*", + part_of_speech_detail_3="*", + context_id=642, + cost_candidates=[ + 3100, + 6160, + 6360, + 6561, + 6761, + 6962, + 7414, + 7866, + 8318, + 8771, + 13433, + ], + accent_associative_rules=[ + "*", + ], + ), + WordTypes.ADJECTIVE: PartOfSpeechDetail( + part_of_speech="形容詞", + part_of_speech_detail_1="自立", + part_of_speech_detail_2="*", + part_of_speech_detail_3="*", + context_id=20, + cost_candidates=[ + 1527, + 3266, + 3561, + 3857, + 4153, + 4449, + 5149, + 5849, + 6549, + 7250, + 10001, + ], + accent_associative_rules=[ + "*", + ], + ), + WordTypes.SUFFIX: PartOfSpeechDetail( + part_of_speech="名詞", + part_of_speech_detail_1="接尾", + part_of_speech_detail_2="一般", + part_of_speech_detail_3="*", + context_id=1358, + cost_candidates=[ + 4399, + 5373, + 6041, + 6710, + 7378, + 8047, + 9440, + 10834, + 12228, + 13622, + 15847, + ], + accent_associative_rules=[ + "*", + "C1", + "C2", + "C3", + "C4", + "C5", + ], + ), +} diff --git a/voicevox_nemo_engine/voicevox_engine/preset/Preset.py b/voicevox_nemo_engine/voicevox_engine/preset/Preset.py new file mode 100644 index 0000000000000000000000000000000000000000..40b03d10c7f3f663c42b8c32fa0db1bf2da0365b --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/preset/Preset.py @@ -0,0 +1,18 @@ +from pydantic import BaseModel, Field + + +class Preset(BaseModel): + """ + プリセット情報 + """ + + id: int = Field(title="プリセットID") + name: str = Field(title="プリセット名") + speaker_uuid: str = Field(title="スピーカーのUUID") + style_id: int = Field(title="スタイルID") + speedScale: float = Field(title="全体の話速") + pitchScale: float = Field(title="全体の音高") + intonationScale: float = Field(title="全体の抑揚") + volumeScale: float = Field(title="全体の音量") + prePhonemeLength: float = Field(title="音声の前の無音時間") + postPhonemeLength: float = Field(title="音声の後の無音時間") diff --git a/voicevox_nemo_engine/voicevox_engine/preset/PresetError.py b/voicevox_nemo_engine/voicevox_engine/preset/PresetError.py new file mode 100644 index 0000000000000000000000000000000000000000..6f5f802f57b03ebcc07f1173f47b9cb384e0fbd1 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/preset/PresetError.py @@ -0,0 +1,2 @@ +class PresetError(Exception): + pass diff --git a/voicevox_nemo_engine/voicevox_engine/preset/PresetManager.py b/voicevox_nemo_engine/voicevox_engine/preset/PresetManager.py new file mode 100644 index 0000000000000000000000000000000000000000..b994eb67790b2ed906a2801d4987ba5debaad3aa --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/preset/PresetManager.py @@ -0,0 +1,188 @@ +from pathlib import Path +from typing import List + +import yaml +from pydantic import ValidationError, parse_obj_as + +from .Preset import Preset +from .PresetError import PresetError + + +class PresetManager: + def __init__( + self, + preset_path: Path, + ): + self.presets = [] + self.last_modified_time = 0 + self.preset_path = preset_path + + def load_presets(self): + """ + プリセットのYAMLファイルを読み込む + + Returns + ------- + ret: List[Preset] + プリセットのリスト + """ + + # 設定ファイルのタイムスタンプを確認 + try: + _last_modified_time = self.preset_path.stat().st_mtime + if _last_modified_time == self.last_modified_time: + return self.presets + except OSError: + raise PresetError("プリセットの設定ファイルが見つかりません") + + with open(self.preset_path, mode="r", encoding="utf-8") as f: + obj = yaml.safe_load(f) + if obj is None: + raise PresetError("プリセットの設定ファイルが空の内容です") + + try: + _presets = parse_obj_as(List[Preset], obj) + except ValidationError: + raise PresetError("プリセットの設定ファイルにミスがあります") + + # idが一意か確認 + if len([preset.id for preset in _presets]) != len( + {preset.id for preset in _presets} + ): + raise PresetError("プリセットのidに重複があります") + + self.presets = _presets + self.last_modified_time = _last_modified_time + return self.presets + + def add_preset(self, preset: Preset): + """ + YAMLファイルに新規のプリセットを追加する + + Parameters + ---------- + preset : Preset + 追加するプリセットを渡す + + Returns + ------- + ret: int + 追加したプリセットのプリセットID + """ + + # 手動でファイルが更新されているかも知れないので、最新のYAMLファイルを読み直す + self.load_presets() + + # IDが0未満、または存在するIDなら新しいIDを決定し、配列に追加 + if preset.id < 0 or preset.id in {preset.id for preset in self.presets}: + preset.id = max([preset.id for preset in self.presets]) + 1 + self.presets.append(preset) + + # ファイルに書き込み + try: + with open(self.preset_path, mode="w", encoding="utf-8") as f: + yaml.safe_dump( + [preset.dict() for preset in self.presets], + f, + allow_unicode=True, + sort_keys=False, + ) + except Exception as err: + self.presets.pop() + if isinstance(err, FileNotFoundError): + raise PresetError("プリセットの設定ファイルに書き込み失敗しました") + else: + raise err + + return preset.id + + def update_preset(self, preset: Preset): + """ + YAMLファイルのプリセットを更新する + + Parameters + ---------- + preset : Preset + 更新するプリセットを渡す + + Returns + ------- + ret: int + 更新したプリセットのプリセットID + """ + + # 手動でファイルが更新されているかも知れないので、最新のYAMLファイルを読み直す + self.load_presets() + + # IDが存在するか探索 + prev_preset = (-1, None) + for i in range(len(self.presets)): + if self.presets[i].id == preset.id: + prev_preset = (i, self.presets[i]) + self.presets[i] = preset + break + else: + raise PresetError("更新先のプリセットが存在しません") + + # ファイルに書き込み + try: + with open(self.preset_path, mode="w", encoding="utf-8") as f: + yaml.safe_dump( + [preset.dict() for preset in self.presets], + f, + allow_unicode=True, + sort_keys=False, + ) + except Exception as err: + if prev_preset != (-1, None): + self.presets[prev_preset[0]] = prev_preset[1] + if isinstance(err, FileNotFoundError): + raise PresetError("プリセットの設定ファイルに書き込み失敗しました") + else: + raise err + + return preset.id + + def delete_preset(self, id: int): + """ + YAMLファイルのプリセットを削除する + + Parameters + ---------- + id: int + 削除するプリセットのプリセットIDを渡す + + Returns + ------- + ret: int + 削除したプリセットのプリセットID + """ + + # 手動でファイルが更新されているかも知れないので、最新のYAMLファイルを読み直す + self.load_presets() + + # IDが存在するか探索 + buf = None + buf_index = -1 + for i in range(len(self.presets)): + if self.presets[i].id == id: + buf = self.presets.pop(i) + buf_index = i + break + else: + raise PresetError("削除対象のプリセットが存在しません") + + # ファイルに書き込み + try: + with open(self.preset_path, mode="w", encoding="utf-8") as f: + yaml.safe_dump( + [preset.dict() for preset in self.presets], + f, + allow_unicode=True, + sort_keys=False, + ) + except FileNotFoundError: + self.presets.insert(buf_index, buf) + raise PresetError("プリセットの設定ファイルに書き込み失敗しました") + + return id diff --git a/voicevox_nemo_engine/voicevox_engine/preset/__init__.py b/voicevox_nemo_engine/voicevox_engine/preset/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8c485e2fbfbcdd660d869ccc36483d6ace6272ec --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/preset/__init__.py @@ -0,0 +1,9 @@ +from .Preset import Preset +from .PresetError import PresetError +from .PresetManager import PresetManager + +__all__ = [ + "Preset", + "PresetManager", + "PresetError", +] diff --git a/voicevox_nemo_engine/voicevox_engine/setting/Setting.py b/voicevox_nemo_engine/voicevox_engine/setting/Setting.py new file mode 100644 index 0000000000000000000000000000000000000000..f8912c6bff9afa959f445d8aa9c89c440b36b8db --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/setting/Setting.py @@ -0,0 +1,25 @@ +from enum import Enum +from typing import Optional + +from pydantic import BaseModel, Field + + +class CorsPolicyMode(str, Enum): + """ + CORSの許可モード + """ + + all = "all" # 全てのオリジンからのリクエストを許可 + localapps = "localapps" # ローカルアプリケーションからのリクエストを許可 + + +class Setting(BaseModel): + """ + エンジンの設定情報 + """ + + cors_policy_mode: CorsPolicyMode = Field(title="リソース共有ポリシー") + allow_origin: Optional[str] = Field(title="許可するオリジン") + + class Config: + use_enum_values = True diff --git a/voicevox_nemo_engine/voicevox_engine/setting/SettingLoader.py b/voicevox_nemo_engine/voicevox_engine/setting/SettingLoader.py new file mode 100644 index 0000000000000000000000000000000000000000..a78952e96835f5bcf2b4fee23d38312dfa2ca573 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/setting/SettingLoader.py @@ -0,0 +1,33 @@ +from pathlib import Path + +import yaml + +from ..utility import engine_root, get_save_dir +from .Setting import Setting + +DEFAULT_SETTING_PATH: Path = engine_root() / "default_setting.yml" +USER_SETTING_PATH: Path = get_save_dir() / "setting.yml" + + +class SettingLoader: + def __init__(self, setting_file_path: Path) -> None: + self.setting_file_path = setting_file_path + + def load_setting_file(self) -> Setting: + if not self.setting_file_path.is_file(): + setting = yaml.safe_load(DEFAULT_SETTING_PATH.read_text(encoding="utf-8")) + else: + setting = yaml.safe_load(self.setting_file_path.read_text(encoding="utf-8")) + + setting = Setting( + cors_policy_mode=setting["cors_policy_mode"], + allow_origin=setting["allow_origin"], + ) + + return setting + + def dump_setting_file(self, settings: Setting) -> None: + settings_dict = settings.dict() + + with open(self.setting_file_path, mode="w", encoding="utf-8") as f: + yaml.safe_dump(settings_dict, f) diff --git a/voicevox_nemo_engine/voicevox_engine/setting/__init__.py b/voicevox_nemo_engine/voicevox_engine/setting/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ff399f92b662072737fe036b7c9832997a76a553 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/setting/__init__.py @@ -0,0 +1,9 @@ +from .Setting import CorsPolicyMode, Setting +from .SettingLoader import USER_SETTING_PATH, SettingLoader + +__all__ = [ + "USER_SETTING_PATH", + "CorsPolicyMode", + "Setting", + "SettingLoader", +] diff --git a/voicevox_nemo_engine/voicevox_engine/synthesis_engine/__init__.py b/voicevox_nemo_engine/voicevox_engine/synthesis_engine/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3e7f6a1ef940f2d20830d98336c34cbbc600d905 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/synthesis_engine/__init__.py @@ -0,0 +1,12 @@ +from .core_wrapper import CoreWrapper, load_runtime_lib +from .make_synthesis_engines import make_synthesis_engines +from .synthesis_engine import SynthesisEngine +from .synthesis_engine_base import SynthesisEngineBase + +__all__ = [ + "CoreWrapper", + "load_runtime_lib", + "make_synthesis_engines", + "SynthesisEngine", + "SynthesisEngineBase", +] diff --git a/voicevox_nemo_engine/voicevox_engine/synthesis_engine/core_wrapper.py b/voicevox_nemo_engine/voicevox_engine/synthesis_engine/core_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..b3852133f399120af344c0ff9170ed9897878aa8 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/synthesis_engine/core_wrapper.py @@ -0,0 +1,538 @@ +import os +import platform +from ctypes import CDLL, POINTER, c_bool, c_char_p, c_float, c_int, c_long +from ctypes.util import find_library +from dataclasses import dataclass +from enum import Enum, auto +from pathlib import Path +from typing import List, Optional + +import numpy as np + + +class OldCoreError(Exception): + """古いコアが使用されている場合に発生するエラー""" + + +class CoreError(Exception): + """コア呼び出しで発生したエラー""" + + +def load_runtime_lib(runtime_dirs: List[Path]): + if platform.system() == "Windows": + # DirectML.dllはonnxruntimeと互換性のないWindows標準搭載のものを優先して読み込むことがあるため、明示的に読み込む + # 参考 1. https://github.com/microsoft/onnxruntime/issues/3360 + # 参考 2. https://tadaoyamaoka.hatenablog.com/entry/2020/06/07/113616 + lib_file_names = [ + "torch_cpu.dll", + "torch_cuda.dll", + "DirectML.dll", + "onnxruntime.dll", + ] + lib_names = ["torch_cpu", "torch_cuda", "onnxruntime"] + elif platform.system() == "Linux": + lib_file_names = ["libtorch.so", "libonnxruntime.so"] + lib_names = ["torch", "onnxruntime"] + elif platform.system() == "Darwin": + lib_file_names = ["libonnxruntime.dylib"] + lib_names = ["onnxruntime"] + else: + raise RuntimeError("不明なOSです") + for lib_path in runtime_dirs: + for file_name in lib_file_names: + try: + CDLL(str((lib_path / file_name).resolve(strict=True))) + except OSError: + pass + for lib_name in lib_names: + try: + CDLL(find_library(lib_name)) + except (OSError, TypeError): + pass + + +class GPUType(Enum): + # NONEはCPUしか対応していないことを示す + NONE = auto() + CUDA = auto() + DIRECT_ML = auto() + + +@dataclass(frozen=True) +class CoreInfo: + name: str + platform: str + arch: str + core_type: str + gpu_type: GPUType + + +# version 0.12 より前のコアの情報 +CORE_INFOS = [ + # Windows + CoreInfo( + name="core.dll", + platform="Windows", + arch="x64", + core_type="libtorch", + gpu_type=GPUType.CUDA, + ), + CoreInfo( + name="core_cpu.dll", + platform="Windows", + arch="x64", + core_type="libtorch", + gpu_type=GPUType.NONE, + ), + CoreInfo( + name="core_gpu_x64_nvidia.dll", + platform="Windows", + arch="x64", + core_type="onnxruntime", + gpu_type=GPUType.CUDA, + ), + CoreInfo( + name="core_gpu_x64_directml.dll", + platform="Windows", + arch="x64", + core_type="onnxruntime", + gpu_type=GPUType.DIRECT_ML, + ), + CoreInfo( + name="core_cpu_x64.dll", + platform="Windows", + arch="x64", + core_type="onnxruntime", + gpu_type=GPUType.NONE, + ), + CoreInfo( + name="core_cpu_x86.dll", + platform="Windows", + arch="x86", + core_type="onnxruntime", + gpu_type=GPUType.NONE, + ), + CoreInfo( + name="core_gpu_x86_directml.dll", + platform="Windows", + arch="x86", + core_type="onnxruntime", + gpu_type=GPUType.DIRECT_ML, + ), + CoreInfo( + name="core_cpu_arm.dll", + platform="Windows", + arch="armv7l", + core_type="onnxruntime", + gpu_type=GPUType.NONE, + ), + CoreInfo( + name="core_gpu_arm_directml.dll", + platform="Windows", + arch="armv7l", + core_type="onnxruntime", + gpu_type=GPUType.DIRECT_ML, + ), + CoreInfo( + name="core_cpu_arm64.dll", + platform="Windows", + arch="aarch64", + core_type="onnxruntime", + gpu_type=GPUType.NONE, + ), + CoreInfo( + name="core_gpu_arm64_directml.dll", + platform="Windows", + arch="aarch64", + core_type="onnxruntime", + gpu_type=GPUType.DIRECT_ML, + ), + # Linux + CoreInfo( + name="libcore.so", + platform="Linux", + arch="x64", + core_type="libtorch", + gpu_type=GPUType.CUDA, + ), + CoreInfo( + name="libcore_cpu.so", + platform="Linux", + arch="x64", + core_type="libtorch", + gpu_type=GPUType.NONE, + ), + CoreInfo( + name="libcore_gpu_x64_nvidia.so", + platform="Linux", + arch="x64", + core_type="onnxruntime", + gpu_type=GPUType.CUDA, + ), + CoreInfo( + name="libcore_cpu_x64.so", + platform="Linux", + arch="x64", + core_type="onnxruntime", + gpu_type=GPUType.NONE, + ), + CoreInfo( + name="libcore_cpu_armhf.so", + platform="Linux", + arch="armv7l", + core_type="onnxruntime", + gpu_type=GPUType.NONE, + ), + CoreInfo( + name="libcore_cpu_arm64.so", + platform="Linux", + arch="aarch64", + core_type="onnxruntime", + gpu_type=GPUType.NONE, + ), + # macOS + CoreInfo( + name="libcore_cpu_universal2.dylib", + platform="Darwin", + arch="universal", + core_type="onnxruntime", + gpu_type=GPUType.NONE, + ), +] + + +# version 0.12 以降のコアの名前の辞書 +# - version 0.12, 0.13 のコアの名前: core +# - version 0.14 からのコアの名前: voicevox_core +CORENAME_DICT = { + "Windows": ("voicevox_core.dll", "core.dll"), + "Linux": ("libvoicevox_core.so", "libcore.so"), + "Darwin": ("libvoicevox_core.dylib", "libcore.dylib"), +} + + +def find_version_0_12_core_or_later(core_dir: Path) -> Optional[str]: + """ + core_dir で指定したディレクトリにあるコアライブラリが Version 0.12 以降である場合、 + 見つかった共有ライブラリの名前を返す。 + + Version 0.12 以降と判定する条件は、 + + - core_dir に metas.json が存在しない + - コアライブラリの名前が CORENAME_DICT の定義に従っている + + の両方が真のときである。 + cf. https://github.com/VOICEVOX/voicevox_engine/issues/385 + """ + if (core_dir / "metas.json").exists(): + return None + + for core_name in CORENAME_DICT[platform.system()]: + if (core_dir / core_name).is_file(): + return core_name + + return None + + +def get_arch_name() -> Optional[str]: + """ + platform.machine() が特定のアーキテクチャ上で複数パターンの文字列を返し得るので、 + 一意な文字列に変換する + サポート外のアーキテクチャである場合、None を返す + """ + machine = platform.machine() + if machine == "x86_64" or machine == "x64" or machine == "AMD64": + return "x64" + elif machine == "i386" or machine == "x86": + return "x86" + elif machine == "arm64": + return "aarch64" + elif machine in ["armv7l", "aarch64"]: + return machine + else: + return None + + +def get_core_name( + arch_name: str, + platform_name: str, + model_type: str, + gpu_type: GPUType, +) -> Optional[str]: + if platform_name == "Darwin": + if gpu_type == GPUType.NONE and (arch_name == "x64" or arch_name == "aarch64"): + arch_name = "universal" + else: + return None + for core_info in CORE_INFOS: + if ( + core_info.platform == platform_name + and core_info.arch == arch_name + and core_info.core_type == model_type + and core_info.gpu_type == gpu_type + ): + return core_info.name + return None + + +def get_suitable_core_name( + model_type: str, + gpu_type: GPUType, +) -> Optional[str]: + arch_name = get_arch_name() + if arch_name is None: + return None + platform_name = platform.system() + return get_core_name(arch_name, platform_name, model_type, gpu_type) + + +def check_core_type(core_dir: Path) -> Optional[str]: + # libtorch版はDirectML未対応なので、ここでは`gpu_type=GPUType.DIRECT_ML`は入れない + libtorch_core_names = [ + get_suitable_core_name("libtorch", gpu_type=GPUType.CUDA), + get_suitable_core_name("libtorch", gpu_type=GPUType.NONE), + ] + onnxruntime_core_names = [ + get_suitable_core_name("onnxruntime", gpu_type=GPUType.CUDA), + get_suitable_core_name("onnxruntime", gpu_type=GPUType.DIRECT_ML), + get_suitable_core_name("onnxruntime", gpu_type=GPUType.NONE), + ] + if any([(core_dir / name).is_file() for name in libtorch_core_names if name]): + return "libtorch" + elif any([(core_dir / name).is_file() for name in onnxruntime_core_names if name]): + return "onnxruntime" + else: + return None + + +def load_core(core_dir: Path, use_gpu: bool) -> CDLL: + core_name = find_version_0_12_core_or_later(core_dir) + if core_name: + try: + # NOTE: CDLL クラスのコンストラクタの引数 name には文字列を渡す必要がある。 + # Windows 環境では PathLike オブジェクトを引数として渡すと初期化に失敗する。 + return CDLL(str((core_dir / core_name).resolve(strict=True))) + except OSError as err: + raise RuntimeError(f"コアの読み込みに失敗しました:{err}") + + model_type = check_core_type(core_dir) + if model_type is None: + raise RuntimeError("コアが見つかりません") + if use_gpu or model_type == "onnxruntime": + core_name = get_suitable_core_name(model_type, gpu_type=GPUType.CUDA) + if core_name: + try: + return CDLL(str((core_dir / core_name).resolve(strict=True))) + except OSError: + pass + core_name = get_suitable_core_name(model_type, gpu_type=GPUType.DIRECT_ML) + if core_name: + try: + return CDLL(str((core_dir / core_name).resolve(strict=True))) + except OSError: + pass + core_name = get_suitable_core_name(model_type, gpu_type=GPUType.NONE) + if core_name: + try: + return CDLL(str((core_dir / core_name).resolve(strict=True))) + except OSError as err: + if model_type == "libtorch": + core_name = get_suitable_core_name(model_type, gpu_type=GPUType.CUDA) + if core_name: + try: + return CDLL(str((core_dir / core_name).resolve(strict=True))) + except OSError as err_: + err = err_ + raise RuntimeError(f"コアの読み込みに失敗しました:{err}") + else: + raise RuntimeError(f"このコンピュータのアーキテクチャ {platform.machine()} で利用可能なコアがありません") + + +class CoreWrapper: + def __init__( + self, + use_gpu: bool, + core_dir: Path, + cpu_num_threads: int = 0, + load_all_models: bool = False, + ) -> None: + + self.core = load_core(core_dir, use_gpu) + + self.core.initialize.restype = c_bool + self.core.metas.restype = c_char_p + self.core.yukarin_s_forward.restype = c_bool + self.core.yukarin_sa_forward.restype = c_bool + self.core.decode_forward.restype = c_bool + self.core.last_error_message.restype = c_char_p + + self.exist_supported_devices = False + self.exist_finalize = False + exist_cpu_num_threads = False + self.exist_load_model = False + self.exist_is_model_loaded = False + + is_version_0_12_core_or_later = ( + find_version_0_12_core_or_later(core_dir) is not None + ) + if is_version_0_12_core_or_later: + model_type = "onnxruntime" + self.exist_load_model = True + self.exist_is_model_loaded = True + self.core.load_model.argtypes = (c_long,) + self.core.load_model.restype = c_bool + self.core.is_model_loaded.argtypes = (c_long,) + self.core.is_model_loaded.restype = c_bool + else: + model_type = check_core_type(core_dir) + assert model_type is not None + + if model_type == "onnxruntime": + self.core.supported_devices.restype = c_char_p + self.core.finalize.restype = None + self.exist_supported_devices = True + self.exist_finalize = True + exist_cpu_num_threads = True + + self.core.yukarin_s_forward.argtypes = ( + c_int, + POINTER(c_long), + POINTER(c_long), + POINTER(c_float), + ) + self.core.yukarin_sa_forward.argtypes = ( + c_int, + POINTER(c_long), + POINTER(c_long), + POINTER(c_long), + POINTER(c_long), + POINTER(c_long), + POINTER(c_long), + POINTER(c_long), + POINTER(c_float), + ) + self.core.decode_forward.argtypes = ( + c_int, + c_int, + POINTER(c_float), + POINTER(c_float), + POINTER(c_long), + POINTER(c_float), + ) + + cwd = os.getcwd() + os.chdir(core_dir) + try: + if is_version_0_12_core_or_later: + self.assert_core_success( + self.core.initialize(use_gpu, cpu_num_threads, load_all_models) + ) + elif exist_cpu_num_threads: + self.assert_core_success( + self.core.initialize(".", use_gpu, cpu_num_threads) + ) + else: + self.assert_core_success(self.core.initialize(".", use_gpu)) + finally: + os.chdir(cwd) + + def metas(self) -> str: + return self.core.metas().decode("utf-8") + + def yukarin_s_forward( + self, + length: int, + phoneme_list: np.ndarray, + style_id: np.ndarray, + ) -> np.ndarray: + output = np.zeros((length,), dtype=np.float32) + self.assert_core_success( + self.core.yukarin_s_forward( + c_int(length), + phoneme_list.ctypes.data_as(POINTER(c_long)), + style_id.ctypes.data_as(POINTER(c_long)), + output.ctypes.data_as(POINTER(c_float)), + ) + ) + return output + + def yukarin_sa_forward( + self, + length: int, + vowel_phoneme_list: np.ndarray, + consonant_phoneme_list: np.ndarray, + start_accent_list: np.ndarray, + end_accent_list: np.ndarray, + start_accent_phrase_list: np.ndarray, + end_accent_phrase_list: np.ndarray, + style_id: np.ndarray, + ) -> np.ndarray: + output = np.empty( + ( + len(style_id), + length, + ), + dtype=np.float32, + ) + self.assert_core_success( + self.core.yukarin_sa_forward( + c_int(length), + vowel_phoneme_list.ctypes.data_as(POINTER(c_long)), + consonant_phoneme_list.ctypes.data_as(POINTER(c_long)), + start_accent_list.ctypes.data_as(POINTER(c_long)), + end_accent_list.ctypes.data_as(POINTER(c_long)), + start_accent_phrase_list.ctypes.data_as(POINTER(c_long)), + end_accent_phrase_list.ctypes.data_as(POINTER(c_long)), + style_id.ctypes.data_as(POINTER(c_long)), + output.ctypes.data_as(POINTER(c_float)), + ) + ) + return output + + def decode_forward( + self, + length: int, + phoneme_size: int, + f0: np.ndarray, + phoneme: np.ndarray, + style_id: np.ndarray, + ) -> np.ndarray: + output = np.empty((length * 256,), dtype=np.float32) + self.assert_core_success( + self.core.decode_forward( + c_int(length), + c_int(phoneme_size), + f0.ctypes.data_as(POINTER(c_float)), + phoneme.ctypes.data_as(POINTER(c_float)), + style_id.ctypes.data_as(POINTER(c_long)), + output.ctypes.data_as(POINTER(c_float)), + ) + ) + return output + + def supported_devices(self) -> str: + if self.exist_supported_devices: + return self.core.supported_devices().decode("utf-8") + raise OldCoreError + + def finalize(self) -> None: + if self.exist_finalize: + self.core.finalize() + return + raise OldCoreError + + def load_model(self, style_id: int) -> None: + if self.exist_load_model: + self.assert_core_success(self.core.load_model(c_long(style_id))) + raise OldCoreError + + def is_model_loaded(self, style_id: int) -> bool: + if self.exist_is_model_loaded: + return self.core.is_model_loaded(c_long(style_id)) + raise OldCoreError + + def assert_core_success(self, result: bool) -> None: + if not result: + raise CoreError( + self.core.last_error_message().decode("utf-8", "backslashreplace") + ) diff --git a/voicevox_nemo_engine/voicevox_engine/synthesis_engine/make_synthesis_engines.py b/voicevox_nemo_engine/voicevox_engine/synthesis_engine/make_synthesis_engines.py new file mode 100644 index 0000000000000000000000000000000000000000..848a601af52f99c7fa9c5db5d1d696bd690587d9 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/synthesis_engine/make_synthesis_engines.py @@ -0,0 +1,124 @@ +import json +import sys +from pathlib import Path +from typing import Dict, List, Optional + +from ..utility import engine_root, get_save_dir +from .core_wrapper import CoreWrapper, load_runtime_lib +from .synthesis_engine import SynthesisEngine, SynthesisEngineBase + + +def make_synthesis_engines( + use_gpu: bool, + voicelib_dirs: Optional[List[Path]] = None, + voicevox_dir: Optional[Path] = None, + runtime_dirs: Optional[List[Path]] = None, + cpu_num_threads: Optional[int] = None, + enable_mock: bool = True, + load_all_models: bool = False, +) -> Dict[str, SynthesisEngineBase]: + """ + 音声ライブラリをロードして、音声合成エンジンを生成 + + Parameters + ---------- + use_gpu: bool + 音声ライブラリに GPU を使わせるか否か + voicelib_dirs: List[Path], optional, default=None + 音声ライブラリ自体があるディレクトリのリスト + voicevox_dir: Path, optional, default=None + コンパイル済みのvoicevox、またはvoicevox_engineがあるディレクトリ + runtime_dirs: List[Path], optional, default=None + コアで使用するライブラリのあるディレクトリのリスト + None のとき、voicevox_dir、カレントディレクトリになる + cpu_num_threads: int, optional, default=None + 音声ライブラリが、推論に用いるCPUスレッド数を設定する + Noneのとき、ライブラリ側の挙動により論理コア数の半分か、物理コア数が指定される + enable_mock: bool, optional, default=True + コア読み込みに失敗したとき、代わりにmockを使用するかどうか + load_all_models: bool, optional, default=False + 起動時に全てのモデルを読み込むかどうか + """ + if cpu_num_threads == 0 or cpu_num_threads is None: + print( + "Warning: cpu_num_threads is set to 0. " + + "( The library leaves the decision to the synthesis runtime )", + file=sys.stderr, + ) + cpu_num_threads = 0 + + if voicevox_dir is not None: + if voicelib_dirs is not None: + voicelib_dirs.append(voicevox_dir) + else: + voicelib_dirs = [voicevox_dir] + if runtime_dirs is not None: + runtime_dirs.append(voicevox_dir) + else: + runtime_dirs = [voicevox_dir] + else: + root_dir = engine_root() + if voicelib_dirs is None: + voicelib_dirs = [root_dir] + if runtime_dirs is None: + runtime_dirs = [root_dir] + + voicelib_dirs = [p.expanduser() for p in voicelib_dirs] + runtime_dirs = [p.expanduser() for p in runtime_dirs] + + load_runtime_lib(runtime_dirs) + + synthesis_engines = {} + + if not enable_mock: + + def load_core_library(core_dir: Path, suppress_error: bool = False): + """ + 指定されたディレクトリにあるコアを読み込む。 + ユーザーディレクトリの場合は存在しないこともあるので、エラーを抑制すると良い。 + """ + try: + core = CoreWrapper(use_gpu, core_dir, cpu_num_threads, load_all_models) + metas = json.loads(core.metas()) + core_version = metas[0]["version"] + print(f"Info: Loading core {core_version}.") + if core_version in synthesis_engines: + print( + "Warning: Core loading is skipped because of version duplication.", + file=sys.stderr, + ) + else: + synthesis_engines[core_version] = SynthesisEngine(core=core) + except Exception: + if not suppress_error: + raise + + for core_dir in voicelib_dirs: + load_core_library(core_dir) + + # ユーザーディレクトリにあるコアを読み込む + user_voicelib_dirs = [] + core_libraries_dir = get_save_dir() / "core_libraries" + core_libraries_dir.mkdir(exist_ok=True) + user_voicelib_dirs.append(core_libraries_dir) + for path in core_libraries_dir.glob("*"): + if not path.is_dir(): + continue + user_voicelib_dirs.append(path) + + for core_dir in user_voicelib_dirs: + load_core_library(core_dir, suppress_error=True) + + else: + # モック追加 + from ..dev.core import metas as mock_metas + from ..dev.core import supported_devices as mock_supported_devices + from ..dev.synthesis_engine import MockSynthesisEngine + + if "0.0.0" not in synthesis_engines: + print("Info: Loading mock.") + synthesis_engines["0.0.0"] = MockSynthesisEngine( + speakers=mock_metas(), supported_devices=mock_supported_devices() + ) + + return synthesis_engines diff --git a/voicevox_nemo_engine/voicevox_engine/synthesis_engine/synthesis_engine.py b/voicevox_nemo_engine/voicevox_engine/synthesis_engine/synthesis_engine.py new file mode 100644 index 0000000000000000000000000000000000000000..81cad3d44a24b8f794f5dc00254d325b7d7218fa --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/synthesis_engine/synthesis_engine.py @@ -0,0 +1,503 @@ +import threading +from itertools import chain +from typing import List, Optional, Tuple + +import numpy +from soxr import resample + +from ..acoustic_feature_extractor import OjtPhoneme +from ..model import AccentPhrase, AudioQuery, Mora +from .core_wrapper import CoreWrapper, OldCoreError +from .synthesis_engine_base import SynthesisEngineBase + +unvoiced_mora_phoneme_list = ["A", "I", "U", "E", "O", "cl", "pau"] +mora_phoneme_list = ["a", "i", "u", "e", "o", "N"] + unvoiced_mora_phoneme_list + + +# TODO: move mora utility to mora module +def to_flatten_moras(accent_phrases: List[AccentPhrase]) -> List[Mora]: + """ + accent_phrasesに含まれるMora(とpause_moraがあればそれも)を + すべて一つのリストに結合する + Parameters + ---------- + accent_phrases : List[AccentPhrase] + AccentPhraseのリスト + Returns + ------- + moras : List[Mora] + 結合されたMoraのリストを返す + """ + return list( + chain.from_iterable( + accent_phrase.moras + + ( + [accent_phrase.pause_mora] + if accent_phrase.pause_mora is not None + else [] + ) + for accent_phrase in accent_phrases + ) + ) + + +def to_phoneme_data_list(phoneme_str_list: List[str]): + """ + phoneme文字列のリストを、OjtPhonemeクラスのリストに変換する + Parameters + ---------- + phoneme_str_list : List[str] + phoneme文字列のリスト + Returns + ------- + phoneme_list : List[OjtPhoneme] + 変換されたOjtPhonemeクラスのリスト + """ + phoneme_data_list = [ + OjtPhoneme(phoneme=p, start=i, end=i + 1) + for i, p in enumerate(phoneme_str_list) + ] + phoneme_data_list = OjtPhoneme.convert(phoneme_data_list) + return phoneme_data_list + + +def split_mora(phoneme_list: List[OjtPhoneme]): + """ + OjtPhonemeのリストから、 + 母音の位置(vowel_indexes) + 母音の音素列(vowel_phoneme_list) + 子音の音素列(consonant_phoneme_list) + を生成し、返す + Parameters + ---------- + phoneme_list : List[OjtPhoneme] + phonemeクラスのリスト + Returns + ------- + consonant_phoneme_list : List[OjtPhoneme] + 子音の音素列 + vowel_phoneme_list : List[OjtPhoneme] + 母音の音素列 + vowel_indexes : : List[int] + 母音の位置 + """ + vowel_indexes = [ + i for i, p in enumerate(phoneme_list) if p.phoneme in mora_phoneme_list + ] + vowel_phoneme_list = [phoneme_list[i] for i in vowel_indexes] + # postとprevのvowel_indexの差として考えられる値は1か2 + # 理由としてはphoneme_listは、consonant、vowelの組み合わせか、vowel一つの連続であるから + # 1の場合はconsonant(子音)が存在しない=母音のみ(a/i/u/e/o/N/cl/pau)で構成されるモーラ(音)である + # 2の場合はconsonantが存在するモーラである + # なので、2の場合(else)でphonemeを取り出している + consonant_phoneme_list: List[Optional[OjtPhoneme]] = [None] + [ + None if post - prev == 1 else phoneme_list[post - 1] + for prev, post in zip(vowel_indexes[:-1], vowel_indexes[1:]) + ] + return consonant_phoneme_list, vowel_phoneme_list, vowel_indexes + + +def pre_process( + accent_phrases: List[AccentPhrase], +) -> Tuple[List[Mora], List[OjtPhoneme]]: + """ + AccentPhraseモデルのリストを整形し、処理に必要なデータの原型を作り出す + Parameters + ---------- + accent_phrases : List[AccentPhrase] + AccentPhraseモデルのリスト + Returns + ------- + flatten_moras : List[Mora] + AccentPhraseモデルのリスト内に含まれるすべてのMoraをリスト化したものを返す + phoneme_data_list : List[OjtPhoneme] + flatten_morasから取り出したすべてのPhonemeをOjtPhonemeに変換したものを返す + """ + flatten_moras = to_flatten_moras(accent_phrases) + + phoneme_each_mora = [ + ([mora.consonant] if mora.consonant is not None else []) + [mora.vowel] + for mora in flatten_moras + ] + phoneme_str_list = list(chain.from_iterable(phoneme_each_mora)) + phoneme_str_list = ["pau"] + phoneme_str_list + ["pau"] + + phoneme_data_list = to_phoneme_data_list(phoneme_str_list) + + return flatten_moras, phoneme_data_list + + +class SynthesisEngine(SynthesisEngineBase): + def __init__( + self, + core: CoreWrapper, + ): + """ + core.yukarin_s_forward: 音素列から、音素ごとの長さを求める関数 + length: 音素列の長さ + phoneme_list: 音素列 + style_id: スタイル番号 + return: 音素ごとの長さ + + core.yukarin_sa_forward: モーラごとの音素列とアクセント情報から、モーラごとの音高を求める関数 + length: モーラ列の長さ + vowel_phoneme_list: 母音の音素列 + consonant_phoneme_list: 子音の音素列 + start_accent_list: アクセントの開始位置 + end_accent_list: アクセントの終了位置 + start_accent_phrase_list: アクセント句の開始位置 + end_accent_phrase_list: アクセント句の終了位置 + style_id: スタイル番号 + return: モーラごとの音高 + + core.decode_forward: フレームごとの音素と音高から波形を求める関数 + length: フレームの長さ + phoneme_size: 音素の種類数 + f0: フレームごとの音高 + phoneme: フレームごとの音素 + style_id: スタイル番号 + return: 音声波形 + + speakers: coreから取得したspeakersに関するjsonデータの文字列 + + supported_devices: + coreから取得した対応デバイスに関するjsonデータの文字列 + Noneの場合はコアが情報の取得に対応していないため、対応デバイスは不明 + """ + super().__init__() + self.core = core + self._speakers = self.core.metas() + self.mutex = threading.Lock() + try: + self._supported_devices = self.core.supported_devices() + except OldCoreError: + self._supported_devices = None + self.default_sampling_rate = 24000 + + @property + def speakers(self) -> str: + return self._speakers + + @property + def supported_devices(self) -> Optional[str]: + return self._supported_devices + + def initialize_style_id_synthesis(self, style_id: int, skip_reinit: bool): + try: + with self.mutex: + # 以下の条件のいずれかを満たす場合, 初期化を実行する + # 1. 引数 skip_reinit が False の場合 + # 2. 話者が初期化されていない場合 + if (not skip_reinit) or (not self.core.is_model_loaded(style_id)): + self.core.load_model(style_id) + except OldCoreError: + pass # コアが古い場合はどうしようもないので何もしない + + def is_initialized_style_id_synthesis(self, style_id: int) -> bool: + try: + return self.core.is_model_loaded(style_id) + except OldCoreError: + return True # コアが古い場合はどうしようもないのでTrueを返す + + def replace_phoneme_length( + self, accent_phrases: List[AccentPhrase], style_id: int + ) -> List[AccentPhrase]: + """ + accent_phrasesの母音・子音の長さを設定する + Parameters + ---------- + accent_phrases : List[AccentPhrase] + アクセント句モデルのリスト + style_id : int + スタイルID + Returns + ------- + accent_phrases : List[AccentPhrase] + 母音・子音の長さが設定されたアクセント句モデルのリスト + """ + # モデルがロードされていない場合はロードする + self.initialize_style_id_synthesis(style_id, skip_reinit=True) + # phoneme + # AccentPhraseをすべてMoraおよびOjtPhonemeの形に分解し、処理可能な形にする + flatten_moras, phoneme_data_list = pre_process(accent_phrases) + # OjtPhonemeの形に分解されたもの(phoneme_data_list)から、vowel(母音)の位置を抜き出す + _, _, vowel_indexes_data = split_mora(phoneme_data_list) + + # yukarin_s + # OjtPhonemeのリストからOjtPhonemeのPhoneme ID(OpenJTalkにおける音素のID)のリストを作る + phoneme_list_s = numpy.array( + [p.phoneme_id for p in phoneme_data_list], dtype=numpy.int64 + ) + # Phoneme IDのリスト(phoneme_list_s)をyukarin_s_forwardにかけ、推論器によって適切な音素の長さを割り当てる + with self.mutex: + phoneme_length = self.core.yukarin_s_forward( + length=len(phoneme_list_s), + phoneme_list=phoneme_list_s, + style_id=numpy.array(style_id, dtype=numpy.int64).reshape(-1), + ) + + # yukarin_s_forwarderの結果をaccent_phrasesに反映する + # flatten_moras変数に展開された値を変更することでコード量を削減しつつaccent_phrases内のデータを書き換えている + for i, mora in enumerate(flatten_moras): + mora.consonant_length = ( + phoneme_length[vowel_indexes_data[i + 1] - 1] + if mora.consonant is not None + else None + ) + mora.vowel_length = phoneme_length[vowel_indexes_data[i + 1]] + + return accent_phrases + + def replace_mora_pitch( + self, accent_phrases: List[AccentPhrase], style_id: int + ) -> List[AccentPhrase]: + """ + accent_phrasesの音高(ピッチ)を設定する + Parameters + ---------- + accent_phrases : List[AccentPhrase] + アクセント句モデルのリスト + style_id : int + スタイルID + Returns + ------- + accent_phrases : List[AccentPhrase] + 音高(ピッチ)が設定されたアクセント句モデルのリスト + """ + # モデルがロードされていない場合はロードする + self.initialize_style_id_synthesis(style_id, skip_reinit=True) + # numpy.concatenateが空リストだとエラーを返すのでチェック + if len(accent_phrases) == 0: + return [] + + # phoneme + # AccentPhraseをすべてMoraおよびOjtPhonemeの形に分解し、処理可能な形にする + flatten_moras, phoneme_data_list = pre_process(accent_phrases) + + # accent + def _create_one_hot(accent_phrase: AccentPhrase, position: int): + """ + 単位行列(numpy.eye)を応用し、accent_phrase内でone hotな配列(リスト)を作る + 例えば、accent_phraseのmorasの長さが12、positionが1なら + [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + morasの長さが同じく12、positionが-1なら + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] + のような配列を生成する + accent_phraseがpause_moraを含む場合はさらに後ろに0が足される + Parameters + ---------- + accent_phrase : AccentPhrase + アクセント句モデル + position : int + one hotにするindex + Returns + ------- + one_hot : numpy.ndarray + one hotな配列(リスト) + """ + return numpy.r_[ + numpy.eye(len(accent_phrase.moras))[position], + (0 if accent_phrase.pause_mora is not None else []), + ] + + # accent_phrasesから、アクセントの開始位置のリストを作る + start_accent_list = numpy.concatenate( + [ + # accentはプログラミング言語におけるindexのように0始まりではなく1始まりなので、 + # accentが1の場合は0番目を指定している + # accentが1ではない場合、accentはend_accent_listに用いられる + _create_one_hot(accent_phrase, 0 if accent_phrase.accent == 1 else 1) + for accent_phrase in accent_phrases + ] + ) + + # accent_phrasesから、アクセントの終了位置のリストを作る + end_accent_list = numpy.concatenate( + [ + # accentはプログラミング言語におけるindexのように0始まりではなく1始まりなので、1を引いている + _create_one_hot(accent_phrase, accent_phrase.accent - 1) + for accent_phrase in accent_phrases + ] + ) + + # accent_phrasesから、アクセント句の開始位置のリストを作る + # これによって、yukarin_sa_forwarder内でアクセント句を区別できる + start_accent_phrase_list = numpy.concatenate( + [_create_one_hot(accent_phrase, 0) for accent_phrase in accent_phrases] + ) + + # accent_phrasesから、アクセント句の終了位置のリストを作る + end_accent_phrase_list = numpy.concatenate( + [_create_one_hot(accent_phrase, -1) for accent_phrase in accent_phrases] + ) + + # 最初と最後に0を付け加える。これによってpau(前後の無音のためのもの)を付け加えたことになる + start_accent_list = numpy.r_[0, start_accent_list, 0] + end_accent_list = numpy.r_[0, end_accent_list, 0] + start_accent_phrase_list = numpy.r_[0, start_accent_phrase_list, 0] + end_accent_phrase_list = numpy.r_[0, end_accent_phrase_list, 0] + + # アクセント・アクセント句関連のデータをyukarin_sa_forwarderに渡すための最終処理、リスト内のデータをint64に変換する + start_accent_list = numpy.array(start_accent_list, dtype=numpy.int64) + end_accent_list = numpy.array(end_accent_list, dtype=numpy.int64) + start_accent_phrase_list = numpy.array( + start_accent_phrase_list, dtype=numpy.int64 + ) + end_accent_phrase_list = numpy.array(end_accent_phrase_list, dtype=numpy.int64) + + # phonemeに関するデータを取得(変換)する + ( + consonant_phoneme_data_list, + vowel_phoneme_data_list, + _, + ) = split_mora(phoneme_data_list) + + # yukarin_sa + # Phoneme関連のデータをyukarin_sa_forwarderに渡すための最終処理、リスト内のデータをint64に変換する + vowel_phoneme_list = numpy.array( + [p.phoneme_id for p in vowel_phoneme_data_list], dtype=numpy.int64 + ) + consonant_phoneme_list = numpy.array( + [ + p.phoneme_id if p is not None else -1 + for p in consonant_phoneme_data_list + ], + dtype=numpy.int64, + ) + + # 今までに生成された情報をyukarin_sa_forwardにかけ、推論器によってモーラごとに適切な音高(ピッチ)を割り当てる + with self.mutex: + f0_list = self.core.yukarin_sa_forward( + length=vowel_phoneme_list.shape[0], + vowel_phoneme_list=vowel_phoneme_list[numpy.newaxis], + consonant_phoneme_list=consonant_phoneme_list[numpy.newaxis], + start_accent_list=start_accent_list[numpy.newaxis], + end_accent_list=end_accent_list[numpy.newaxis], + start_accent_phrase_list=start_accent_phrase_list[numpy.newaxis], + end_accent_phrase_list=end_accent_phrase_list[numpy.newaxis], + style_id=numpy.array(style_id, dtype=numpy.int64).reshape(-1), + )[0] + + # 無声母音を含むMoraに関しては、音高(ピッチ)を0にする + for i, p in enumerate(vowel_phoneme_data_list): + if p.phoneme in unvoiced_mora_phoneme_list: + f0_list[i] = 0 + + # yukarin_sa_forwarderの結果をaccent_phrasesに反映する + # flatten_moras変数に展開された値を変更することでコード量を削減しつつaccent_phrases内のデータを書き換えている + for i, mora in enumerate(flatten_moras): + mora.pitch = f0_list[i + 1] + + return accent_phrases + + def _synthesis_impl(self, query: AudioQuery, style_id: int): + """ + 音声合成クエリから音声合成に必要な情報を構成し、実際に音声合成を行う + Parameters + ---------- + query : AudioQuery + 音声合成クエリ + style_id : int + スタイルID + Returns + ------- + wave : numpy.ndarray + 音声合成結果 + """ + # モデルがロードされていない場合はロードする + self.initialize_style_id_synthesis(style_id, skip_reinit=True) + # phoneme + # AccentPhraseをすべてMoraおよびOjtPhonemeの形に分解し、処理可能な形にする + flatten_moras, phoneme_data_list = pre_process(query.accent_phrases) + + # OjtPhonemeのリストからOjtPhonemeのPhoneme ID(OpenJTalkにおける音素のID)のリストを作る + phoneme_list_s = numpy.array( + [p.phoneme_id for p in phoneme_data_list], dtype=numpy.int64 + ) + + # length + # 音素の長さをリストに展開・結合する。ここには前後の無音時間も含まれる + phoneme_length_list = ( + [query.prePhonemeLength] + + [ + length + for mora in flatten_moras + for length in ( + [mora.consonant_length] if mora.consonant is not None else [] + ) + + [mora.vowel_length] + ] + + [query.postPhonemeLength] + ) + # floatにキャスト + phoneme_length = numpy.array(phoneme_length_list, dtype=numpy.float32) + + # lengthにSpeed Scale(話速)を適用する + phoneme_length /= query.speedScale + + # pitch + # モーラの音高(ピッチ)を展開・結合し、floatにキャストする + f0_list = [0] + [mora.pitch for mora in flatten_moras] + [0] + f0 = numpy.array(f0_list, dtype=numpy.float32) + # 音高(ピッチ)の調節を適用する(2のPitch Scale乗を掛ける) + f0 *= 2**query.pitchScale + + # 有声音素(音高(ピッチ)が0より大きいもの)か否かを抽出する + voiced = f0 > 0 + # 有声音素の音高(ピッチ)の平均値を求める + mean_f0 = f0[voiced].mean() + # 平均値がNaNではないとき、抑揚を適用する + # 抑揚は音高と音高の平均値の差に抑揚を掛けたもの((f0 - mean_f0) * Intonation Scale)に抑揚の平均値(mean_f0)を足したもの + if not numpy.isnan(mean_f0): + f0[voiced] = (f0[voiced] - mean_f0) * query.intonationScale + mean_f0 + + # OjtPhonemeの形に分解された音素リストから、vowel(母音)の位置を抜き出し、numpyのarrayにする + _, _, vowel_indexes_data = split_mora(phoneme_data_list) + vowel_indexes = numpy.array(vowel_indexes_data) + + # forward decode + # 音素の長さにrateを掛け、intにキャストする + rate = 24000 / 256 + phoneme_bin_num = numpy.round(phoneme_length * rate).astype(numpy.int32) + + # Phoneme IDを音素の長さ分繰り返す + phoneme = numpy.repeat(phoneme_list_s, phoneme_bin_num) + # f0を母音と子音の長さの合計分繰り返す + f0 = numpy.repeat( + f0, + [a.sum() for a in numpy.split(phoneme_bin_num, vowel_indexes[:-1] + 1)], + ) + + # phonemeの長さとOjtPhonemeのnum_phoneme(45)分の0で初期化された2次元配列を用意する + array = numpy.zeros((len(phoneme), OjtPhoneme.num_phoneme), dtype=numpy.float32) + # 初期化された2次元配列の各行をone hotにする + array[numpy.arange(len(phoneme)), phoneme] = 1 + phoneme = array + + # 今まで生成された情報をdecode_forwardにかけ、推論器によって音声波形を生成する + with self.mutex: + wave = self.core.decode_forward( + length=phoneme.shape[0], + phoneme_size=phoneme.shape[1], + f0=f0[:, numpy.newaxis], + phoneme=phoneme, + style_id=numpy.array(style_id, dtype=numpy.int64).reshape(-1), + ) + + # volume: ゲイン適用 + wave *= query.volumeScale + + # 出力サンプリングレートがデフォルト(decode forwarderによるもの、24kHz)でなければ、それを適用する + if query.outputSamplingRate != self.default_sampling_rate: + wave = resample( + wave, + self.default_sampling_rate, + query.outputSamplingRate, + ) + + # ステレオ変換 + # 出力設定がステレオなのであれば、ステレオ化する + if query.outputStereo: + wave = numpy.array([wave, wave]).T + + return wave diff --git a/voicevox_nemo_engine/voicevox_engine/synthesis_engine/synthesis_engine_base.py b/voicevox_nemo_engine/voicevox_engine/synthesis_engine/synthesis_engine_base.py new file mode 100644 index 0000000000000000000000000000000000000000..f6f798a7c06015fb46b53324d3e8ea5e5ca33b0c --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/synthesis_engine/synthesis_engine_base.py @@ -0,0 +1,266 @@ +import copy +from abc import ABCMeta, abstractmethod +from typing import List, Optional + +import numpy as np + +from .. import full_context_label +from ..full_context_label import extract_full_context_label +from ..model import AccentPhrase, AudioQuery, Mora +from ..mora_list import openjtalk_mora2text + + +def mora_to_text(mora: str) -> str: + if mora[-1:] in ["A", "I", "U", "E", "O"]: + # 無声化母音を小文字に + mora = mora[:-1] + mora[-1].lower() + if mora in openjtalk_mora2text: + return openjtalk_mora2text[mora] + else: + return mora + + +def adjust_interrogative_accent_phrases( + accent_phrases: List[AccentPhrase], +) -> List[AccentPhrase]: + """ + enable_interrogative_upspeakが有効になっていて与えられたaccent_phrasesに疑問系のものがあった場合、 + 各accent_phraseの末尾にある疑問系発音用のMoraに対して直前のMoraより少し音を高くすることで疑問文ぽくする + NOTE: リファクタリング時に適切な場所へ移動させること + """ + return [ + AccentPhrase( + moras=adjust_interrogative_moras(accent_phrase), + accent=accent_phrase.accent, + pause_mora=accent_phrase.pause_mora, + is_interrogative=accent_phrase.is_interrogative, + ) + for accent_phrase in accent_phrases + ] + + +def adjust_interrogative_moras(accent_phrase: AccentPhrase) -> List[Mora]: + moras = copy.deepcopy(accent_phrase.moras) + if accent_phrase.is_interrogative and not (len(moras) == 0 or moras[-1].pitch == 0): + interrogative_mora = make_interrogative_mora(moras[-1]) + moras.append(interrogative_mora) + return moras + else: + return moras + + +def make_interrogative_mora(last_mora: Mora) -> Mora: + fix_vowel_length = 0.15 + adjust_pitch = 0.3 + max_pitch = 6.5 + return Mora( + text=openjtalk_mora2text[last_mora.vowel], + consonant=None, + consonant_length=None, + vowel=last_mora.vowel, + vowel_length=fix_vowel_length, + pitch=min(last_mora.pitch + adjust_pitch, max_pitch), + ) + + +def full_context_label_moras_to_moras( + full_context_moras: List[full_context_label.Mora], +) -> List[Mora]: + return [ + Mora( + text=mora_to_text("".join([p.phoneme for p in mora.phonemes])), + consonant=(mora.consonant.phoneme if mora.consonant is not None else None), + consonant_length=0 if mora.consonant is not None else None, + vowel=mora.vowel.phoneme, + vowel_length=0, + pitch=0, + ) + for mora in full_context_moras + ] + + +class SynthesisEngineBase(metaclass=ABCMeta): + # FIXME: jsonではなくModelを返すようにする + @property + @abstractmethod + def speakers(self) -> str: + raise NotImplementedError + + @property + @abstractmethod + def supported_devices(self) -> Optional[str]: + raise NotImplementedError + + def initialize_style_id_synthesis( # noqa: B027 + self, + style_id: int, + skip_reinit: bool, + ): + """ + 指定したスタイルでの音声合成を初期化する。何度も実行可能。 + 未実装の場合は何もしない + Parameters + ---------- + style_id : int + スタイルID + skip_reinit : bool + True の場合, 既に初期化済みの話者の再初期化をスキップします + """ + pass + + def is_initialized_style_id_synthesis(self, style_id: int) -> bool: + """ + 指定したスタイルでの音声合成が初期化されているかどうかを返す + Parameters + ---------- + style_id : int + スタイルID + Returns + ------- + bool + 初期化されているかどうか + """ + return True + + @abstractmethod + def replace_phoneme_length( + self, accent_phrases: List[AccentPhrase], style_id: int + ) -> List[AccentPhrase]: + """ + accent_phrasesの母音・子音の長さを設定する + Parameters + ---------- + accent_phrases : List[AccentPhrase] + アクセント句モデルのリスト + style_id : int + スタイルID + Returns + ------- + accent_phrases : List[AccentPhrase] + 母音・子音の長さが設定されたアクセント句モデルのリスト + """ + raise NotImplementedError() + + @abstractmethod + def replace_mora_pitch( + self, + accent_phrases: List[AccentPhrase], + style_id: int, + ) -> List[AccentPhrase]: + """ + accent_phrasesの音高(ピッチ)を設定する + Parameters + ---------- + accent_phrases : List[AccentPhrase] + アクセント句モデルのリスト + style_id : int + スタイルID + Returns + ------- + accent_phrases : List[AccentPhrase] + 音高(ピッチ)が設定されたアクセント句モデルのリスト + """ + raise NotImplementedError() + + def replace_mora_data( + self, + accent_phrases: List[AccentPhrase], + style_id: int, + ) -> List[AccentPhrase]: + return self.replace_mora_pitch( + accent_phrases=self.replace_phoneme_length( + accent_phrases=accent_phrases, + style_id=style_id, + ), + style_id=style_id, + ) + + def create_accent_phrases(self, text: str, style_id: int) -> List[AccentPhrase]: + if len(text.strip()) == 0: + return [] + + utterance = extract_full_context_label(text) + if len(utterance.breath_groups) == 0: + return [] + + accent_phrases = self.replace_mora_data( + accent_phrases=[ + AccentPhrase( + moras=full_context_label_moras_to_moras(accent_phrase.moras), + accent=accent_phrase.accent, + pause_mora=( + Mora( + text="、", + consonant=None, + consonant_length=None, + vowel="pau", + vowel_length=0, + pitch=0, + ) + if ( + i_accent_phrase == len(breath_group.accent_phrases) - 1 + and i_breath_group != len(utterance.breath_groups) - 1 + ) + else None + ), + is_interrogative=accent_phrase.is_interrogative, + ) + for i_breath_group, breath_group in enumerate(utterance.breath_groups) + for i_accent_phrase, accent_phrase in enumerate( + breath_group.accent_phrases + ) + ], + style_id=style_id, + ) + return accent_phrases + + def synthesis( + self, + query: AudioQuery, + style_id: int, + enable_interrogative_upspeak: bool = True, + ) -> np.ndarray: + """ + 音声合成クエリ内の疑問文指定されたMoraを変形した後、 + 継承先における実装`_synthesis_impl`を使い音声合成を行う + Parameters + ---------- + query : AudioQuery + 音声合成クエリ + style_id : int + スタイルID + enable_interrogative_upspeak : bool + 疑問系のテキストの語尾を自動調整する機能を有効にするか + Returns + ------- + wave : numpy.ndarray + 音声合成結果 + """ + # モーフィング時などに同一参照のqueryで複数回呼ばれる可能性があるので、元の引数のqueryに破壊的変更を行わない + query = copy.deepcopy(query) + if enable_interrogative_upspeak: + query.accent_phrases = adjust_interrogative_accent_phrases( + query.accent_phrases + ) + return self._synthesis_impl(query, style_id) + + @abstractmethod + def _synthesis_impl( + self, + query: AudioQuery, + style_id: int, + ) -> np.ndarray: + """ + 音声合成クエリから音声合成に必要な情報を構成し、実際に音声合成を行う + Parameters + ---------- + query : AudioQuery + 音声合成クエリ + style_id : int + スタイルID + Returns + ------- + wave : numpy.ndarray + 音声合成結果 + """ + raise NotImplementedError() diff --git a/voicevox_nemo_engine/voicevox_engine/user_dict.py b/voicevox_nemo_engine/voicevox_engine/user_dict.py new file mode 100644 index 0000000000000000000000000000000000000000..7db07a721dbbd8e18a3a82b1a0208b54223eb403 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/user_dict.py @@ -0,0 +1,298 @@ +import json +import sys +import threading +import traceback +from pathlib import Path +from typing import Dict, List, Optional +from uuid import UUID, uuid4 + +import numpy as np +import pyopenjtalk +from fastapi import HTTPException +from pydantic import conint + +from .model import UserDictWord, WordTypes +from .part_of_speech_data import MAX_PRIORITY, MIN_PRIORITY, part_of_speech_data +from .utility import engine_root, get_save_dir, mutex_wrapper + +root_dir = engine_root() +save_dir = get_save_dir() + +if not save_dir.is_dir(): + save_dir.mkdir(parents=True) + +default_dict_path = root_dir / "default.csv" +user_dict_path = save_dir / "user_dict.json" +compiled_dict_path = save_dir / "user.dic" + + +mutex_user_dict = threading.Lock() +mutex_openjtalk_dict = threading.Lock() + + +@mutex_wrapper(mutex_user_dict) +def write_to_json(user_dict: Dict[str, UserDictWord], user_dict_path: Path): + converted_user_dict = {} + for word_uuid, word in user_dict.items(): + word_dict = word.dict() + word_dict["cost"] = priority2cost( + word_dict["context_id"], word_dict["priority"] + ) + del word_dict["priority"] + converted_user_dict[word_uuid] = word_dict + # 予めjsonに変換できることを確かめる + user_dict_json = json.dumps(converted_user_dict, ensure_ascii=False) + user_dict_path.write_text(user_dict_json, encoding="utf-8") + + +@mutex_wrapper(mutex_openjtalk_dict) +def update_dict( + default_dict_path: Path = default_dict_path, + user_dict_path: Path = user_dict_path, + compiled_dict_path: Path = compiled_dict_path, +): + random_string = uuid4() + tmp_csv_path = save_dir / f".tmp.dict_csv-{random_string}" + tmp_compiled_path = save_dir / f".tmp.dict_compiled-{random_string}" + + try: + # 辞書.csvを作成 + csv_text = "" + if not default_dict_path.is_file(): + print("Warning: Cannot find default dictionary.", file=sys.stderr) + return + default_dict = default_dict_path.read_text(encoding="utf-8") + if default_dict == default_dict.rstrip(): + default_dict += "\n" + csv_text += default_dict + user_dict = read_dict(user_dict_path=user_dict_path) + for word_uuid in user_dict: + word = user_dict[word_uuid] + csv_text += ( + "{surface},{context_id},{context_id},{cost},{part_of_speech}," + + "{part_of_speech_detail_1},{part_of_speech_detail_2}," + + "{part_of_speech_detail_3},{inflectional_type}," + + "{inflectional_form},{stem},{yomi},{pronunciation}," + + "{accent_type}/{mora_count},{accent_associative_rule}\n" + ).format( + surface=word.surface, + context_id=word.context_id, + cost=priority2cost(word.context_id, word.priority), + part_of_speech=word.part_of_speech, + part_of_speech_detail_1=word.part_of_speech_detail_1, + part_of_speech_detail_2=word.part_of_speech_detail_2, + part_of_speech_detail_3=word.part_of_speech_detail_3, + inflectional_type=word.inflectional_type, + inflectional_form=word.inflectional_form, + stem=word.stem, + yomi=word.yomi, + pronunciation=word.pronunciation, + accent_type=word.accent_type, + mora_count=word.mora_count, + accent_associative_rule=word.accent_associative_rule, + ) + tmp_csv_path.write_text(csv_text, encoding="utf-8") + + # 辞書.csvをOpenJTalk用にコンパイル + pyopenjtalk.create_user_dict(str(tmp_csv_path), str(tmp_compiled_path)) + if not tmp_compiled_path.is_file(): + raise RuntimeError("辞書のコンパイル時にエラーが発生しました。") + + # コンパイル済み辞書の置き換え・読み込み + pyopenjtalk.unset_user_dict() + tmp_compiled_path.replace(compiled_dict_path) + if compiled_dict_path.is_file(): + pyopenjtalk.set_user_dict(str(compiled_dict_path.resolve(strict=True))) + + except Exception as e: + print("Error: Failed to update dictionary.", file=sys.stderr) + traceback.print_exc(file=sys.stderr) + raise e + + finally: + # 後処理 + if tmp_csv_path.exists(): + tmp_csv_path.unlink() + if tmp_compiled_path.exists(): + tmp_compiled_path.unlink() + + +@mutex_wrapper(mutex_user_dict) +def read_dict(user_dict_path: Path = user_dict_path) -> Dict[str, UserDictWord]: + if not user_dict_path.is_file(): + return {} + with user_dict_path.open(encoding="utf-8") as f: + result = {} + for word_uuid, word in json.load(f).items(): + # cost2priorityで変換を行う際にcontext_idが必要となるが、 + # 0.12以前の辞書は、context_idがハードコーディングされていたためにユーザー辞書内に保管されていない + # ハードコーディングされていたcontext_idは固有名詞を意味するものなので、固有名詞のcontext_idを補完する + if word.get("context_id") is None: + word["context_id"] = part_of_speech_data[ + WordTypes.PROPER_NOUN + ].context_id + word["priority"] = cost2priority(word["context_id"], word["cost"]) + del word["cost"] + result[str(UUID(word_uuid))] = UserDictWord(**word) + + return result + + +def create_word( + surface: str, + pronunciation: str, + accent_type: int, + word_type: Optional[WordTypes] = None, + priority: Optional[int] = None, +) -> UserDictWord: + if word_type is None: + word_type = WordTypes.PROPER_NOUN + if word_type not in part_of_speech_data.keys(): + raise HTTPException(status_code=422, detail="不明な品詞です") + if priority is None: + priority = 5 + if not MIN_PRIORITY <= priority <= MAX_PRIORITY: + raise HTTPException(status_code=422, detail="優先度の値が無効です") + pos_detail = part_of_speech_data[word_type] + return UserDictWord( + surface=surface, + context_id=pos_detail.context_id, + priority=priority, + part_of_speech=pos_detail.part_of_speech, + part_of_speech_detail_1=pos_detail.part_of_speech_detail_1, + part_of_speech_detail_2=pos_detail.part_of_speech_detail_2, + part_of_speech_detail_3=pos_detail.part_of_speech_detail_3, + inflectional_type="*", + inflectional_form="*", + stem="*", + yomi=pronunciation, + pronunciation=pronunciation, + accent_type=accent_type, + accent_associative_rule="*", + ) + + +def apply_word( + surface: str, + pronunciation: str, + accent_type: int, + word_type: Optional[WordTypes] = None, + priority: Optional[int] = None, + user_dict_path: Path = user_dict_path, + compiled_dict_path: Path = compiled_dict_path, +) -> str: + word = create_word( + surface=surface, + pronunciation=pronunciation, + accent_type=accent_type, + word_type=word_type, + priority=priority, + ) + user_dict = read_dict(user_dict_path=user_dict_path) + word_uuid = str(uuid4()) + user_dict[word_uuid] = word + write_to_json(user_dict, user_dict_path) + update_dict(user_dict_path=user_dict_path, compiled_dict_path=compiled_dict_path) + return word_uuid + + +def rewrite_word( + word_uuid: str, + surface: str, + pronunciation: str, + accent_type: int, + word_type: Optional[WordTypes] = None, + priority: Optional[int] = None, + user_dict_path: Path = user_dict_path, + compiled_dict_path: Path = compiled_dict_path, +): + word = create_word( + surface=surface, + pronunciation=pronunciation, + accent_type=accent_type, + word_type=word_type, + priority=priority, + ) + user_dict = read_dict(user_dict_path=user_dict_path) + if word_uuid not in user_dict: + raise HTTPException(status_code=422, detail="UUIDに該当するワードが見つかりませんでした") + user_dict[word_uuid] = word + write_to_json(user_dict, user_dict_path) + update_dict(user_dict_path=user_dict_path, compiled_dict_path=compiled_dict_path) + + +def delete_word( + word_uuid: str, + user_dict_path: Path = user_dict_path, + compiled_dict_path: Path = compiled_dict_path, +): + user_dict = read_dict(user_dict_path=user_dict_path) + if word_uuid not in user_dict: + raise HTTPException(status_code=422, detail="IDに該当するワードが見つかりませんでした") + del user_dict[word_uuid] + write_to_json(user_dict, user_dict_path) + update_dict(user_dict_path=user_dict_path, compiled_dict_path=compiled_dict_path) + + +def import_user_dict( + dict_data: Dict[str, UserDictWord], + override: bool = False, + user_dict_path: Path = user_dict_path, + default_dict_path: Path = default_dict_path, + compiled_dict_path: Path = compiled_dict_path, +): + # 念のため型チェックを行う + for word_uuid, word in dict_data.items(): + UUID(word_uuid) + assert isinstance(word, UserDictWord) + for pos_detail in part_of_speech_data.values(): + if word.context_id == pos_detail.context_id: + assert word.part_of_speech == pos_detail.part_of_speech + assert ( + word.part_of_speech_detail_1 == pos_detail.part_of_speech_detail_1 + ) + assert ( + word.part_of_speech_detail_2 == pos_detail.part_of_speech_detail_2 + ) + assert ( + word.part_of_speech_detail_3 == pos_detail.part_of_speech_detail_3 + ) + assert ( + word.accent_associative_rule in pos_detail.accent_associative_rules + ) + break + else: + raise ValueError("対応していない品詞です") + old_dict = read_dict(user_dict_path=user_dict_path) + if override: + new_dict = {**old_dict, **dict_data} + else: + new_dict = {**dict_data, **old_dict} + write_to_json(user_dict=new_dict, user_dict_path=user_dict_path) + update_dict( + default_dict_path=default_dict_path, + user_dict_path=user_dict_path, + compiled_dict_path=compiled_dict_path, + ) + + +def search_cost_candidates(context_id: int) -> List[int]: + for value in part_of_speech_data.values(): + if value.context_id == context_id: + return value.cost_candidates + raise HTTPException(status_code=422, detail="品詞IDが不正です") + + +def cost2priority(context_id: int, cost: conint(ge=-32768, le=32767)) -> int: + cost_candidates = search_cost_candidates(context_id) + # cost_candidatesの中にある値で最も近い値を元にpriorityを返す + # 参考: https://qiita.com/Krypf/items/2eada91c37161d17621d + # この関数とpriority2cost関数によって、辞書ファイルのcostを操作しても最も近いpriorityのcostに上書きされる + return MAX_PRIORITY - np.argmin(np.abs(np.array(cost_candidates) - cost)) + + +def priority2cost( + context_id: int, priority: conint(ge=MIN_PRIORITY, le=MAX_PRIORITY) +) -> int: + cost_candidates = search_cost_candidates(context_id) + return cost_candidates[MAX_PRIORITY - priority] diff --git a/voicevox_nemo_engine/voicevox_engine/utility/__init__.py b/voicevox_nemo_engine/voicevox_engine/utility/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d40fea3e6c22f8bcb960ca12cf626e1f3a40afef --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/utility/__init__.py @@ -0,0 +1,20 @@ +from .connect_base64_waves import ( + ConnectBase64WavesException, + connect_base64_waves, + decode_base64_waves, +) +from .core_version_utility import get_latest_core_version, parse_core_version +from .mutex_utility import mutex_wrapper +from .path_utility import delete_file, engine_root, get_save_dir + +__all__ = [ + "ConnectBase64WavesException", + "connect_base64_waves", + "decode_base64_waves", + "get_latest_core_version", + "parse_core_version", + "delete_file", + "engine_root", + "get_save_dir", + "mutex_wrapper", +] diff --git a/voicevox_nemo_engine/voicevox_engine/utility/connect_base64_waves.py b/voicevox_nemo_engine/voicevox_engine/utility/connect_base64_waves.py new file mode 100644 index 0000000000000000000000000000000000000000..900211e3c38bf1d4c1dce98a37246444b15e5b8e --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/utility/connect_base64_waves.py @@ -0,0 +1,60 @@ +import base64 +import io +from typing import List, Tuple + +import numpy as np +import soundfile +from soxr import resample + + +class ConnectBase64WavesException(Exception): + def __init__(self, message: str): + self.message = message + + +def decode_base64_waves(waves: List[str]) -> List[Tuple[np.ndarray, int]]: + """ + base64エンコードされた複数のwavデータをデコードする + Parameters + ---------- + waves: list[str] + base64エンコードされたwavデータのリスト + Returns + ------- + waves_nparray_sr: List[Tuple[np.ndarray, int]] + (NumPy配列の音声波形データ, サンプリングレート) 形式のタプルのリスト + """ + if len(waves) == 0: + raise ConnectBase64WavesException("wavファイルが含まれていません") + + waves_nparray_sr = [] + for wave in waves: + try: + wav_bin = base64.standard_b64decode(wave) + except ValueError: + raise ConnectBase64WavesException("base64デコードに失敗しました") + try: + _data = soundfile.read(io.BytesIO(wav_bin)) + except Exception: + raise ConnectBase64WavesException("wavファイルを読み込めませんでした") + waves_nparray_sr.append(_data) + + return waves_nparray_sr + + +def connect_base64_waves(waves: List[str]) -> Tuple[np.ndarray, int]: + waves_nparray_sr = decode_base64_waves(waves) + + max_sampling_rate = max([sr for _, sr in waves_nparray_sr]) + max_channels = max([x.ndim for x, _ in waves_nparray_sr]) + assert 0 < max_channels <= 2 + + waves_nparray_list = [] + for nparray, sr in waves_nparray_sr: + if sr != max_sampling_rate: + nparray = resample(nparray, sr, max_sampling_rate) + if nparray.ndim < max_channels: + nparray = np.array([nparray, nparray]).T + waves_nparray_list.append(nparray) + + return np.concatenate(waves_nparray_list), max_sampling_rate diff --git a/voicevox_nemo_engine/voicevox_engine/utility/core_version_utility.py b/voicevox_nemo_engine/voicevox_engine/utility/core_version_utility.py new file mode 100644 index 0000000000000000000000000000000000000000..25f2d3a3e7e7ed3a25e52075eb74be08c96451db --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/utility/core_version_utility.py @@ -0,0 +1,14 @@ +from typing import Iterable + +from semver.version import Version + + +def parse_core_version(version: str) -> Version: + return Version.parse(version) + + +def get_latest_core_version(versions: Iterable[str]) -> str: + if len(versions) == 0: + raise Exception("versions must be non-empty.") + + return str(max(map(parse_core_version, versions))) diff --git a/voicevox_nemo_engine/voicevox_engine/utility/mutex_utility.py b/voicevox_nemo_engine/voicevox_engine/utility/mutex_utility.py new file mode 100644 index 0000000000000000000000000000000000000000..09d8cb9680f71758018bffe82838a763ca46fe31 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/utility/mutex_utility.py @@ -0,0 +1,15 @@ +import threading + + +def mutex_wrapper(lock: threading.Lock): + def wrap(f): + def func(*args, **kw): + lock.acquire() + try: + return f(*args, **kw) + finally: + lock.release() + + return func + + return wrap diff --git a/voicevox_nemo_engine/voicevox_engine/utility/path_utility.py b/voicevox_nemo_engine/voicevox_engine/utility/path_utility.py new file mode 100644 index 0000000000000000000000000000000000000000..572f946bfc872b4c0db95dda073f8e8441bda622 --- /dev/null +++ b/voicevox_nemo_engine/voicevox_engine/utility/path_utility.py @@ -0,0 +1,51 @@ +import os +import sys +import traceback +from pathlib import Path + +from platformdirs import user_data_dir + + +def engine_root() -> Path: + if is_development(): + root_dir = Path(__file__).parents[2] + + # Nuitka/Pyinstallerでビルドされている場合 + else: + root_dir = Path(sys.argv[0]).parent + + return root_dir.resolve(strict=True) + + +def is_development() -> bool: + """ + 開発版かどうか判定する関数 + Nuitka/Pyinstallerでコンパイルされていない場合は開発環境とする。 + """ + # nuitkaビルドをした際はグローバルに__compiled__が含まれる + if "__compiled__" in globals(): + return False + + # pyinstallerでビルドをした際はsys.frozenが設定される + elif getattr(sys, "frozen", False): + return False + + return True + + +def get_save_dir(): + # FIXME: ファイル保存場所をエンジン固有のIDが入ったものにする + # FIXME: Windowsは`voicevox-engine/voicevox-engine`ディレクトリに保存されているので + # `VOICEVOX/voicevox-engine`に変更する + if is_development(): + app_name = "voicevox-nemo-engine-dev" + else: + app_name = "voicevox-nemo-engine" + return Path(user_data_dir(app_name)) + + +def delete_file(file_path: str) -> None: + try: + os.remove(file_path) + except OSError: + traceback.print_exc()
+ allまたはlocalappsを指定。allはすべてを許可します。 +
+ localappsはオリジン間リソース共有ポリシーを、app://.とlocalhost関連に限定します。 +
+ その他のオリジンはallow_originオプションで追加できます。デフォルトはlocalapps。 +