Text-to-Speech
Transformers
ONNX
Safetensors
English
Chinese
bailing_moe_v3_audio
feature-extraction
audio
speech
automatic-speech-recognition
audio-understanding
audio-reasoning
speech-to-text
conversational
mixture-of-experts
custom_code
Instructions to use eshmoideas/Ming-audio with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use eshmoideas/Ming-audio with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="eshmoideas/Ming-audio", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("eshmoideas/Ming-audio", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 9,431 Bytes
6bd8f62 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | ---
language:
- en
- zh
license: mit
library_name: transformers
tags:
- audio
- speech
- automatic-speech-recognition
- audio-understanding
- audio-reasoning
- speech-to-text
- text-to-speech
- conversational
- mixture-of-experts
- custom_code
model_name: Ming-3.0-audio-flash
---
<div align="center">
<img src="assets/ming-3.0-audio-logo.png" width="110" alt="Ming logo">
<h1>Ming-3.0-audio-flash</h1>
<p><strong>Hear clearly. Understand deeply. Act intelligently.</strong></p>
</div>
Ming-3.0-audio-flash is a native audio-language model from inclusionAI. It accepts audio together with text instructions and supports speech recognition, spoken question answering, audio understanding, audio reasoning, and optional synthesized-speech responses.
<div align="center">
<table align="center" border="0" cellpadding="0" cellspacing="0" style="border:none; display:inline-table; width:auto; margin:0 auto;">
<tr>
<td valign="middle" style="border:none; padding:0;"><a href="https://github.com/inclusionAI/Ming-3.0-audio-flash" style="display:inline-block; white-space:nowrap; line-height:17px; background-image:linear-gradient(currentColor,currentColor); background-repeat:no-repeat; background-position:0 calc(100% - 0.5px); background-size:100% 1px; text-decoration:none;"><img src="assets/github-invertocat-black-17.svg" width="17" height="17" alt="" style="display:inline-block; vertical-align:middle; position:relative; top:-1.5px; margin:0 3px 0 0;">GitHub</a></td>
<td valign="middle" style="border:none; padding:0 8px;">路</td>
<td valign="middle" style="border:none; padding:0;"><a href="https://modelscope.cn/models/inclusionAI/Ming-3.0-audio-flash">馃 ModelScope</a></td>
<td valign="middle" style="border:none; padding:0 8px;">路</td>
<td valign="middle" style="border:none; padding:0;"><a href="https://huggingface.co/inclusionAI/Ming-3.0-audio-flash">馃 Flash</a></td>
<td valign="middle" style="border:none; padding:0 8px;">路</td>
<td valign="middle" style="border:none; padding:0;"><a href="https://huggingface.co/inclusionAI/Ming-3.0-audio-tiny">馃 Tiny</a></td>
<td valign="middle" style="border:none; padding:0 8px;">路</td>
<td valign="middle" style="border:none; padding:0;"><a href="https://github.com/inclusionAI/Ming-3.0-audio-flash/tree/main/examples">馃捇 Examples</a></td>
</tr>
</table>
</div>
## Model Summary
| Property | Description |
| --- | --- |
| Developer | inclusionAI |
| Model type | Native audio-language Mixture-of-Experts model |
| Parameters | 126B total parameters, 6.5B activated per inference step |
| Inputs | Audio and text instructions |
| Outputs | Text, or text with optional synthesized speech |
| Primary languages | Chinese and English, including varied accents and dialects |
| License | MIT |
## Highlights
- **Complex speech recognition:** Handles Chinese and English speech, dialects, accents, noisy environments, and multi-speaker recordings.
- **Long-audio understanding:** Comprehends and analyzes long-form recordings.
- **Multidimensional perception:** Understands speech, non-speech sounds, acoustic scenes, and music.
- **Audio reasoning:** Answers questions and performs reasoning over audio content.
- **Audio interaction:** Produces text responses and can optionally synthesize speech with built-in voices or a reference voice.
## Architecture
Ming-3.0-audio-flash combines an audio encoder and projector with a Mixture-of-Experts language backbone. An optional Talker generates speech responses from the model's output.
<p align="center">
<img src="assets/ming-3.0-audio-flash-architecture.png" width="760" alt="Ming-3.0-audio-flash architecture">
</p>
## Quick Start with Transformers
The model uses custom Transformers code. Review the repository code before enabling `trust_remote_code=True`.
```bash
git clone https://github.com/inclusionAI/Ming-3.0-audio-flash.git
cd Ming-3.0-audio-flash
python -m venv .venv-transformers
source .venv-transformers/bin/activate
pip install -r requirements-transformers.txt
```
### Audio Understanding
```bash
python examples/transformers_audio.py examples/audio/introduce_ant_group.wav \
--model inclusionAI/Ming-3.0-audio-flash \
--prompt "Please answer the question in the audio."
```
### Speech Recognition
```bash
python examples/transformers_audio.py examples/audio/introduce_ant_group.wav \
--model inclusionAI/Ming-3.0-audio-flash \
--task asr \
--max-new-tokens 256 \
--no-repeat-ngram-size 10
```
The validated ASR prompt asks the model to identify the spoken language and place a tab between the language label and transcription.
### Direct Python Usage
```python
import torch
from transformers import AutoModelForCausalLM, AutoProcessor
model_id = "inclusionAI/Ming-3.0-audio-flash"
audio_path = "examples/audio/introduce_ant_group.wav"
processor = AutoProcessor.from_pretrained(
model_id,
trust_remote_code=True,
use_fast=False,
)
model = AutoModelForCausalLM.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
).eval()
messages = [
{
"role": "user",
"content": [
{"type": "audio", "audio": audio_path},
{"type": "text", "text": "Please answer the question in the audio."},
],
}
]
inputs = processor(messages).to(model.device)
inputs["audio_feats"] = inputs["audio_feats"].to(model.dtype)
with torch.inference_mode():
output_ids = model.generate(
**inputs,
max_new_tokens=512,
do_sample=False,
)
generated_ids = output_ids[0, inputs["input_ids"].shape[1] :]
response = processor.decode(generated_ids, skip_special_tokens=True).strip()
print(response)
```
## Speech Output
The Talker example supports built-in voices and reference-audio voice prompting:
```bash
python examples/transformers_thinker_talker.py \
--model inclusionAI/Ming-3.0-audio-flash \
--audio examples/audio/introduce_ant_group.wav \
--voice US_Stella \
--output output.wav
```
See the [voice guide](https://github.com/inclusionAI/Ming-3.0-audio-flash/blob/main/docs/voices.md) for available voice names and reference-audio usage.
## Serving
### vLLM-Omni
```bash
export MODEL_PATH=inclusionAI/Ming-3.0-audio-flash
MING_OUTPUT_MODE=text ./scripts/serve_vllm_omni.sh "$MODEL_PATH"
```
The reference 128K serving profile uses tensor parallelism across eight 80 GB H800 GPUs. Select the deployment YAML that matches text-only or Talker output. See the [deployment guide](https://github.com/inclusionAI/Ming-3.0-audio-flash/blob/main/README.md#vllm-omni) for details.
For speech output, start the audio profile and select an IP or registered voice with the vLLM-Omni client's `--voice` option:
```bash
MING_OUTPUT_MODE=audio ./scripts/serve_vllm_omni.sh "$MODEL_PATH"
python examples/vllm_omni_audio_chat.py examples/audio/introduce_ant_group.wav \
--audio-response \
--voice US_Stella \
--output-audio outputs/answer.wav
```
The client sends this selection as Chat Completions `audio.voice: {"id": "..."}`. vLLM-Omni uses the built-in IP voice `鐏靛皬鏌擿 when no voice is specified. The model directory also provides `鐏垫シ` and `US_James` as preset reference voices under `voice_presets/voice_audio/`, with their matching transcripts in `voice_presets/voice_prompts.json`. Both names are also available as built-in IP voices.
### SGLang
```bash
export MODEL_PATH=inclusionAI/Ming-3.0-audio-flash
./scripts/serve_sglang.sh "$MODEL_PATH"
```
The validated SGLang profile uses four GPUs and provides text output. See the [SGLang example](https://github.com/inclusionAI/Ming-3.0-audio-flash/blob/main/examples/sglang_audio_chat.py) for client usage.
### SGLang-Omni
[SGLang-Omni](https://sgl-project.github.io/sglang-omni/) serves transcription, audio chat, and speech synthesis from one server. Serving uses two GPUs: `--thinker.tp_size 2` places the thinker on both visible devices, the audio encoder uses GPU 0, and speech synthesis uses GPU 1.
```bash
CUDA_VISIBLE_DEVICES=0,1 sgl-omni serve \
--model-path inclusionAI/Ming-3.0-audio-flash \
--thinker.tp_size 2
```
The server exposes OpenAI-compatible `/v1/audio/transcriptions`, `/v1/audio/speech`, and `/v1/chat/completions` endpoints. See the [SGLang-Omni cookbook](https://sgl-project.github.io/sglang-omni/cookbook/ming3_audio.html) for client examples, including voice cloning with `ref_audio` and `ref_text`.
## Evaluation
### Speech Recognition
<p align="center">
<img src="assets/benchmark-asr.png" width="100%" alt="Speech recognition benchmarks">
</p>
### Audio Intelligence
<p align="center">
<img src="assets/benchmark-audio-intelligence.png" width="100%" alt="Audio intelligence benchmarks">
</p>
### Text Benchmarks
<p align="center">
<img src="assets/benchmark-text.png" width="760" alt="Text benchmarks">
</p>
All benchmark values are percentages. Higher is better unless the metric is marked with a downward arrow. Results marked with an asterisk are self-evaluated. Refer to the [GitHub README](https://github.com/inclusionAI/Ming-3.0-audio-flash#benchmarks) for the latest notes and evaluation details.
## License
This project is released under the [MIT License](https://github.com/inclusionAI/Ming-3.0-audio-flash/blob/main/LICENSE). See [LEGAL.md](https://github.com/inclusionAI/Ming-3.0-audio-flash/blob/main/LEGAL.md) for the legal disclaimer.
|