mtmd : add Nemotron 3 Nano Omni support (parakeet)#22520
Conversation
This commit adds support for the subsampling and encoder part of Nemotron Nemo 3 omni model. The Parakeet subsampling/encoder were taken from parakeet.cpp which is currently a pull request against whisper.cpp. I've tried to copy the code a close as possible to hopefully enable easy patching between the these two project later. Refs: ggml-org/whisper.cpp#3735
ngxson
left a comment
There was a problem hiding this comment.
looks good, I'm leaving some early-review comments
This commit removes the generation of the relative positional tensor in the model conversion script and instead computes it in the encoder graph. This is only done for the window of positions required for the current audio sample.
This commit adds a function to get access to the clip_model. It also removes the two functions clip_get_mel_filter_tensor, and clip_get_window_tensor(const struct clip_ctx * ctx) which can now use clip_get_model to access the model tensors that it needs.
…tmd-audio [no ci]
This commit updates the parakeet code in mtmd to reflect the latest updates to parakeet.cpp in whisper.cpp. A follow up commit will address the currently hardcoded dw_pad and see if we can add n_conv_kernel as a model metadata field.
This commit updates the model conversion to read the conv_kernel_size field from the sound_config section of the models config.json file. It then uses this field instead of the hardcoded values in parakeet.cpp.
There was a problem hiding this comment.
side question: is it possible to use the 4th dm of the input as batch dim? (provided that all inputs are the same size - no padding or masking is need)
that may allow batching support in the future, but it's optional
There was a problem hiding this comment.
I'm not sure but I'll take a look 👍
There was a problem hiding this comment.
correction: I meant 3rd dim; input tensor shape is: [nx, ny, n_batch]
There was a problem hiding this comment.
I've looked into this and this should be possible with some changes. I'd be happy to make these changes in a follow up PR when we add batch support, and I'll try to also update parakeet.cpp then to keep both as aligned as possible.
|
@danbev Glad midsommar! :) |
@CISC Tack! 😃 |
Overview
This commit adds support for the subsampling and encoder part of Nemotron Nemo 3 omni model.
Additional information
The Parakeet subsampling/encoder were taken from parakeet.cpp which is currently a pull request against whisper.cpp. I've tried to copy the code as close as possible to hopefully enable easy patching between these two project later.
Refs: ggml-org/whisper.cpp#3735
For testing a converted model can be found here and can be run using the following command:
llama-mtmd-cli -hf danbev/Nemotron-3-Nano-Omni-30B-A3B-Reasoning-BF16-mtmd-GGUF --no-warmup --audio jfk.wav -p "Transcribe this audio clip, only the trancription and nothing else."