hnluo
2023-03-10 2b9d6e819e9955227186ed59fa93676581d637a3
Update iterable_dataset.py
1个文件已修改
10 ■■■■■ 已修改文件
funasr/datasets/iterable_dataset.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/datasets/iterable_dataset.py
@@ -243,10 +243,11 @@
                        array = torch.from_numpy(array)
                        array = torchaudio.transforms.Resample(orig_freq=audio_fs,
                                                               new_freq=model_fs)(array)
                        array = array.numpy()
                if self.mc:
                    data[name] = array.transpose(0, 1).numpy()
                    data[name] = array.transpose(0, 1)
                else:
                    data[name] = array[0].numpy()
                    data[name] = array[0]
                if self.preprocess is not None:
                    data = self.preprocess(uid, data)
@@ -346,11 +347,12 @@
                            array = torch.from_numpy(array)
                            array = torchaudio.transforms.Resample(orig_freq=audio_fs,
                                                                   new_freq=model_fs)(array)
                            array = array.numpy()
                    if _type == "sound":
                        if self.mc:
                            data[name] = array.transpose(0, 1).numpy()
                            data[name] = array.transpose(0, 1)
                        else:
                            data[name] = array[0].numpy()
                            data[name] = array[0]
                    else:
                        data[name] = array
                if self.non_iterable_dataset is not None: