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.
This commit is contained in:
Yuanhang Zhang 2023-03-21 17:23:26 +08:00 committed by GitHub
parent 4986ec2dd3
commit 3b3aebb124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ def ts_prediction_lfr6_standard(us_alphas,
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