Automatic Speech Recognition
Transformers
Safetensors
fun_asr_nano
speech-recognition
asr
end-to-end
multilingual
arxiv:2509.12508
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
Update Transformers quickstart for PR 46180
Browse filesPin the verified rebased PR head, document structured language/context/hotword inputs, and remove the obsolete serialized default prompt field.
Files changed (2)
39 unmodified lines40414243434445469 unmodified lines56575859596061626364656663676869702 unmodified lines737475727677787980818283848586878839 unmodified lines
```bashpython -m pip install accelerate librosa \ "transformers @ https://github.com/huggingface/transformers/archive/d58b6371091473c7bd1486f3147950c6e076ace9.zip" "transformers @ https://github.com/huggingface/transformers/archive/4e199f7990ab38838210fc02726f34f6f25d0097.zip"```
```python9 unmodified lines)
audio_url = "https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512/resolve/main/example/en.mp3"inputs = processor.apply_transcription_request(audio=audio_url, return_tensors="pt").to(model.device)inputs = processor.apply_transcription_request( audio=audio_url, language="en", return_tensors="pt",).to(model.device)
generated_ids = model.generate(**inputs, max_new_tokens=200)generated_ids = generated_ids[:, inputs.input_ids.shape[1] :]print(processor.batch_decode(generated_ids, skip_special_tokens=True)[0])print(processor.decode(generated_ids, skip_special_tokens=True)[0])```
Expected transcription:2 unmodified linesThe tribal chieftain called for the boy, and presented him with fifty pieces of gold.```
For batch inference, training, `torch.compile`, benchmarks, and the full model description, see the [Transformers documentation](https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/fun_asr_nano.md) and the [original model card](https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512).For domain-specific transcription, pass contextual information with `prompt` and hotwords with `keywords`; the checkpoint chat template builds the complete instruction:
```pythoninputs = processor.apply_transcription_request( audio=audio_url, language="en", prompt="A tribal story involving a chieftain and a boy.", keywords=["tribal chieftain", "fifty pieces of gold"], return_tensors="pt",).to(model.device)```
`language` accepts Chinese, English, and Japanese as ISO codes, full English names, or native names. For batch inference, training, `torch.compile`, benchmarks, and the full model description, see the [Transformers documentation](https://github.com/huggingface/transformers/blob/4e199f7990ab38838210fc02726f34f6f25d0097/docs/source/en/model_doc/fun_asr_nano.md) and the [original model card](https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512).123345{ "audio_token": "<|object_ref_start|>", "default_transcription_prompt": "Transcribe the audio:", "feature_extractor": { "feature_extractor_type": "FunAsrNanoFeatureExtractor", "feature_size": 80,README.md+20-4
processor_config.json-1