NeMo icon indicating copy to clipboard operation
NeMo copied to clipboard

export model

Open baduyne opened this issue 3 months ago • 6 comments

Hi everyone, I recently encounter an issue when using model on mobile app. To be specific, I want to export the nvidia/diar_sortformer_4spk-v1 to onnx, TF lite, but all thing are fail. Thank you for considering my matter

baduyne avatar Sep 15 '25 18:09 baduyne

This is an AI-generated response. Please verify.

To export the nvidia/diar_sortformer_4spk-v1 model for mobile use, you have partial support through ONNX but no direct path to TF Lite.

The model supports ONNX export through its built-in streaming_export method:

model = SortformerEncLabelModel.from_pretrained("nvidia/diar_sortformer_4spk-v1")
model.streaming_export("output_model.onnx")

However, there's no direct TF Lite export functionality in NeMo. You would need to:

  1. Export to ONNX format first
  2. Use external conversion tools like ONNX Runtime or TensorFlow's ONNX-to-TFLite converter

This workflow isn't documented specifically for diarization models, suggesting it may not be fully supported. The model architecture is complex with multiple components (encoder, transformer encoder, sortformer modules) which can make conversion challenging.

For mobile deployment, you might need to:

  • Simplify the model architecture
  • Handle conversion issues manually
  • Consider using ONNX Runtime Mobile instead of TF Lite

I recommend exploring ONNX export first, then evaluating if the resulting model can be further converted to TF Lite.

decimal-agent avatar Sep 15 '25 20:09 decimal-agent

Hi. Currently we are not supporting speaker diarization models with ONNX export.

tango4j avatar Oct 25 '25 00:10 tango4j

Are you planning to release ONNX export support?

dhtheuno avatar Nov 03 '25 02:11 dhtheuno

Hi @baduyne @dhtheuno, the issue was discussed and solved here, please take a look.

ipmedenn avatar Nov 24 '25 09:11 ipmedenn

Hi! You can download the ONNX model here: https://huggingface.co/altunenes/parakeet-rs/tree/main Both v1 and v2 models are available, but I suggest you use v2 since v1 consumes too much RAM. usage (v2): https://github.com/altunenes/parakeet-rs

Since I thought it was pointless to use V1 when V2 was available, I removed V1, but if you really think you need it, you can probably figure it out by looking at the diffs in the PR :-) https://github.com/altunenes/parakeet-rs/pull/23/files

altunenes avatar Nov 25 '25 15:11 altunenes

Hi! You can download the ONNX model here: https://huggingface.co/altunenes/parakeet-rs/tree/main Both v1 and v2 models are available, but I suggest you use v2 since v1 consumes too much RAM. usage (v2): https://github.com/altunenes/parakeet-rs

Since I thought it was pointless to use V1 when V2 was available, I removed V1, but if you really think you need it, you can probably figure it out by looking at the diffs in the PR :-) https://github.com/altunenes/parakeet-rs/pull/23/files

nice work~could you also provide the exporting script please?

chibslee avatar Dec 04 '25 02:12 chibslee