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 split-layout Transformers checkpoint
Browse filesPublish the checkpoint and processor artifacts validated for huggingface/transformers#46180. The model loads with zero missing, unexpected, or mismatched keys and passes the H100 English transcription quickstart. Also replace the stale preprocessor config and add model-card usage instructions.
Files changed (8)
- README.md+33-4
- config.json+11-10
- generation_config.jsonAdded+9
- model.safetensors+2-2
- preprocessor_config.jsonDeleted-12
- processor_config.json+19-5
- tokenizer.json+2-2
- tokenizer_config.json+9-217
33 unmodified lines343536373839404142434433 unmodified lines</div># Fun-ASR-Nano (HuggingFace Transformers)This is the HuggingFace Transformers-compatible version of [Fun-ASR-Nano-2512](https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512).Fun-ASR-Nano is an end-to-end speech recognition model by [FunAudioLLM](https://github.com/FunAudioLLM), trained on tens of millions of hours of real speech data. It supports multilingual speech recognition covering Chinese (with dialects), English, Japanese, Korean, and many more languages.For full documentation, benchmarks, and usage instructions, please refer to the [main model card](https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512).33 unmodified lines3435363738394041424344454647484950515253545556575859606162636465666768697071727333 unmodified lines</div># Fun-ASR-Nano (Hugging Face Transformers)This is the Hugging Face Transformers-compatible version of [Fun-ASR-Nano-2512](https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512).Fun-ASR-Nano is an end-to-end speech recognition model by [FunAudioLLM](https://github.com/FunAudioLLM), trained on tens of millions of hours of real speech data. It supports multilingual speech recognition covering Chinese (with dialects), English, Japanese, Korean, and many more languages.## Transformers quickstartFun-ASR-Nano support is being added to Transformers in [huggingface/transformers#46180](https://github.com/huggingface/transformers/pull/46180). Until it is included in a Transformers release, use a build containing that PR.```pythonimport torchfrom transformers import AutoModelForSpeechSeq2Seq, AutoProcessormodel_id = "FunAudioLLM/Fun-ASR-Nano-2512-hf"processor = AutoProcessor.from_pretrained(model_id)model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id,dtype=torch.bfloat16,device_map="auto",)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)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])```Expected transcription:```textThe 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).
123456789101112131415161718192021222363 unmodified lines8788899091{"adaptor_attention_heads": 8,"adaptor_downsample_rate": 1,"adaptor_dropout_rate": 0.0,"adaptor_ffn_dim": 2048,"adaptor_num_layers": 2,"architectures": ["FunAsrNanoForConditionalGeneration"],"audio_encoder_config": {"attention_dropout_rate": 0.1,"attention_heads": 4,"dropout_rate": 0.1,"initializer_range": 0.02,"input_size": 560,"kernel_size": 11,"linear_units": 2048,"model_type": "fun_asr_nano_encoder","num_blocks": 50,"output_size": 512,"sanm_shift": 0,"tp_blocks": 20},63 unmodified lines"use_sliding_window": false,"vocab_size": 151936},"transformers_version": "5.13.0.dev0"}123456789101112131415161718192021222363 unmodified lines878889909192{"adaptor_downsample_rate": 1,"adaptor_dropout": 0.0,"adaptor_intermediate_size": 2048,"adaptor_num_attention_heads": 8,"adaptor_num_hidden_layers": 2,"architectures": ["FunAsrNanoForConditionalGeneration"],"audio_encoder_config": {"attention_dropout": 0.0,"dropout": 0.1,"encoder_layers": 50,"initializer_range": 0.02,"input_size": 560,"intermediate_size": 2048,"kernel_size": 11,"model_type": "fun_asr_nano_encoder","num_attention_heads": 4,"output_dim": 512,"sanm_shift": 0,"tp_blocks": 20},63 unmodified lines"use_sliding_window": false,"vocab_size": 151936},"tie_word_embeddings": true,"transformers_version": "5.13.0.dev0"}
123456789{ "_from_model_config": true, "bos_token_id": 151643, "eos_token_id": 151645, "output_attentions": false, "output_hidden_states": false, "transformers_version": "5.13.0.dev0", "use_cache": true}123version https://git-lfs.github.com/spec/v1oid sha256:d6ff80cd0dc665baf82adac89f68b788e56c75815351c46227366ae3791bdd7fsize 1970908640123version https://git-lfs.github.com/spec/v1oid sha256:bc11982f1cb33c77c21208365d3a1a19cf103cf4a0b1cab96684b70728b231absize 1659742664
123456789101112{ "feature_extractor_type": "FunAsrNanoFeatureExtractor", "feature_size": 80, "sampling_rate": 16000, "frame_length": 25, "frame_shift": 10, "lfr_m": 7, "lfr_n": 6, "window": "hamming", "padding_value": 0.0, "return_attention_mask": true}123456{"processor_class": "FunAsrNanoProcessor","auto_map": {"AutoProcessor": "processing_fun_asr_nano.FunAsrNanoProcessor"}}1234567891011121314151617181920{"audio_downsample_rate": 1,"audio_token": "<|object_ref_start|>","default_transcription_prompt": "Transcribe the audio:","feature_extractor": {"feature_extractor_type": "FunAsrNanoFeatureExtractor","feature_size": 80,"frame_length": 25,"frame_shift": 10,"lfr_m": 7,"lfr_n": 6,"padding_side": "right","padding_value": 0.0,"preemphasis": 0.97,"return_attention_mask": true,"sampling_rate": 16000},"max_audio_len": null,"processor_class": "FunAsrNanoProcessor"}
123version https://git-lfs.github.com/spec/v1oid sha256:aeb13307a71acd8fe81861d94ad54ab689df773318809eed3cbe794b4492dae4size 11422654123version https://git-lfs.github.com/spec/v1oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506size 11422650
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162178 unmodified lines226227228229230231232233234235236237238{"add_bos_token": false,"add_prefix_space": false,"added_tokens_decoder": {"151643": {"content": "<|endoftext|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151644": {"content": "<|im_start|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151645": {"content": "<|im_end|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151646": {"content": "<|object_ref_start|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151647": {"content": "<|object_ref_end|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151648": {"content": "<|box_start|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151649": {"content": "<|box_end|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151650": {"content": "<|quad_start|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151651": {"content": "<|quad_end|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151652": {"content": "<|vision_start|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151653": {"content": "<|vision_end|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151654": {"content": "<|vision_pad|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151655": {"content": "<|image_pad|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151656": {"content": "<|video_pad|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": true},"151657": {"content": "<tool_call>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"151658": {"content": "</tool_call>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"151659": {"content": "<|fim_prefix|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"151660": {"content": "<|fim_middle|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"151661": {"content": "<|fim_suffix|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"151662": {"content": "<|fim_pad|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"151663": {"content": "<|repo_name|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"151664": {"content": "<|file_sep|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"151665": {"content": "<tool_response>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"151666": {"content": "</tool_response>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"151667": {"content": "<think>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false},"151668": {"content": "</think>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false,"special": false}},"additional_special_tokens": ["<|im_start|>","<|im_end|>","<|object_ref_start|>",8 unmodified lines"<|image_pad|>","<|video_pad|>"],"bos_token": null,"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}","clean_up_tokenization_spaces": false,"eos_token": "<|im_end|>","errors": "replace","model_max_length": 131072,"pad_token": "<|endoftext|>","split_special_tokens": false,"tokenizer_class": "Qwen2Tokenizer","unk_token": null12345678910118 unmodified lines2021222324252627282930{"add_prefix_space": false,"backend": "tokenizers","bos_token": null,"clean_up_tokenization_spaces": false,"eos_token": "<|im_end|>","errors": "replace","extra_special_tokens": ["<|im_start|>","<|im_end|>","<|object_ref_start|>",8 unmodified lines"<|image_pad|>","<|video_pad|>"],"is_local": true,"local_files_only": false,"model_max_length": 131072,"pad_token": "<|endoftext|>","processor_class": "FunAsrNanoProcessor","split_special_tokens": false,"tokenizer_class": "Qwen2Tokenizer","unk_token": null
README.md+33-4
config.json+11-10
generation_config.jsonAdded+9
model.safetensors+2-2
preprocessor_config.jsonDeleted-12
processor_config.json+19-5
tokenizer.json+2-2
tokenizer_config.json+9-217