hnluo
2023-02-13 76562973653d20469bd3d0cbc972ba2674093305
Merge pull request #101 from alibaba-damo-academy/dev_lhn

Dev lhn
1个文件已修改
7 ■■■■ 已修改文件
funasr/datasets/large_datasets/dataset.py 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/datasets/large_datasets/dataset.py
@@ -1,9 +1,10 @@
import os
import random
import soundfile
import numpy
from functools import partial
import torch
import torchaudio
import torch.distributed as dist
from kaldiio import ReadHelper
from torch.utils.data import IterableDataset
@@ -117,7 +118,9 @@
                            sample_dict["key"] = key
                    elif data_type == "sound":
                        key, path = item.strip().split()
                        mat, sampling_rate = soundfile.read(path)
                        waveform, sampling_rate = torchaudio.load(path)
                        waveform = waveform.numpy()
                        mat = waveform[0]
                        sample_dict[data_name] = mat
                        sample_dict["sampling_rate"] = sampling_rate
                        if data_name == "speech":