funasr_onnx and funasr_torch SenseVoiceSmall ignore use_itn: use_itn=True still sends the woitn query
Mantenedores costumam responder em até 1 dia
@tanishqbaweja já está trabalhando nisso.
Desde 8/11/2026.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Domínio
- backend-api-design
Direção de pesquisa
Read runtime/python/onnxruntime/funasr_onnx/sensevoice_bin.py and runtime/python/libtorch/funasr_torch/sensevoice_bin.py, especially the SenseVoiceSmall.__call__ handling of textnorm. The issue provides a model-free reproduction; use it to check the use_itn=True case in both packages. Done means both wrappers send withitn for use_itn=True, consistent with the documented behavior.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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):
from funasr_onnx import SenseVoiceSmall
class Stop(Exception):
pass
def read_tags(language_input, textnorm_input): # the first step of __call__
print(textnorm_input)
raise Stop
model = SenseVoiceSmall.__new__(SenseVoiceSmall) # skip loading the model files
model.read_tags = read_tags
for kwargs in ({}, {"use_itn": False}, {"use_itn": True}, {"textnorm": "withitn"}):
try:
model("en.mp3", language="auto", **kwargs)
except Stop:
pass
Output on main (20f26b7c4), for both packages:
woitn
woitn
woitn
withitn
Expected: withitn on the third line (use_itn=True).
This is a regression from 925910c59 ("update onnx batch inference"). The use_itn=True call came with aa3fe1a35 and c5f7f11b5, which made both wrappers read use_itn like SenseVoiceSmall.inference; the next day, 925910c59 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.
- Linguagem predominante
- Python
- Estrelas
- 21.2k
- Forks
- 2.2k
- Merge médio
- 5h 38min
- PRs com merge (30d)
- 116
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de modelscope/FunASR
-
[Bug] ClusterBackend passes torch.Tensor to UMAP 0.6.0, causing a torch.float32 dtype TypeErrorTalvez já em andamento @hansazilinon-art assumiu há 18 dias. Abertabug needs triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
modelscope/FunASR#3908 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
modelscope/FunASR#3801 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
modelscope/FunASR#3796 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
modelscope/FunASR#3762 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Bug: blank lines in wav.scp / jsonl file lists crash prepare_data_iterator (IndexError / JSONDecodeError)Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaneeds feedback
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
modelscope/FunASR#3757 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de modelscope/FunASR
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
AIR-Bench Foundation reads the first letter of the word after "answer" as the model's choiceTalvez já em andamento @beartester34 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
modelscope/evalscope#2330 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
Distribution plot crashes when a numeric feature is constant in the train or test setTalvez já em andamento @adembilge assumiu hoje. Abertabug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
MAIF/shapash#847 · 1 comentário ·
Mantenedores costumam responder em até 10 dias