Registry / ai-ml / funasr

funasr

JSON →
library1.3.9pypypiunverified

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 funasr
INSTALL
IMPORT
SIG · FUNASR
F
funasr
ai-mlpythonv1.3.9
Install
21.5s avg
Import
Disk
798MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
4/8 runs
✓ 20.01s
py 3.11
4/8 runs
✓ 19.94s
py 3.12
4/8 runs
✓ 23.04s
py 3.13
4/8 runs
4/8 runs
py 3.9
4/8 runs
✓ 22.83s
798MB installed
● package 798MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AutoModel
from funasr import AutoModel

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.

from funasr import AutoModel import soundfile as sf import os # You might need to set an environment variable for modelscope token if hitting rate limits or private models # os.environ['MODELSCOPE_API_TOKEN'] = 'your_token_here' # Initialize the ASR model, will download 'paraformer-zh' from ModelScope if not local # 'paraformer-zh' is a multi-functional model, with VAD and PUNC integrated. # Use a public audio URL for demonstration model = AutoModel(model="paraformer-zh", vad_model="fsmn-vad", punc_model="ct-punc-c", device="cpu") # Specify 'cuda:0' for GPU if available # Example audio input: a remote URL or a local file path # For a local file, ensure it exists, e.g., 'path/to/your/audio.wav' # Using a provided example audio from FunASR's repository audio_input = "https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/vad_example.wav" print(f"Processing audio: {audio_input}") # Perform speech recognition # The generate method returns a list of dictionaries with transcription results result = model.generate(input=audio_input) # Print the transcription result if result and result[0].get('text'): print(f"Transcription: {result[0]['text']}") else: print("No transcription result found.") # Example of VAD (Voice Activity Detection) # model_vad = AutoModel(model="fsmn-vad", device="cpu") # vad_result = model_vad.generate(input=audio_input) # print(f"VAD Result: {vad_result}")
funasr --version
Debug
Known issues
gotchaThe `funasr` library primarily supports PyTorch-based inference, while `funasr_onnx` is a separate package designed for ONNX Runtime. Ensure you are using the correct library or runtime components for your desired deployment, especially if using ONNX for optimized inference.
fix
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.
affects: All versions
gotchaWhen initializing `AutoModel`, models are downloaded from ModelScope by default. To use models hosted on Hugging Face, you must explicitly set `hub="hf"` in the `AutoModel` constructor.
fix
Specify `hub="hf"` in `AutoModel(model="your_model_name", hub="hf")` for Hugging Face models.
affects: All versions
gotchaModel interfaces or required revisions (`model_revision` parameter) may change frequently with updates. It's advisable to specify `model_revision` if a specific model version is needed for reproducibility or compatibility.
fix
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")`.
affects: All versions
gotchaFor model export operations (e.g., to ONNX), specific PyTorch versions might be required. For example, `torch >= 1.11.0` is necessary for ONNX export functionality.
fix
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).
affects: All versions
Upgrade
Version history
1.3.9latest on PyPI · released May 29, 2026
Audit
Dependencies
modelscoperequiredEssential for downloading and utilizing pre-trained models from ModelScope Hub.
torchrequiredCore deep learning framework dependency for model execution.
onnxruntimeoptionalRequired for ONNX-based inference, install `onnxruntime-gpu` for GPU acceleration.
Agent activity
55 hits · last 30 days
node
52
Amazon
1
OpenAI (training)
1
Resources
funasr — pip install funasr · libregistry