bug fix for onnx infer

This commit is contained in:
维石 2024-07-26 11:40:23 +08:00
parent af1c0d0e30
commit 874ed3aaac
2 changed files with 6 additions and 0 deletions

View File

@ -158,6 +158,9 @@ class SenseVoiceSmall:
feats, feats_len = self.extract_feat(waveform_list[beg_idx:end_idx])
_language_list = language_list[beg_idx:end_idx]
_textnorm_list = textnorm_list[beg_idx:end_idx]
if not len(_language_list):
_language_list = [language_list[0]]
_textnorm_list = [textnorm_list[0]]
B = feats.shape[0]
if len(_language_list) == 1 and B != 1:
_language_list = _language_list * B

View File

@ -165,6 +165,9 @@ class SenseVoiceSmall:
feats, feats_len = self.extract_feat(waveform_list[beg_idx:end_idx])
_language_list = language_list[beg_idx:end_idx]
_textnorm_list = textnorm_list[beg_idx:end_idx]
if not len(_language_list):
_language_list = [language_list[0]]
_textnorm_list = [textnorm_list[0]]
B = feats.shape[0]
if len(_language_list) == 1 and B != 1:
_language_list = _language_list * B