Yuanhang Zhang
2023-03-21 3b3aebb1247d29894c34c06ab4837c13917e4967
Fix timestamp prediction on empty ASR outputs

_, timestamp = ts_prediction_lfr6_standard(us_alphas[i],
ValueError: not enough values to unpack (expected 2, got 0)

If char_list is empty, we should still return both the text (which is empty string) and the timestamps to fit the function signature.
1个文件已修改
2 ■■■ 已修改文件
funasr/utils/timestamp_tools.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/utils/timestamp_tools.py
@@ -17,7 +17,7 @@
                       sil_in_str=True
                       ):
    if not len(char_list):
        return []
        return "", []
    START_END_THRESHOLD = 5
    MAX_TOKEN_DURATION = 12
    TIME_RATE = 10.0 * 6 / 1000 / 3  #  3 times upsampled