Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ct-punc模型使用onnx推理无法生成英文标点 #2120

Open
Yikai-Liao opened this issue Oct 5, 2024 · 0 comments
Open

ct-punc模型使用onnx推理无法生成英文标点 #2120

Yikai-Liao opened this issue Oct 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Yikai-Liao
Copy link

🐛 Bug

直接使用AutoModel 加载ct-punc 模型可以正确地为英文句子生成英文标点,但是按照教程使用funasr_onnx中的CT_Transformer无法生成英文标点。

To Reproduce

AutoModel 正常生成英文标点

from funasr import AutoModel
model = AutoModel(model="ct-punc")
model.generate(input='Hello world')
# [{'key': 'rand_key_2yW4Acq9GFz6Y',
#  'text': ' Hello world.',
#  'punc_array': tensor([1, 2])}]

导出onnx模型

funasr-export ++model=ct-punc ++quantize=true ++device=cpu

运行onnx模型,此时只能生成中文标点

from funasr_onnx import Paraformer, CT_Transformer
model = CT_Transformer("exported_model_dir")
model("Hello world")
# ('Hello world。', [1, 3])

Expected behavior

期望onnx版本也能生成英文标点

Environment

  • Linux
  • FunASR Version (1.1.9)
  • PyTorch Version (2.4.1)
  • How you installed funasr (pip):
  • Python version: 3.10
  • GPU (No)
  • CPU( AMD 8845h)
@Yikai-Liao Yikai-Liao added the bug Something isn't working label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant