Skip to content

Commit

Permalink
feat: throw exception when there is no valid data
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuqiao committed Jul 10, 2024
1 parent 6ff83bf commit 584d6b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/g2p/base_g2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def get_dataset(self, wav_paths):
except Exception as e:
e.args = (f" Error when processing {wav_path}: {e} ",)
raise e
if len(dataset) <= 0:
raise ValueError("No valid data found.")
print(f"Loaded {len(dataset)} samples.")

dataset = pd.DataFrame(
dataset, columns=["wav_path", "ph_seq", "word_seq", "ph_idx_to_word_idx"]
)
Expand Down

0 comments on commit 584d6b9

Please sign in to comment.