mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
Update iterable_dataset.py
This commit is contained in:
parent
2b9d6e819e
commit
fa1df90827
@ -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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user