From 05c8eba11c51ca928eee9c041de1a4192e590aec Mon Sep 17 00:00:00 2001
From: nianjiuhuiyi <64776403+nianjiuhuiyi@users.noreply.github.com>
Date: 星期五, 27 六月 2025 09:57:45 +0800
Subject: [PATCH] Fix: 修复c++后端服务因为空数组的异常退出,以及c++的http服务在收到Ctrl+C信号后无法正常退出 (#2571)
---
funasr/bin/tokenize_text.py | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/funasr/bin/tokenize_text.py b/funasr/bin/tokenize_text.py
index 674c1b9..8c2aae0 100755
--- a/funasr/bin/tokenize_text.py
+++ b/funasr/bin/tokenize_text.py
@@ -11,7 +11,7 @@
from funasr.utils.cli_utils import get_commandline_args
from funasr.tokenizer.build_tokenizer import build_tokenizer
from funasr.tokenizer.cleaner import TextCleaner
-from funasr.tokenizer.phoneme_tokenizer import g2p_choices
+from funasr.tokenizer.phoneme_tokenizer import g2p_classes
from funasr.utils.types import str2bool
from funasr.utils.types import str_or_none
@@ -133,7 +133,7 @@
if not write_vocabulary:
return
-
+
## FIXME
## del duplicate add_symbols in counter
for symbol_and_id in add_symbol:
@@ -197,12 +197,8 @@
help="The verbose level of logging",
)
- parser.add_argument(
- "--input", "-i", required=True, help="Input text. - indicates sys.stdin"
- )
- parser.add_argument(
- "--output", "-o", required=True, help="Output text. - indicates sys.stdout"
- )
+ parser.add_argument("--input", "-i", required=True, help="Input text. - indicates sys.stdin")
+ parser.add_argument("--output", "-o", required=True, help="Output text. - indicates sys.stdout")
parser.add_argument(
"--field",
"-f",
@@ -239,7 +235,7 @@
parser.add_argument(
"--g2p",
type=str_or_none,
- choices=g2p_choices,
+ choices=g2p_classes,
default=None,
help="Specify g2p method if --token_type=phn",
)
--
Gitblit v1.9.1