opentts-uk / add_audio_field.py
Yehor Smoliakov
Sync
3efa218
raw
history blame
336 Bytes
from datasets import load_dataset, Audio
dataset = load_dataset('json', data_files="train.jsonl")
print(dataset)
dataset_audio = dataset.cast_column(
"audio", Audio(sampling_rate=48_000, mono=True, decode=True)
)
print(dataset_audio)
train_set = dataset_audio['train']
train_set.to_parquet("train.parquet")
print(train_set[1])