[来源关键摘录] Kimi-Audio 官方开源仓库,包含推理代码、Docker 环境与 Kimi-Audio-Evalkit 评测工具。
[正文前段节选] Skip to content
Navigation Menu
Appearance settings
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
Repository navigation
NotificationsYou must be signed in to change notification settings
Fork382 (382)
Star4.8k (4.8k)You must be signed in to star a repository
Kimi-Audio, an open-source audio foundation model excelling in audio understanding, generation, and conversation
Custom properties
Report repository
BranchesTags
Open more actions menu
Latest commit
Folders and files
Last commit message
Last commit date
finetune_codes
pyproject.toml
requirements.txt
View all files
Repository files navigation
Kimi-Audio-7B 🤗 | Kimi-Audio-7B-Instruct 🤗 | 📑 Paper
We present Kimi-Audio, an open-source audio foundation model excelling in audio understanding, generation, and conversation. This repository contains the official implementation, models, and evaluation toolkit for Kimi-Audio.
May 29, 2025: 👋 We release a finetuning example of Kimi-Audio-7B.
April 27, 2025: 👋 We release pretrained model weights of Kimi-Audio-7B.
April 25, 2025: 👋 We release the inference code and model weights of Kimi-Audio-7B-Instruct.
April 25, 2025: 👋 We release the audio evaluation toolkit Kimi-Audio-Evalkit. We can easily reproduce the our results and baselines by this toolkit!
April 25, 2025: 👋 We release the technical report of Kimi-Audio.
Table of Contents
Introduction
Architecture Overview
Speech Recognition
Audio Understanding
Audio-to-Text Chat
Speech Conversation
Evaluation Toolkit
Generation Testset
Acknowledgements
Kimi-Audio is designed as a universal audio foundation model capable of handling a wide variety of audio processing tasks within a single unified framework. Key features include:
Universal Capabilities: Handle diverse tasks like automatic speech recognition (ASR), audio question answering (AQA), automatic audio captioning (AAC), speech emotion recognition (SER), sound event/scene classification (SEC/ASC), and end-to-end speech conversation.
State-of-the-Art Performance: Achieve SOTA results on numerous audio benchmarks (see Evaluation and the Technical Report).
Large-Scale Pre-training: Pre-train on over 13 million hours of diverse audio data (speech, music, sounds) and text data, enabling robust audio reasoning and language understanding.
Novel Architecture: Employ a hybrid audio input (continuous acoustic vectors + discrete semantic tokens) and an LLM core with parallel heads for text and audio token generation.
Efficient Inference: Feature a chunk-wise streaming detokenizer based on flow matching for low-latency audio generation.
Open-Source: Release the code and model checkpoints for both pre-training and instruction fine-tuning, and release a comprehensive evaluation toolkit to foster community research and development.
Kimi-Audio consists of three main components:
Audio Tokenizer: Converts input audio into:
Discrete semantic tokens (12.5Hz) using vector quantization.
Continuous acoustic features derived from a Whisper encoder (downsampled to 12.5Hz).
Audio LLM: A transformer-based model (initialized from a pre-trained text LLM like Qwen 2.5 7B) with shared layers processing multimodal inputs, followed by parallel heads for autoregressively generating text tokens and discrete audio semantic tokens.
Audio Detokenizer: Converts the predicted discrete semantic audio tokens back into high-fidelity waveforms using a flow-matching model and a vocoder (BigVGAN), supporting chunk-wise streaming with a look-ahead mechanism for low latency.
Getting Started
Step1: Get the Code
git clone https://github.com/MoonshotAI/Kimi-Audio.git
cd Kimi-Audio
git submodule update --init --recursive
pip install -r requirements.txt
Kimi‑Audio can now be installed directly via pip.
pip install torch
pip install git+https://github.com/MoonshotAI/Kimi-Audio.git
This example demonstrates basic usage for generating text from audio (ASR) and generating both text and speech in a conversational turn.
import soundfile as sf
from kimia_infer.api.kimia import KimiAudio
# --- 1. Load Model ---
model_path = "moonshotai/Kimi-Audio-7B-Instruct"
model = KimiAudio(model_path=model_path, load_detokenizer=True)
# --- 2. Define Sampling Parameters ---
sampling_params = {
"audio_temperature": 0.8,
"audio_top_k": 10,
"text_temperature": 0.0,
"text_top_k": 5,
"audio_repetition_penalty": 1.0,
"audio_repetition_window_size": 64,
"text_repetition_penalty": 1.0,
"text_repetition_window_size": 16,
# --- 3. Example 1: Audio-to-Text (ASR) ---
messages_asr = [
# You can provide context or instructions as text
{"role": "user", "message_type": "text", "content": "Please transcribe the following audio:"},
# Provide the audio file path
{"role": "user", "message_type": "audio", "content": "test_audios/asr_example.wav"}
# Generate only text output
_, text_output = model.generate(messages_asr, **sampling_params, output_type="text")
print(">>> ASR Output Text: ", text_output) # Expected output: "这并不是告别,这是一个篇章的结束,也是新篇章的开始。"
# --- 4. Example 2: Audio-to-Audio/Text Conversation ---
messages_conversation = [
# Start conversation with an audio query
{"role": "user", "message_type": "audio", "content": "test_audios/qa_example.wav"}
# Generate both audio and text output
wav_output, text_output = model.generate(messages_conversation, **sampling_params, output_type="both")
# Save the generated audio
output_audio_path = "output_audio.wav"
sf.write(output_audio_path, wav_output.detach().cpu().view(-1).numpy(), 24000) # Assuming 24kHz output
print(f">>> Conversational Output Audio saved to: {output_audio_path}")
print(">>> Conversational Output Text: ", text_output) # Expected output: "当然可以,这很简单。一二三四五六七八九十。"
# --- 5. Example 3: Audio-to-Audio/Text Conversation with Multiturn ---
messages = [
{"role": "user", "message_type": "audio", "content": "test_audios/multiturn/case2/multiturn_q1.wav"},
# This is the first turn output of Kimi-Audio
{"role": "assistant", "message_type": "audio-text", "content": ["test_audios/multiturn/case2/multiturn_a1.wav", "当然可以,这很简单。一二三四五六七八九十。"]},
{"role": "user", "message_type": "audio", "content": "test_audios/multiturn/case2/multiturn_q2.wav"}
wav, text = model.generate(messages, **sampling_params, output_type="both")
print(">>> Conversational Output Text: ", text_output) # Expected output: "没问题,继续数下去就是十一十二十三十四十五十六十七十八十九二十。"
print("Kimi-Audio inference examples complete.")
Kimi-Audio achieves state-of-the-art (SOTA) performance across a wide range of audio benchmarks.
The below is the overall performance:
Here are performances on different benchmarks, you can easily reproduce the our results and baselines by our Kimi-Audio-Evalkit (also see Evaluation Toolkit):
Automatic Speech Recognition (ASR)
Performance (WER↓)
LibriSpeechtest-clean | test-other
Qwen2-Audio-base
Baichuan-base
Step-Audio-chat
3.19 | 10.67
Qwen2.5-Omni
Fleurszh | en
AISHELL-2 ios
WenetSpeechtest-meeting | test-net
13.28 | 10.13
10.83 | 9.47
Kimi-ASR Internal Testsetsubset1 | subset2
Performance↑
MMAUmusic | sound | speech
58.98 | 69.07 | 52.55
Baichuan-chat
49.10 | 59.46 | 42.47
38.92 | 43.54 | 32.43
49.40 | 53.75 | 47.75
62.16 | 67.57 | 53.92
61.68 | 73.27 | 60.66
ClothoAQAtest | dev
71.73 | 72.63
48.02 | 48.16
45.84 | 44.98
72.86 | 73.12
71.24 | 73.18
CochlScenetest | dev
52.69 | 50.96
34.93 | 34.56
10.06 | 10.42
63.82 | 63.82
79.84 | 80.99
OpenAudioBenchAlpacaEval | Llama Questions |Reasoning QA | TriviaQA | Web Questions
Qwen2-Audio-chat
57.19 | 69.67 | 42.77 | 40.30 | 45.20
59.65 | 74.33 | 46.73 | 55.40 | 58.70
57.89 | 76.00 | 47.43 | 51.80 | 55.40
StepAudio-chat
56.53 | 72.33 | 60.00 | 56.80 | 73.00
72.76 | 75.33 | 63.76 | 57.06 | 62.80
75.73 | 79.33 | 58.02 | 62.10 | 70.20
[...内容已截断,完整版请查看原文或 Wayback 快照]