lingji-yidong
2024-06-28 c880db53646ab9fd26417f4baf004ab44cc24e1a
Fix: Return tuple ('', []) when char_list is empty to prevent ValueError (#1857)

This commit fixes an issue where an empty char_list causes a ValueError due to insufficient values to unpack. The function now returns a tuple ('', []) when char_list is empty.
1个文件已修改
2 ■■■ 已修改文件
runtime/python/onnxruntime/funasr_onnx/utils/timestamp_utils.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
runtime/python/onnxruntime/funasr_onnx/utils/timestamp_utils.py
@@ -7,7 +7,7 @@
def time_stamp_lfr6_onnx(us_cif_peak, char_list, begin_time=0.0, total_offset=-1.5):
    if not len(char_list):
        return []
        return "", []
    START_END_THRESHOLD = 5
    MAX_TOKEN_DURATION = 30
    TIME_RATE = 10.0 * 6 / 1000 / 3  #  3 times upsampled