From 6161129cceb9492889b50b66ce83a483b3002036 Mon Sep 17 00:00:00 2001
From: 雾聪 <wucong.lyb@alibaba-inc.com>
Date: 星期一, 09 十月 2023 16:21:33 +0800
Subject: [PATCH] fix postprocess for en-bpe

---
 funasr/runtime/onnxruntime/src/vocab.cpp |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/funasr/runtime/onnxruntime/src/vocab.cpp b/funasr/runtime/onnxruntime/src/vocab.cpp
index 95174c7..3f51911 100644
--- a/funasr/runtime/onnxruntime/src/vocab.cpp
+++ b/funasr/runtime/onnxruntime/src/vocab.cpp
@@ -163,6 +163,13 @@
         }
     }
 
+    if (language == "en-bpe" and combine != ""){
+        if (words.size() != 0){
+            combine = " " + combine;
+        }
+        words.push_back(combine);
+    }
+
     stringstream ss;
     for (auto it = words.begin(); it != words.end(); it++) {
         ss << *it;

--
Gitblit v1.9.1