Update cpu docker images to support torch 2.2.0 (#1499)

This commit is contained in:
Fangjun Kuang 2024-02-18 12:05:38 +08:00 committed by GitHub
parent d9ae8c02a0
commit 06b356a610
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 8 deletions

View File

@ -11,6 +11,7 @@ ARG _KALDIFEAT_VERSION="${KALDIFEAT_VERSION}+cpu.torch${TORCH_VERSION}"
RUN apt-get update -y && \ RUN apt-get update -y && \
apt-get install -qq -y \ apt-get install -qq -y \
cmake \
ffmpeg \ ffmpeg \
git \ git \
git-lfs \ git-lfs \

View File

@ -6,8 +6,8 @@ import json
def version_gt(a, b): def version_gt(a, b):
a_major, a_minor = a.split(".")[:2] a_major, a_minor = list(map(int, a.split(".")))[:2]
b_major, b_minor = b.split(".")[:2] b_major, b_minor = list(map(int, b.split(".")))[:2]
if a_major > b_major: if a_major > b_major:
return True return True
@ -18,8 +18,8 @@ def version_gt(a, b):
def version_ge(a, b): def version_ge(a, b):
a_major, a_minor = a.split(".")[:2] a_major, a_minor = list(map(int, a.split(".")))[:2]
b_major, b_minor = b.split(".")[:2] b_major, b_minor = list(map(int, b.split(".")))[:2]
if a_major > b_major: if a_major > b_major:
return True return True
@ -43,11 +43,12 @@ def get_torchaudio_version(torch_version):
def get_matrix(): def get_matrix():
k2_version = "1.24.4.dev20231220" k2_version = "1.24.4.dev20240211"
kaldifeat_version = "1.25.3.dev20231221" kaldifeat_version = "1.25.4.dev20240210"
version = "1.2" version = "1.3"
python_version = ["3.8", "3.9", "3.10", "3.11"] python_version = ["3.8", "3.9", "3.10", "3.11", "3.12"]
torch_version = ["1.13.0", "1.13.1", "2.0.0", "2.0.1", "2.1.0", "2.1.1", "2.1.2"] torch_version = ["1.13.0", "1.13.1", "2.0.0", "2.0.1", "2.1.0", "2.1.1", "2.1.2"]
torch_version += ["2.2.0"]
matrix = [] matrix = []
for p in python_version: for p in python_version:
@ -57,6 +58,10 @@ def get_matrix():
if version_gt(p, "3.10") and not version_gt(t, "2.0"): if version_gt(p, "3.10") and not version_gt(t, "2.0"):
continue continue
# only torch>=2.2.0 supports python 3.12
if version_gt(p, "3.11") and not version_gt(t, "2.1"):
continue
matrix.append( matrix.append(
{ {
"k2-version": k2_version, "k2-version": k2_version,