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")# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("FunAudioLLM/Fun-ASR-Nano-2512-hf", dtype="auto") - Notebooks
- Google Colab
- Kaggle
⭐ Powered by FunASR — please give us a GitHub Star!
This model is part of the FunASR ecosystem — one industrial-grade open-source toolkit for ASR · VAD · punctuation · speaker diarization · emotion / event · LLM-ASR. A Star really helps the project (and keeps you updated):
Fun-ASR-Nano (Hugging Face Transformers)
This is the Hugging Face Transformers-compatible version of Fun-ASR-Nano-2512.
Fun-ASR-Nano is an end-to-end speech recognition model by 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 quickstart
Fun-ASR-Nano support is being added to Transformers in huggingface/transformers#46180. Until it is included in a Transformers release, use a build containing that PR.
import torch
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor
model_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:
The 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 and the original model card.
- Downloads last month
- 782