FunASR is a fundamental, end-to-end speech recognition toolkit from Alibaba DAMO Academy, currently at version 1.3.1. It provides a wide range of features including Automatic Speech Recognition (ASR), Voice Activity Detection (VAD), Punctuation Restoration, Language Models, Speaker Verification, and Speaker Diarization. The library is actively maintained with frequent updates, often releasing new models and features such as the Fun-ASR-Nano-2512 which supports 31 languages and low-latency real-time transcription.
pip install -U funasrVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to perform non-streaming Automatic Speech Recognition (ASR) using the `AutoModel` class. It downloads the `paraformer-zh` model (which often includes integrated VAD and Punctuation), processes a remote audio file, and prints the transcribed text. You can easily switch to local audio files or specify GPU usage.
For ONNX inference, consider `funasr_onnx` or refer to FunASR's runtime documentation for ONNX deployment within the main library. Ensure `onnxruntime` (and `onnxruntime-gpu` for GPU) is correctly installed.
Specify `hub="hf"` in `AutoModel(model="your_model_name", hub="hf")` for Hugging Face models.
Always check the model card for the recommended `model_revision` and include it in your `AutoModel` initialization, e.g., `AutoModel(model="paraformer-zh", model_revision="v2.0.4")`.
Verify your PyTorch version meets the requirements for export tasks. Upgrade PyTorch if necessary: `pip install -U torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118` (adjust for your CUDA version).