From d327195529ebd5bec920b8d7394c6f92a6d4c409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pag=C3=A9s?= <55240756+clement-pages@users.noreply.github.com> Date: Fri, 24 May 2024 12:30:06 +0200 Subject: [PATCH] fix(task): fix metadata preparation with missing validation subset --- CHANGELOG.md | 1 + pyannote/audio/core/task.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02c931d5b..57427d39b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Fixes - fix(task): fix wrong train/development split when training with (some) meta-protocols ([#1709](https://github.com/pyannote/pyannote-audio/issues/1709)) +- fix(task): fix metadata preparation with missing validation subset ([@clement-pages](https://github.com/clement-pages/)) ### Improvements diff --git a/pyannote/audio/core/task.py b/pyannote/audio/core/task.py index 974f43a67..04c73ab51 100644 --- a/pyannote/audio/core/task.py +++ b/pyannote/audio/core/task.py @@ -595,7 +595,9 @@ def prepare_data(self): prepared_data["metadata-labels"] = np.array(unique_labels, dtype=np.str_) unique_labels.clear() - self.prepare_validation(prepared_data) + if self.has_validation: + self.prepare_validation(prepared_data) + self.post_prepare_data(prepared_data) # save prepared data on the disk