You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
funasr_onnx and funasr_torch SenseVoiceSmall ignore use_itn: use_itn=True still sends the woitn query #3859
SenseVoiceSmall.__call__ in runtime/python/onnxruntime/funasr_onnx/sensevoice_bin.py (line 155) and runtime/python/libtorch/funasr_torch/sensevoice_bin.py (line 150) reads only the textnorm keyword:
textnorm_input=kwargs.get("textnorm", "woitn")
use_itn is never read. So model(wav_or_scp, language="auto", use_itn=True) sends the woitn query (15), the same as use_itn=False. That is the call in runtime/python/onnxruntime/demo_sencevoice_small.py, runtime/python/libtorch/demo_sensevoice_small.py, examples/industrial_data_pretraining/sense_voice/demo_onnx.py and demo_libtorch.py, and in the ONNX and Libtorch sections of the SenseVoice README (also README_zh.md and README_ja.md). The README describes use_itn as "Whether the output result includes punctuation and inverse text normalization". SenseVoiceSmall.inference (AutoModel) sends the withitn query (14) for use_itn=True, as the C++ runtime does for svs_itn (default true).
Repro without model files, from the repository root with PYTHONPATH=runtime/python/onnxruntime (the same with funasr_torch and PYTHONPATH=runtime/python/libtorch):
fromfunasr_onnximportSenseVoiceSmallclassStop(Exception):
passdefread_tags(language_input, textnorm_input): # the first step of __call__print(textnorm_input)
raiseStopmodel=SenseVoiceSmall.__new__(SenseVoiceSmall) # skip loading the model filesmodel.read_tags=read_tagsforkwargsin ({}, {"use_itn": False}, {"use_itn": True}, {"textnorm": "withitn"}):
try:
model("en.mp3", language="auto", **kwargs)
exceptStop:
pass
Expected: withitn on the third line (use_itn=True).
This is a regression from 925910c ("update onnx batch inference"). The use_itn=True call came with aa3fe1a and c5f7f11, which made both wrappers read use_itn like SenseVoiceSmall.inference; the next day, 925910c replaced that with the textnorm list/file reader and dropped use_itn. Passing textnorm="withitn" works around it.
Environment: Windows 11, Python 3.11.17, onnxruntime 1.23.2, torch 2.10.0+cpu; funasr_onnx and funasr_torch from runtime/python on main.
Activity