Marlowe
2023-09-01 c29e5071bdb0dea46a7778f3a8a08692458f19f1
fix error:reference before assignment for write_flag when using kaldi_ark (#904)

Co-authored-by: ZihanLiao <liaozihan1@xdf.cn>
1个文件已修改
3 ■■■■ 已修改文件
funasr/utils/prepare_data.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/utils/prepare_data.py
@@ -5,9 +5,9 @@
import kaldiio
import numpy as np
import soundfile
import torch.distributed as dist
import torchaudio
import soundfile
def filter_wav_text(data_dir, dataset):
@@ -87,6 +87,7 @@
                sample_name, feature_path = line.strip().split()
                feature = kaldiio.load_mat(feature_path)
                n_frames, feature_dim = feature.shape
                write_flag = True
                if n_frames > 0 and length_min > 0:
                    write_flag = n_frames >= length_min
                if n_frames > 0 and length_max > 0: