Instructions to use nvidia/canary-1b-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- NeMo
How to use nvidia/canary-1b-v2 with NeMo:
import nemo.collections.asr as nemo_asr asr_model = nemo_asr.models.ASRModel.from_pretrained("nvidia/canary-1b-v2") transcriptions = asr_model.transcribe(["file.wav"]) - Notebooks
- Google Colab
- Kaggle
Add `{% generation %}` blocks to the chat template for training
This PR wraps the assistant turns of the chat template in {% generation %} ... {% endgeneration %} blocks. The rendered text is unchanged (checked on single- and multi-turn conversations, with and without a generation prompt).
These blocks let apply_chat_template(..., return_assistant_tokens_mask=True) return a mask of the assistant tokens, so that only the assistant turn (the transcription) contributes to the loss during training, e.g. with processor.apply_transcription_request(audio, transcription=...) in Transformers, or assistant_only_loss=True in TRL. Without these blocks, Transformers raises an error when an assistant mask is requested (https://github.com/huggingface/transformers/pull/49870).
Same convention as Qwen/Qwen3-ASR-1.7B-hf.