FunASR-Nano batch transcription with multi-GPU support, managed with uv.
- Multi-GPU data parallelism (different files on different GPUs)
- Handles long audio by chunking into configurable segments (default 50s)
- Processes all audio files in input directory and outputs TXT files
- Supports WAV, MP3, FLAC, M4A formats (recursive directory scan)
- Skip already-transcribed files
- Python ≥ 3.10
- CUDA-capable GPU(s)
- uv
- FunASR source (provides the
modelmodule):
git clone https://github.com/FunAudioLLM/Fun-ASR.git# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install the project
uv sync# Single GPU
uv run fun-asr-batch \
--input_dir /path/to/audio \
--output_dir /path/to/output \
--model_dir FunAudioLLM/Fun-ASR-Nano-2512
# Multi-GPU (GPUs 0 and 1)
uv run fun-asr-batch \
--input_dir /path/to/audio \
--output_dir /path/to/output \
--gpus 0,1
# With verbose output
uv run fun-asr-batch \
--input_dir /path/to/audio \
--output_dir /path/to/output \
--verbose| Option | Default | Description |
|---|---|---|
--model_dir |
FunAudioLLM/Fun-ASR-Nano-2512 |
Path to model or HuggingFace model ID |
--input_dir |
(required) | Directory containing audio files |
--output_dir |
(required) | Directory to save transcription TXT files |
--max_length |
3500 |
Maximum tokens to generate per chunk |
--chunk_seconds |
50 |
Chunk duration in seconds for long audio |
--language |
auto |
Target language: auto, zh, en, ja |
--no_itn |
Disable inverse text normalization | |
--hotwords |
Comma-separated hotwords for better recognition | |
--gpus |
0 |
Comma-separated GPU IDs (e.g. 0,1,2,3) |
--no_skip_existing |
Re-transcribe files even if output TXT exists | |
--verbose |
Print transcription results in real-time |