From 5608bee0accea5e12030f8e1b6f7d62eee4dd892 Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期五, 01 三月 2024 18:36:40 +0800
Subject: [PATCH] fixbug (#1412)

---
 funasr/models/llm_asr_nar/model.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/funasr/models/llm_asr_nar/model.py b/funasr/models/llm_asr_nar/model.py
index 6a4ecce..db81c47 100644
--- a/funasr/models/llm_asr_nar/model.py
+++ b/funasr/models/llm_asr_nar/model.py
@@ -315,7 +315,10 @@
         model_outputs = self.llm(inputs_embeds=inputs_embeds, attention_mask=attention_mask, labels=None)
         preds = torch.argmax(model_outputs.logits, -1)
         text = tokenizer.batch_decode(preds, add_special_tokens=False, skip_special_tokens=True)
-        text = text[0].split(': \n')[-1]
+
+        text = text[0].split(': ')[-1]
+        text = text.strip()
+        
         # preds = torch.argmax(model_outputs.logits, -1)
         
         ibest_writer = None

--
Gitblit v1.9.1