Update iterable_dataset.py

This commit is contained in:
hnluo 2023-03-10 20:09:47 +08:00 committed by GitHub
parent 2b9d6e819e
commit fa1df90827
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -244,10 +244,14 @@ class IterableESPnetDataset(IterableDataset):
array = torchaudio.transforms.Resample(orig_freq=audio_fs, array = torchaudio.transforms.Resample(orig_freq=audio_fs,
new_freq=model_fs)(array) new_freq=model_fs)(array)
array = array.numpy() array = array.numpy()
if self.mc:
data[name] = array.transpose(0, 1) if _type == "sound":
if self.mc:
data[name] = array.transpose(0, 1)
else:
data[name] = array[0]
else: else:
data[name] = array[0] data[name] = array
if self.preprocess is not None: if self.preprocess is not None:
data = self.preprocess(uid, data) data = self.preprocess(uid, data)