Support lang/speaker_id columns for kalita11/Hindi-TTS-corpus
Browse files46 unmodified lines47484950515253545550515253545556575859606146 unmodified lines print(f"Loading Hugging Face Dataset: {repo_id}...") ds = load_dataset(repo_id, split="train")
if language and "language" in ds.column_names: ds = ds.filter(lambda x: x["language"] == language) print(f"Filtered by language='{language}': {len(ds)} samples remain.") if speaker and "speaker" in ds.column_names: ds = ds.filter(lambda x: x["speaker"] == speaker) print(f"Filtered by speaker='{speaker}': {len(ds)} samples remain.") lang_col = "language" if "language" in ds.column_names else ("lang" if "lang" in ds.column_names else None) if language and lang_col: ds = ds.filter(lambda x: x[lang_col] == language) print(f"Filtered by {lang_col}='{language}': {len(ds)} samples remain.")
spk_col = "speaker" if "speaker" in ds.column_names else ("speaker_id" if "speaker_id" in ds.column_names else None) if speaker and spk_col: ds = ds.filter(lambda x: x[spk_col] == speaker) print(f"Filtered by {spk_col}='{speaker}': {len(ds)} samples remain.")
self.hf_dataset = ds
data/dataset.py+9-6