Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ARG PYTHON_VERSION=3.8
ARG PYTHON_VERSION=3.10
FROM python:${PYTHON_VERSION}

ARG TORCHAUDIO_VERSION="0.13.0"
ARG TORCH_VERSION="1.13.0"
ARG K2_VERSION="1.24.4.dev20231220"
ARG KALDIFEAT_VERSION="1.25.3.dev20231221"
ARG TORCHAUDIO_VERSION="2.10.0"
ARG TORCH_VERSION="2.10.0"
ARG K2_VERSION="1.24.4.dev20260625"
ARG KALDIFEAT_VERSION="1.25.5.dev20260626"

ARG _K2_VERSION="${K2_VERSION}+cpu.torch${TORCH_VERSION}"
ARG _KALDIFEAT_VERSION="${KALDIFEAT_VERSION}+cpu.torch${TORCH_VERSION}"
Expand Down Expand Up @@ -55,9 +55,9 @@ RUN pip install --no-cache-dir \
"numpy<2.0" \
onnxoptimizer \
onnxsim \
onnx==1.17.0 \
onnx \
onnxmltools \
onnxruntime==1.17.1 \
onnxruntime \
Comment on lines +58 to +60

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Unpinning onnx and onnxruntime completely can lead to non-reproducible Docker builds and potential compatibility issues in the future when new major/minor versions of these packages are released. It is highly recommended to use version ranges (e.g., matching those in requirements.txt) to ensure build stability.

      onnx>=1.15.0 \
      onnxmltools \
      onnxruntime>=1.16.3 \

piper_phonemize -f https://k2-fsa.github.io/icefall/piper_phonemize.html \
pypinyin==0.50.0 \
pytest \
Expand Down
53 changes: 45 additions & 8 deletions .github/scripts/docker/generate_build_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,39 @@ def get_torchaudio_version(torch_version):
return "2.0.1"
elif torch_version == "2.0.1":
return "2.0.2"
elif version_ge(torch_version, "2.11"):
# torchaudio only has versions up to 2.11.0
return "2.11.0"
else:
return torch_version
Comment on lines +61 to 65

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

For PyTorch versions 2.12.0 and 2.13.0, returning "2.11.0" for torchaudio will cause a dependency resolution failure during the Docker build. torchaudio has strict version requirements matching the major and minor version of torch (e.g., torchaudio 2.13.x requires torch 2.13.x). Since PyTorch and Torchaudio are released in lockstep, Torchaudio 2.12.0 and 2.13.0 should be available. We should allow the version to fall through to match the torch_version.

    else:
        return torch_version



# Latest k2 version per torch version, from https://k2-fsa.github.io/k2/cpu.html
def get_k2_version(torch_version):
# torch 2.13.0 has a newer k2 build
if version_ge(torch_version, "2.13"):
return "1.24.4.dev20260710"
# torch 1.10.0+ through 2.12.x
return "1.24.4.dev20260625"


# Latest kaldifeat version per torch version, from https://csukuangfj.github.io/kaldifeat/cpu.html
def get_kaldifeat_version(torch_version):
# torch 2.13.0 has a newer kaldifeat build
if version_ge(torch_version, "2.13"):
return "1.25.5.dev20260710"
# torch 1.13.0+ through 2.12.x
if version_ge(torch_version, "1.13"):
return "1.25.5.dev20260626"
# older torch versions
return "1.25.5.dev20241029"


def get_matrix(min_torch_version, specified_torch_version, specified_python_version):
k2_version = "1.24.4.dev20250630"
kaldifeat_version = "1.25.5.dev20250630"
version = "20250630"
version = "20260712"

# torchaudio 2.5.0 does not support python 3.13
python_version = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python_version = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Python 3.15 is not yet released or supported by PyTorch 2.13.0. Furthermore, piper_phonemize does not have cp315 wheels available in generate-piper-phonemize-page.py, which will cause the Docker build to fail when installing dependencies. Please remove "3.15" from the list of supported Python versions.

Suggested change
python_version = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
python_version = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]

