Skip to content

Commit

Permalink
Fix #144
Browse files Browse the repository at this point in the history
  • Loading branch information
mbazzani committed Aug 10, 2023
1 parent 2c02f45 commit 3fe4042
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pyha_analyzer/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3fe4042

Please sign in to comment.