export model
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
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:
- Export to ONNX format first
- 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.
Hi. Currently we are not supporting speaker diarization models with ONNX export.
Are you planning to release ONNX export support?
Hi @baduyne @dhtheuno, the issue was discussed and solved here, please take a look.
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
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?