torch_version = []
torch_version += ["1.13.0", "1.13.1"]
torch_version += ["2.0.0", "2.0.1"]
Expand All @@ -81,6 +103,12 @@ def get_matrix(min_torch_version, specified_torch_version, specified_python_vers
torch_version += ["2.5.0"]
torch_version += ["2.5.1"]
torch_version += ["2.6.0", "2.7.0", "2.7.1"]
torch_version += ["2.8.0"]
torch_version += ["2.9.0", "2.9.1"]
torch_version += ["2.10.0"]
torch_version += ["2.11.0"]
torch_version += ["2.12.0", "2.12.1"]
torch_version += ["2.13.0"]

if specified_torch_version:
torch_version = [specified_torch_version]
Expand Down Expand Up @@ -110,13 +138,22 @@ def get_matrix(min_torch_version, specified_torch_version, specified_python_vers
# torch>=2.5 requires python 3.10
continue

k2_version_2 = k2_version
kaldifeat_version_2 = kaldifeat_version
# torch>=2.9 drops python 3.9
if not version_gt(p, "3.9") and version_ge(t, "2.9"):
continue
Comment on lines +141 to +143

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This check is redundant. The existing check at lines 137-139 already filters out Python versions < 3.10 (which includes 3.8 and 3.9) for any PyTorch version > 2.4 (which includes 2.9 and above). We can safely remove this redundant block to keep the code clean.


# torch>=2.9 supports python 3.14
if version_gt(p, "3.13") and not version_ge(t, "2.9"):
continue

# only torch>=2.13.0 supports python 3.15
if version_gt(p, "3.14") and not version_ge(t, "2.13"):
continue
Comment on lines +149 to +151

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since Python 3.15 is not supported and should be removed from python_version, this check is no longer needed and can be removed.


matrix.append(
{
"k2-version": k2_version_2,
"kaldifeat-version": kaldifeat_version_2,
"k2-version": get_k2_version(t),
"kaldifeat-version": get_kaldifeat_version(t),
"version": version,
"python-version": p,
"torch-version": t,
Expand Down
58 changes: 57 additions & 1 deletion .github/scripts/generate-piper-phonemize-page.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,64 @@ def get_v1_3_0_files():
return ans


def get_v1_4_1_files():
prefix = (
"https://github.com/csukuangfj/piper-phonemize/releases/download/v1.4.1/"
)
files = [
"piper_phonemize-1.4.1-cp314-cp314-macosx_10_14_x86_64.whl",
"piper_phonemize-1.4.1-cp314-cp314-macosx_11_0_arm64.whl",
"piper_phonemize-1.4.1-cp314-cp314-manylinux_2_31_armv7l.whl",
"piper_phonemize-1.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl",
"piper_phonemize-1.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"piper_phonemize-1.4.1-cp314-cp314-win32.whl",
"piper_phonemize-1.4.1-cp313-cp313-macosx_10_14_x86_64.whl",
"piper_phonemize-1.4.1-cp313-cp313-macosx_11_0_arm64.whl",
"piper_phonemize-1.4.1-cp313-cp313-manylinux_2_31_armv7l.whl",
"piper_phonemize-1.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl",
"piper_phonemize-1.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"piper_phonemize-1.4.1-cp313-cp313-win32.whl",
"piper_phonemize-1.4.1-cp312-cp312-macosx_10_14_x86_64.whl",
"piper_phonemize-1.4.1-cp312-cp312-macosx_11_0_arm64.whl",
"piper_phonemize-1.4.1-cp312-cp312-manylinux_2_31_armv7l.whl",
"piper_phonemize-1.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl",
"piper_phonemize-1.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"piper_phonemize-1.4.1-cp312-cp312-win32.whl",
"piper_phonemize-1.4.1-cp311-cp311-macosx_10_14_x86_64.whl",
"piper_phonemize-1.4.1-cp311-cp311-macosx_11_0_arm64.whl",
"piper_phonemize-1.4.1-cp311-cp311-manylinux_2_31_armv7l.whl",
"piper_phonemize-1.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl",
"piper_phonemize-1.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"piper_phonemize-1.4.1-cp311-cp311-win32.whl",
"piper_phonemize-1.4.1-cp310-cp310-macosx_10_14_x86_64.whl",
"piper_phonemize-1.4.1-cp310-cp310-macosx_11_0_arm64.whl",
"piper_phonemize-1.4.1-cp310-cp310-manylinux_2_31_armv7l.whl",
"piper_phonemize-1.4.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl",
"piper_phonemize-1.4.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"piper_phonemize-1.4.1-cp310-cp310-win32.whl",
"piper_phonemize-1.4.1-cp39-cp39-macosx_10_14_x86_64.whl",
"piper_phonemize-1.4.1-cp39-cp39-macosx_11_0_arm64.whl",
"piper_phonemize-1.4.1-cp39-cp39-manylinux_2_31_armv7l.whl",
"piper_phonemize-1.4.1-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl",
"piper_phonemize-1.4.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"piper_phonemize-1.4.1-cp39-cp39-win32.whl",
"piper_phonemize-1.4.1-cp38-cp38-macosx_10_14_x86_64.whl",
"piper_phonemize-1.4.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
"piper_phonemize-1.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"piper_phonemize-1.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"piper_phonemize-1.4.1-cp38-cp38-win32.whl",
"piper_phonemize-1.4.1-cp37-cp37m-macosx_10_14_x86_64.whl",
"piper_phonemize-1.4.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
"piper_phonemize-1.4.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"piper_phonemize-1.4.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"piper_phonemize-1.4.1-cp37-cp37m-win32.whl",
]
ans = [prefix + f for f in files]
return ans
Comment on lines +132 to +133

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with get_v1_3_0_files() and get_v1_2_0_files(), we should sort the list of files in get_v1_4_1_files() before returning them. This ensures the generated HTML page remains clean and organized.

Suggested change
ans = [prefix + f for f in files]
return ans
ans = [prefix + f for f in files]
ans.sort()
return ans



def main():
files = get_v1_3_0_files() + get_v1_2_0_files()
files = get_v1_4_1_files() + get_v1_3_0_files() + get_v1_2_0_files()

with open("piper_phonemize.html", "w") as f:
for url in files:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-cpu-docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: build-cpu-docker
on:
push:
branches:
- docker-cpu
workflow_dispatch:

concurrency:
Expand Down
Loading