From 3fe404268c19f27f053c29ec59ec34e2e9b32c28 Mon Sep 17 00:00:00 2001 From: Marco Bazzani Date: Thu, 10 Aug 2023 12:04:17 -0700 Subject: [PATCH] Fix #144 --- pyha_analyzer/dataset.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pyha_analyzer/dataset.py b/pyha_analyzer/dataset.py index 0271011..0f18aa8 100644 --- a/pyha_analyzer/dataset.py +++ b/pyha_analyzer/dataset.py @@ -192,15 +192,16 @@ def serialize_data(self) -> None: files = files["files"].progress_apply(self.process_audio_file) logger.debug("%s", str(files.shape)) - num_files = files.shape[0] - if num_files == 0: - raise FileNotFoundError("There were no valid filepaths found, check csv") - files = files[files["files"] != "bad"] self.samples = self.samples.merge(files, how="left", left_on=cfg.file_name_col, right_on="FILE NAME").dropna() + num_files = files.shape[0] + if num_files == 0: + raise FileNotFoundError("There were no valid filepaths found, check csv") + + logger.debug("Serialized form, fixed size: %s", str(self.samples.shape)) if "files" in self.samples.columns: