Merge pull request #1928 from liugz18/main

Rename 'res' in line 514 to avoid with naming conflict with line 365
This commit is contained in:
Shi Xian 2024-07-22 11:32:39 +08:00 committed by GitHub
commit e09d87193b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -511,8 +511,8 @@ class AutoModel:
sv_output = postprocess(all_segments, None, labels, spk_embedding.cpu())
if self.spk_mode == "vad_segment": # recover sentence_list
sentence_list = []
for res, vadsegment in zip(restored_data, vadsegments):
if "timestamp" not in res:
for rest, vadsegment in zip(restored_data, vadsegments):
if "timestamp" not in rest:
logging.error(
"Only 'iic/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch' \
and 'iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch'\
@ -522,8 +522,8 @@ class AutoModel:
{
"start": vadsegment[0],
"end": vadsegment[1],
"sentence": res["text"],
"timestamp": res["timestamp"],
"sentence": rest["text"],
"timestamp": rest["timestamp"],
}
)
elif self.spk_mode == "punc_segment":