Instructions to use FunAudioLLM/Fun-ASR-Nano-2512-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FunAudioLLM/Fun-ASR-Nano-2512-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="FunAudioLLM/Fun-ASR-Nano-2512-hf")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("FunAudioLLM/Fun-ASR-Nano-2512-hf") model = AutoModelForMultimodalLM.from_pretrained("FunAudioLLM/Fun-ASR-Nano-2512-hf", device_map="auto") - 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.