From 50b21d4b2fdbf87a07d9158655d25feacfab678b Mon Sep 17 00:00:00 2001 From: ibevers Date: Wed, 19 Jun 2024 06:34:45 -0400 Subject: [PATCH] fix: fix support for NumPy 2.0.0 --- CHANGELOG.md | 6 ++++++ pyannote/audio/core/inference.py | 2 +- pyannote/audio/tasks/segmentation/mixins.py | 2 +- pyannote/audio/tasks/segmentation/speaker_diarization.py | 2 +- pyannote/audio/tasks/separation/PixIT.py | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 438f87bfb..f29a13450 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## develop + +### Fixes + +- fix: fix support for `numpy==2.x` ([@ibevers](https://github.com/ibevers/)) + ## Version 3.3.0 (2024-06-14) ### TL;DR diff --git a/pyannote/audio/core/inference.py b/pyannote/audio/core/inference.py index e43e94f98..5155d55e6 100644 --- a/pyannote/audio/core/inference.py +++ b/pyannote/audio/core/inference.py @@ -526,7 +526,7 @@ def aggregate( warm_up: Tuple[float, float] = (0.0, 0.0), epsilon: float = 1e-12, hamming: bool = False, - missing: float = np.NaN, + missing: float = np.nan, skip_average: bool = False, ) -> SlidingWindowFeature: """Aggregation diff --git a/pyannote/audio/tasks/segmentation/mixins.py b/pyannote/audio/tasks/segmentation/mixins.py index be30828f0..cf6e3004a 100644 --- a/pyannote/audio/tasks/segmentation/mixins.py +++ b/pyannote/audio/tasks/segmentation/mixins.py @@ -401,7 +401,7 @@ def validation_step(self, batch, batch_idx: int): ) # reshape target so that there is one line per class when plotting it - y[y == 0] = np.NaN + y[y == 0] = np.nan if len(y.shape) == 2: y = y[:, :, np.newaxis] y *= np.arange(y.shape[2]) diff --git a/pyannote/audio/tasks/segmentation/speaker_diarization.py b/pyannote/audio/tasks/segmentation/speaker_diarization.py index 8a091b1f7..fb0b9b979 100644 --- a/pyannote/audio/tasks/segmentation/speaker_diarization.py +++ b/pyannote/audio/tasks/segmentation/speaker_diarization.py @@ -818,7 +818,7 @@ def validation_step(self, batch, batch_idx: int): ) # reshape target so that there is one line per class when plotting it - y[y == 0] = np.NaN + y[y == 0] = np.nan if len(y.shape) == 2: y = y[:, :, np.newaxis] y *= np.arange(y.shape[2]) diff --git a/pyannote/audio/tasks/separation/PixIT.py b/pyannote/audio/tasks/separation/PixIT.py index b181d7711..cc647ee63 100644 --- a/pyannote/audio/tasks/separation/PixIT.py +++ b/pyannote/audio/tasks/separation/PixIT.py @@ -1136,7 +1136,7 @@ def validation_step(self, batch, batch_idx: int): ) # reshape target so that there is one line per class when plotting it - y[y == 0] = np.NaN + y[y == 0] = np.nan if len(y.shape) == 2: y = y[:, :, np.newaxis] y *= np.arange(y.shape[2])