Merge branch 'main' of github.com:alibaba-damo-academy/FunASR

merge
This commit is contained in:
游雁 2024-02-29 10:04:13 +08:00
commit 429bc77c03

View File

@ -392,6 +392,7 @@ class AutoModel:
# step.3 compute punc model # step.3 compute punc model
if self.punc_model is not None: if self.punc_model is not None:
if not len(result["text"]): if not len(result["text"]):
if return_raw_text:
result['raw_text'] = '' result['raw_text'] = ''
else: else:
self.punc_kwargs.update(cfg) self.punc_kwargs.update(cfg)
@ -434,6 +435,9 @@ class AutoModel:
distribute_spk(sentence_list, sv_output) distribute_spk(sentence_list, sv_output)
result['sentence_info'] = sentence_list result['sentence_info'] = sentence_list
elif kwargs.get("sentence_timestamp", False): elif kwargs.get("sentence_timestamp", False):
if not len(result['text']):
sentence_list = []
else:
sentence_list = timestamp_sentence(punc_res[0]['punc_array'], sentence_list = timestamp_sentence(punc_res[0]['punc_array'],
result['timestamp'], result['timestamp'],
raw_text, raw_text,