From 1fae1033266dfcf0a01d71411525dd30c5629dc9 Mon Sep 17 00:00:00 2001 From: slin000111 Date: Wed, 17 Sep 2025 17:49:43 +0800 Subject: [PATCH 1/3] fix prefix concatenation in timestamp post-processing for sensevoice --- funasr/models/sense_voice/model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/funasr/models/sense_voice/model.py b/funasr/models/sense_voice/model.py index 38943a231..2567b788a 100644 --- a/funasr/models/sense_voice/model.py +++ b/funasr/models/sense_voice/model.py @@ -980,6 +980,7 @@ def post(self, timestamp): words_new.append(word) elif prev_word is not None and prev_word.isalpha() and prev_word.isascii() and word.isalpha() and word.isascii(): prev_word += word + word = prev_word timestamp_new[-1][1] = end words_new[-1] = prev_word else: From e94ed5b6f1bdbd4736a2acbcaf216d1a35268fdb Mon Sep 17 00:00:00 2001 From: slin000111 Date: Wed, 17 Sep 2025 18:57:31 +0800 Subject: [PATCH 2/3] Remove unnecessary code --- funasr/models/sense_voice/model.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/funasr/models/sense_voice/model.py b/funasr/models/sense_voice/model.py index 2567b788a..6a291813e 100644 --- a/funasr/models/sense_voice/model.py +++ b/funasr/models/sense_voice/model.py @@ -979,10 +979,9 @@ def post(self, timestamp): timestamp_new.append([start, end]) words_new.append(word) elif prev_word is not None and prev_word.isalpha() and prev_word.isascii() and word.isalpha() and word.isascii(): - prev_word += word - word = prev_word + word = prev_word + word timestamp_new[-1][1] = end - words_new[-1] = prev_word + words_new[-1] = word else: # timestamp_new[-1][0] += word timestamp_new.append([start, end]) From 378a9ba81108cfbfbaad24d1cc6a031331716740 Mon Sep 17 00:00:00 2001 From: slin000111 Date: Thu, 12 Feb 2026 14:51:39 +0800 Subject: [PATCH 3/3] Fixed a compatibility issue with the timestamp format for fun-asr-nano. --- funasr/auto/auto_model.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/funasr/auto/auto_model.py b/funasr/auto/auto_model.py index 9bf1ad57e..64b77c2bc 100644 --- a/funasr/auto/auto_model.py +++ b/funasr/auto/auto_model.py @@ -555,8 +555,12 @@ def inference_with_vad(self, input, input_len=None, **cfg): if k not in result: result[k] = [] for t in restored_data[j][k]: - t[0] += vadsegments[j][0] - t[1] += vadsegments[j][0] + if isinstance(t, dict): + t["start_time"] = (t["start_time"] * 1000 + vadsegments[j][0]) / 1000 + t["end_time"] = (t["end_time"] * 1000 + vadsegments[j][0]) / 1000 + else: + t[0] += vadsegments[j][0] + t[1] += vadsegments[j][0] result[k].extend(restored_data[j][k]) elif k == "spk_embedding": if k not in result: