Skip to content

Commit

Permalink
Numpy 2.0 compatibility (#1362)
Browse files Browse the repository at this point in the history
* Remove numpy version limit

* Bump CI torch version in some tests

* Upgrade torch version in most CI tests, fix one failing test with numpy 2.0

* remove kaldifeat from python3.9 CI due to compilation issues
  • Loading branch information
pzelasko authored Jun 25, 2024
1 parent e3bed73 commit da4d70d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/missing_torchaudio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
strategy:
matrix:
include:
- python-version: "3.11"
torch-install-cmd: "pip install torch==2.0 --extra-index-url https://download.pytorch.org/whl/cpu"
- python-version: "3.12"
torch-install-cmd: "pip install torch==2.3 --index-url https://download.pytorch.org/whl/cpu"

fail-fast: false

Expand All @@ -38,7 +38,7 @@ jobs:
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install wheel 'numpy<2' scipy
pip install wheel numpy scipy
# Force the installation of a CPU-only PyTorch
${{ matrix.torch-install-cmd }}
# the torchaudio env var does nothing when torchaudio is installed, but doesn't require it's presence when it's not
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ jobs:
torch-install-cmd: "pip install torch==1.12.1 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cpu"
extra_deps: kaldifeat
- python-version: "3.9"
torch-install-cmd: "pip install torch==2.0 torchaudio==2.0 --extra-index-url https://download.pytorch.org/whl/cpu"
extra_deps: kaldifeat
torch-install-cmd: "pip install torch==2.3 torchaudio==2.3 --extra-index-url https://download.pytorch.org/whl/cpu"
extra_deps: ""
- python-version: "3.10"
torch-install-cmd: "pip install torch==2.1 torchaudio==2.1 --extra-index-url https://download.pytorch.org/whl/cpu"
torch-install-cmd: "pip install torch==2.3 torchaudio==2.3 --extra-index-url https://download.pytorch.org/whl/cpu"
extra_deps: ""
- python-version: "3.11"
torch-install-cmd: "pip install torch==2.2 torchaudio==2.2 --extra-index-url https://download.pytorch.org/whl/cpu"
torch-install-cmd: "pip install torch==2.3 torchaudio==2.3 --extra-index-url https://download.pytorch.org/whl/cpu"
extra_deps: ""
- python-version: "3.12"
torch-install-cmd: "pip install torch==2.2 torchaudio==2.2 --extra-index-url https://download.pytorch.org/whl/cpu"
torch-install-cmd: "pip install torch==2.3 torchaudio==2.3 --extra-index-url https://download.pytorch.org/whl/cpu"
extra_deps: ""

fail-fast: false
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install wheel 'numpy<2'
pip install wheel numpy
# Force the installation of a CPU-only PyTorch
${{ matrix.torch-install-cmd }}
# the torchaudio env var does nothing when torchaudio is installed, but doesn't require it's presence when it's not
Expand Down
2 changes: 1 addition & 1 deletion test/cut/test_padding_cut.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_load_features_log(padding_cut, expected_value):
feats = padding_cut.load_features()
assert feats.shape[0] == 1000
assert feats.shape[1] == 40
np.testing.assert_almost_equal(feats, expected_value)
np.testing.assert_almost_equal(feats, expected_value, decimal=6)


def test_frame_shift(padding_cut):
Expand Down

0 comments on commit da4d70d

Please sign in to comment.