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
7 changes: 1 addition & 6 deletions .github/workflows/build-pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm, macos-13]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
fail-fast: false
steps:
Expand All @@ -45,11 +45,6 @@ jobs:
with:
key: ${{ matrix.os }}-${{ matrix.python-version }}

# see https://github.com/microsoft/setup-msbuild
- name: Add msbuild to PATH
if: startsWith(matrix.os, 'windows')
uses: microsoft/setup-msbuild@v1.0.2

- name: Setup Python
uses: actions/setup-python@v5
with:
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/build-wheels-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,32 @@ jobs:
name: ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312", "cp313"]
os: [ubuntu-24.04-arm]
python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"]

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all

# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
uses: pypa/cibuildwheel@v3.1.4
env:
CIBW_BUILD: "${{ matrix.python-version}}-* "
CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
CIBW_BUILD_VERBOSITY: 3
CIBW_ARCHS_LINUX: aarch64
CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH='/project/build/lib.linux-aarch64-cpython-37/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-38/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-39/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-310/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-311/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-312/kaldi_decoder/lib'
CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH='/project/build/lib.linux-aarch64-cpython-37/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-38/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-39/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-310/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-311/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-312/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-313/kaldi_decoder/lib:/project/build/lib.linux-aarch64-cpython-314/kaldi_decoder/lib'

- name: Display wheels
shell: bash
run: |
ls -lh ./wheelhouse/

unzip -l ./wheelhouse/*.whl

- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.python-version }}
Expand All @@ -60,6 +58,6 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel twine setuptools
python3 -m pip install wheel twine==5.0.0 setuptools

twine upload ./wheelhouse/*.whl
9 changes: 5 additions & 4 deletions .github/workflows/build-wheels-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,26 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312", "cp313"]
python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"]

steps:
- uses: actions/checkout@v4

# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
uses: pypa/cibuildwheel@v3.1.4
env:
CIBW_BUILD: "${{ matrix.python-version}}-* "
CIBW_SKIP: "cp27-* cp35-* cp36-* pp* *-musllinux* *-win32 "
CIBW_BUILD_VERBOSITY: 3
CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH='/project/build/lib.linux-x86_64-cpython-37/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-37/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-38/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-38/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-39/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-39/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-310/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-310/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-311/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-311/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-312/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-312/kaldi_decoder/lib'
CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH='/project/build/lib.linux-x86_64-cpython-37/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-37/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-38/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-38/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-39/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-39/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-310/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-310/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-311/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-311/kaldi_decoder/lib:/project/build/lib.linux-x86_64-cpython-312/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-312/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-313/kaldi_decoder/lib:/project/build/lib.linux-i686-cpython-314/kaldi_decoder/lib'

- name: Display wheels
shell: bash
run: |
ls -lh ./wheelhouse/
unzip -l ./wheelhouse/*.whl

- uses: actions/upload-artifact@v4
with:
Expand All @@ -52,7 +53,7 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel twine setuptools
python3 -m pip install wheel twine==5.0.0 setuptools

twine upload ./wheelhouse/*.whl

Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/build-wheels-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,21 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest]
python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313"]
python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"]

steps:
- uses: actions/checkout@v4

# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
uses: pypa/cibuildwheel@v3.1.4
env:
CIBW_BUILD: "${{ matrix.python-version}}-* "
CIBW_ENVIRONMENT: KALDI_DECODER_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64'"
CIBW_ENVIRONMENT: >
KALDI_DECODER_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15"
MACOSX_DEPLOYMENT_TARGET=10.15

CIBW_ARCHS: "universal2"
CIBW_BUILD_VERBOSITY: 3

Expand All @@ -59,6 +62,6 @@ jobs:
run: |
opts='--break-system-packages'
python3 -m pip install $opts --upgrade pip
python3 -m pip install $opts wheel twine setuptools
python3 -m pip install $opts wheel twine==5.0.0 setuptools

twine upload ./wheelhouse/*.whl
6 changes: 3 additions & 3 deletions .github/workflows/build-wheels-win32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312", "cp313"]
python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"]

steps:
- uses: actions/checkout@v4

# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
uses: pypa/cibuildwheel@v3.1.4
env:
CIBW_ENVIRONMENT: KALDI_DECODER_CMAKE_ARGS="-A Win32"
CIBW_BUILD: "${{ matrix.python-version}}-* "
Expand All @@ -52,6 +52,6 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel twine setuptools
python3 -m pip install wheel twine==5.0.0 setuptools

twine upload ./wheelhouse/*.whl
8 changes: 4 additions & 4 deletions .github/workflows/build-wheels-win64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312", "cp313"]
python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"]

steps:
- uses: actions/checkout@v4

# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
uses: pypa/cibuildwheel@v3.1.4
env:
CIBW_BUILD: "${{ matrix.python-version}}-* "
CIBW_SKIP: "cp27-* cp35-* cp36-* pp* *-musllinux* *-win32 "
CIBW_SKIP: "cp27-* cp35-* cp36-* cp37-* pp* *-musllinux* *-win32 "
CIBW_BUILD_VERBOSITY: 3

- name: Display wheels
Expand All @@ -51,6 +51,6 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel twine setuptools
python3 -m pip install wheel twine==5.0.0 setuptools

twine upload ./wheelhouse/*.whl
2 changes: 1 addition & 1 deletion .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, ubuntu-24.04-arm]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest]
os: [macos-latest, macos-13]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()

set(KALDI_DECODER_VERSION "0.2.7")
set(KALDI_DECODER_VERSION "0.2.10")

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
Expand All @@ -35,7 +35,7 @@ if(NOT CMAKE_BUILD_TYPE)
endif()
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")

set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ version to be used.")
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ version to be used.")
set(CMAKE_CXX_EXTENSIONS OFF)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
Expand Down
16 changes: 7 additions & 9 deletions cmake/kaldifst.cmake
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
function(download_kaldifst)
include(FetchContent)

set(kaldifst_URL "https://github.com/k2-fsa/kaldifst/archive/refs/tags/v1.7.11.tar.gz")
set(kaldifst_URL2 "https://hub.nuaa.cf/k2-fsa/kaldifst/archive/refs/tags/v1.7.11.tar.gz")
set(kaldifst_HASH "SHA256=b43b3332faa2961edc730e47995a58cd4e22ead21905d55b0c4a41375b4a525f")
set(kaldifst_URL "https://github.com/k2-fsa/kaldifst/archive/refs/tags/v1.7.16.tar.gz")
set(kaldifst_HASH "SHA256=f338135a3d137b7a8c287e2ca2e0918e1394e1c08bad53b26e7be03a5d4a1066")

# If you don't have access to the Internet,
# please pre-download kaldifst
set(possible_file_locations
$ENV{HOME}/Downloads/kaldifst-1.7.11.tar.gz
${CMAKE_SOURCE_DIR}/kaldifst-1.7.11.tar.gz
${CMAKE_BINARY_DIR}/kaldifst-1.7.11.tar.gz
/tmp/kaldifst-1.7.11.tar.gz
/star-fj/fangjun/download/github/kaldifst-1.7.11.tar.gz
$ENV{HOME}/Downloads/kaldifst-1.7.16.tar.gz
${CMAKE_SOURCE_DIR}/kaldifst-1.7.16.tar.gz
${CMAKE_BINARY_DIR}/kaldifst-1.7.16.tar.gz
/tmp/kaldifst-1.7.16.tar.gz
/star-fj/fangjun/download/github/kaldifst-1.7.16.tar.gz
)

foreach(f IN LISTS possible_file_locations)
if(EXISTS ${f})
set(kaldifst_URL "${f}")
file(TO_CMAKE_PATH "${kaldifst_URL}" kaldifst_URL)
message(STATUS "Found local downloaded kaldifst: ${kaldifst_URL}")
set(kaldifst_URL2)
break()
endif()
endforeach()
Expand Down
16 changes: 8 additions & 8 deletions cmake/pybind11.cmake
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
function(download_pybind11)
include(FetchContent)

set(pybind11_URL "https://github.com/pybind/pybind11/archive/refs/tags/v2.10.2.tar.gz")
set(pybind11_URL2 "https://hub.nuaa.cf/pybind/pybind11/archive/refs/tags/v2.10.2.tar.gz")
set(pybind11_HASH "SHA256=93bd1e625e43e03028a3ea7389bba5d3f9f2596abc074b068e70f4ef9b1314ae")
set(pybind11_URL "https://github.com/pybind/pybind11/archive/refs/tags/v3.0.0.tar.gz")
set(pybind11_URL2 "https://hf-mirror.com/csukuangfj/sherpa-onnx-cmake-deps/resolve/main/pybind11-3.0.0.tar.gz")
set(pybind11_HASH "SHA256=453b1a3e2b266c3ae9da872411cadb6d693ac18063bd73226d96cfb7015a200c")

# If you don't have access to the Internet,
# please pre-download pybind11
set(possible_file_locations
$ENV{HOME}/Downloads/pybind11-2.10.2.tar.gz
${CMAKE_SOURCE_DIR}/pybind11-2.10.2.tar.gz
${CMAKE_BINARY_DIR}/pybind11-2.10.2.tar.gz
/tmp/pybind11-2.10.2.tar.gz
/star-fj/fangjun/download/github/pybind11-2.10.2.tar.gz
$ENV{HOME}/Downloads/pybind11-3.0.0.tar.gz
${CMAKE_SOURCE_DIR}/pybind11-3.0.0.tar.gz
${CMAKE_BINARY_DIR}/pybind11-3.0.0.tar.gz
/tmp/pybind11-3.0.0.tar.gz
/star-fj/fangjun/download/github/pybind11-3.0.0.tar.gz
)

foreach(f IN LISTS possible_file_locations)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_package_version():

setuptools.setup(
name=package_name,
python_requires=">=3.6",
python_requires=">=3.8",
version=get_package_version(),
author="The next-gen Kaldi development team",
author_email="csukuangfj@gmail.com",
Expand All @@ -56,7 +56,7 @@ def get_package_version():
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
license="Apache licensed, as found in the LICENSE file",
license="Apache-2.0",
)

with open("kaldi-decoder/python/kaldi_decoder/__init__.py", "r") as f:
Expand Down
Loading