From 4f87e0b8f850706dc39ded2eca54aa574ed46e44 Mon Sep 17 00:00:00 2001
From: 雾聪 <wucong.lyb@alibaba-inc.com>
Date: 星期二, 29 十月 2024 15:06:40 +0800
Subject: [PATCH] update readme

---
 funasr/utils/timestamp_tools.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/funasr/utils/timestamp_tools.py b/funasr/utils/timestamp_tools.py
index 369dc1b..995e179 100644
--- a/funasr/utils/timestamp_tools.py
+++ b/funasr/utils/timestamp_tools.py
@@ -84,7 +84,8 @@
         timestamp_list.append([_end * TIME_RATE, num_frames * TIME_RATE])
         new_char_list.append("<sil>")
     else:
-        timestamp_list[-1][1] = num_frames * TIME_RATE
+        if len(timestamp_list)>0:
+            timestamp_list[-1][1] = num_frames * TIME_RATE
     if vad_offset:  # add offset time in model with vad
         for i in range(len(timestamp_list)):
             timestamp_list[i][0] = timestamp_list[i][0] + vad_offset / 1000.0

--
Gitblit v1.9.1