From 405e9e8fb4a8cd9a93b51992b387dc40f85376ed Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Mon, 30 Dec 2024 17:49:04 +0800 Subject: [PATCH] Fix CI --- .github/scripts/docker/generate_build_matrix.py | 17 +++++++++++++++-- .github/workflows/baker_zh.yml | 4 ++-- egs/baker_zh/TTS/README.md | 9 +++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/scripts/docker/generate_build_matrix.py b/.github/scripts/docker/generate_build_matrix.py index c5a1a54cb..0af74569c 100755 --- a/.github/scripts/docker/generate_build_matrix.py +++ b/.github/scripts/docker/generate_build_matrix.py @@ -5,6 +5,15 @@ import json +def get_args(): + parser = argparse.ArgumentParser() + parser.add_argument( + "--min-torch-version", + help="Minimu torch version", + ) + return parser.parse_args() + + def version_gt(a, b): a_major, a_minor = list(map(int, a.split(".")))[:2] b_major, b_minor = list(map(int, b.split(".")))[:2] @@ -42,7 +51,7 @@ def get_torchaudio_version(torch_version): return torch_version -def get_matrix(): +def get_matrix(min_torch_version): k2_version = "1.24.4.dev20241029" kaldifeat_version = "1.25.5.dev20241029" version = "20241218" @@ -64,6 +73,9 @@ def get_matrix(): matrix = [] for p in python_version: for t in torch_version: + if min_torch_version and version_gt(min_torch_version, t): + continue + # torchaudio <= 1.13.x supports only python <= 3.10 if version_gt(p, "3.10") and not version_gt(t, "2.0"): @@ -101,7 +113,8 @@ def get_matrix(): def main(): - matrix = get_matrix() + args = get_args() + matrix = get_matrix(min_torch_version=args.min_torch_version) print(json.dumps({"include": matrix})) diff --git a/.github/workflows/baker_zh.yml b/.github/workflows/baker_zh.yml index b166d0e78..5b047d1b4 100644 --- a/.github/workflows/baker_zh.yml +++ b/.github/workflows/baker_zh.yml @@ -31,8 +31,8 @@ jobs: id: set-matrix run: | # outputting for debugging purposes - python ./.github/scripts/docker/generate_build_matrix.py - MATRIX=$(python ./.github/scripts/docker/generate_build_matrix.py) + python ./.github/scripts/docker/generate_build_matrix.py --min-torch-version "2.3" + MATRIX=$(python ./.github/scripts/docker/generate_build_matrix.py --min-torch-version "2.3") echo "::set-output name=matrix::${MATRIX}" baker_zh: diff --git a/egs/baker_zh/TTS/README.md b/egs/baker_zh/TTS/README.md index e1d098b25..c24c3c32a 100644 --- a/egs/baker_zh/TTS/README.md +++ b/egs/baker_zh/TTS/README.md @@ -81,6 +81,15 @@ The above command generate the following files: where the 2 in `model-steps-2.onnx` means it uses 2 steps for the ODE solver. +**HINT**: If you get the following error while running `export_onnx.py`: + +``` +torch.onnx.errors.UnsupportedOperatorError: Exporting the operator +'aten::scaled_dot_product_attention' to ONNX opset version 14 is not supported. +``` + +please use `torch>=2.2.0`. + To export the Hifigan vocoder to onnx, please use: ```bash