Skip to content

Commit 584d6b9

Browse files
committed
feat: throw exception when there is no valid data
1 parent 6ff83bf commit 584d6b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: modules/g2p/base_g2p.py

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ def get_dataset(self, wav_paths):
6060
except Exception as e:
6161
e.args = (f" Error when processing {wav_path}: {e} ",)
6262
raise e
63+
if len(dataset) <= 0:
64+
raise ValueError("No valid data found.")
65+
print(f"Loaded {len(dataset)} samples.")
66+
6367
dataset = pd.DataFrame(
6468
dataset, columns=["wav_path", "ph_seq", "word_seq", "ph_idx_to_word_idx"]
6569
)

0 commit comments

Comments
 (0)