From fce4e1d1b48f23cd8332e60afce3df8d6209a6a7 Mon Sep 17 00:00:00 2001
From: gaochangfeng <54253717+gaochangfeng@users.noreply.github.com>
Date: 星期四, 11 四月 2024 14:59:22 +0800
Subject: [PATCH] SenseVoice对富文本解码的参数 (#1608)

---
 funasr/models/campplus/utils.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/funasr/models/campplus/utils.py b/funasr/models/campplus/utils.py
index 935c674..399be4b 100644
--- a/funasr/models/campplus/utils.py
+++ b/funasr/models/campplus/utils.py
@@ -177,6 +177,9 @@
     return res
 
 def smooth(res, mindur=1):
+    # if only one segment, return directly
+    if len(res) < 2:
+        return res
     # short segments are assigned to nearest speakers.
     for i in range(len(res)):
         res[i][0] = round(res[i][0], 2)

--
Gitblit v1.9.1