icefall icon indicating copy to clipboard operation
icefall copied to clipboard

[Help wanted] Exporting updated zipformer to ONNX

Open csukuangfj opened this issue 1 year ago • 3 comments

https://github.com/k2-fsa/icefall/pull/1058 adds updated zipformer.

However, we only have torch.jit.script() support for it at present.

We need to export it to onnx so that it can be used in sherpa-onnx

Help from the community is highly appreciated.

The task

We need to support both streaming and non-streaming versions. Specifically, for the streaming version, we need to add the following files:

  • export-onnx.py, (See also https://github.com/k2-fsa/icefall/blob/master/egs/librispeech/ASR/pruned_transducer_stateless7_streaming/export-onnx.py)
  • onnx_pretrained.py, (See also https://github.com/k2-fsa/icefall/blob/master/egs/librispeech/ASR/pruned_transducer_stateless7_streaming/onnx_pretrained.py)

Please also have a look at https://github.com/k2-fsa/icefall/blob/master/egs/librispeech/ASR/zipformer/export.py

For the non-streaming version, we need to do similar things.

The non-streaming version is easier since it does not need to consider the intermediate states of the model.

TODO

  • [ ] Support non-streaming zipformer
  • [ ] Support streaming zipformer

csukuangfj avatar May 24 '23 09:05 csukuangfj

I wanna have a try :) Hope I could finish this task in half a month

kakashidan avatar May 26 '23 11:05 kakashidan

I wanna have a try :)

Hope I could finish this task in half a month

Thanks!

csukuangfj avatar May 26 '23 14:05 csukuangfj

@kakashidan Thanks for trying. I hope you can complete the task successfully and earlier. All the best.

kafan1986 avatar May 26 '23 18:05 kafan1986