4moha commited on
Commit
e2a94ff
·
verified ·
1 Parent(s): fd92194

Add train_narrator_tts.py

Browse files
Files changed (1) hide show
  1. train_narrator_tts.py +2 -2
train_narrator_tts.py CHANGED
@@ -138,8 +138,8 @@ def prepare_data() -> None:
138
  raw_dir = token_dir / "raw"
139
  raw_dir.mkdir(parents=True, exist_ok=True)
140
 
141
- # No Audio feature, no cast_column — just plain string paths and text
142
- ds = hf_datasets.Dataset.from_dict({"audio_path": wav_paths, "text": texts})
143
  ds.save_to_disk(str(raw_dir))
144
  print(f"Saved dataset -> {raw_dir}")
145
 
 
138
  raw_dir = token_dir / "raw"
139
  raw_dir.mkdir(parents=True, exist_ok=True)
140
 
141
+ # CustomDataset.__getitem__ also reads row["duration"] per sample
142
+ ds = hf_datasets.Dataset.from_dict({"audio_path": wav_paths, "text": texts, "duration": durations})
143
  ds.save_to_disk(str(raw_dir))
144
  print(f"Saved dataset -> {raw_dir}")
145