fengjay01 Corle-heyongzhe commited on
Commit
0e4e436
·
0 Parent(s):

Duplicate from XiaomiMiMo/MiMo-Audio-Tokenizer

Browse files

Co-authored-by: Yongzhe He <Corle-heyongzhe@users.noreply.huggingface.co>

Files changed (4) hide show
  1. .gitattributes +35 -0
  2. README.md +150 -0
  3. config.json +72 -0
  4. model.safetensors +3 -0
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+ <div align="center">
5
+ <picture>
6
+ <source srcset="https://github.com/XiaomiMiMo/MiMo-VL/raw/main/figures/Xiaomi_MiMo_darkmode.png?raw=true" media="(prefers-color-scheme: dark)">
7
+ <img src="https://github.com/XiaomiMiMo/MiMo-VL/raw/main/figures/Xiaomi_MiMo.png?raw=true" width="60%" alt="Xiaomi-MiMo" />
8
+ </picture>
9
+ </div>
10
+
11
+ <h3 align="center">
12
+ <b>
13
+ <span>━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</span>
14
+ <br/>
15
+ MiMo Audio: Audio Language Models are Few-Shot Learners
16
+ <br/>
17
+ <span>━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</span>
18
+ <br/>
19
+ </b>
20
+ </h3>
21
+
22
+ <br/>
23
+
24
+ <div align="center" style="line-height: 1;">
25
+ |
26
+ <a href="https://huggingface.co/collections/XiaomiMiMo/mimo-audio-68cc7202692c27dae881cce0" target="_blank">🤗 HuggingFace</a>
27
+ &nbsp;|
28
+ <a href="https://github.com/XiaomiMiMo/MiMo-Audio/blob/main/MiMo-Audio-Technical-Report.pdf" target="_blank">📄 Paper</a>
29
+ &nbsp;|
30
+ <a href="https://xiaomimimo.github.io/MiMo-Audio-Demo" target="_blank">📰 Blog</a>
31
+ &nbsp;|
32
+ <a href="https://github.com/XiaomiMiMo/MiMo-Audio-Eval" target="_blank">📊 MiMo-Audio-Eval</a>
33
+ &nbsp;|
34
+
35
+ <br/>
36
+ </div>
37
+
38
+ <br/>
39
+
40
+ ## Introduction
41
+
42
+ Existing audio language models typically rely on task-specific fine-tuning to accomplish particular audio tasks. In contrast, humans are able to generalize to new audio tasks with only a few examples or simple instructions. GPT-3 has shown that scaling next-token prediction pretraining enables strong generalization capabilities in text, and we believe this paradigm is equally applicable to the audio domain. By scaling MiMo-Audio's pretraining data to over one hundred million of hours, we observe the emergence of few-shot learning capabilities across a diverse set of audio tasks. We develop a systematic evaluation of these capabilities and find that MiMo-Audio-7B-Base achieves SOTA performance on both speech intelligence and audio understanding benchmarks among open-source models. Beyond standard metrics, MiMo-Audio-7B-Base generalizes to tasks absent from its training data, such as voice conversion, style transfer, and speech editing. MiMo-Audio-7B-Base also demonstrates powerful speech continuation capabilities, capable of generating highly realistic talk shows, recitations, livestreaming and debates. At the post-training stage, we curate a diverse instruction-tuning corpus and introduce thinking mechanisms into both audio understanding and generation. MiMo-Audio-7B-Instruct achieves open-source SOTA on audio understanding benchmarks, spoken dialogue benchmarks and instruct-TTS evaluations, approaching or surpassing closed-source models.
43
+
44
+ <p align="center">
45
+ <img width="95%" src="https://github.com/XiaomiMiMo/MiMo-Audio/blob/main/assets/Results.png?raw=true">
46
+ </p>
47
+
48
+
49
+
50
+ ## Architecture
51
+ ### MiMo-Audio-Tokenizer
52
+ MiMo-Audio-Tokenizer is a 1.2B-parameter Transformer operating at 25 Hz. It employs an eight-layer RVQ stack to generate 200 tokens per second. By jointly optimizing semantic and reconstruction objectives, we train MiMo-Audio-Tokenizer from scratch on a 10-million-hour corpus, achieving superior reconstruction quality and facilitating downstream language modeling.
53
+
54
+ <p align="center">
55
+ <img width="95%" src="https://github.com/XiaomiMiMo/MiMo-Audio/blob/main/assets/tokenizer.png?raw=true">
56
+ </p>
57
+
58
+ MiMo-Audio couples a patch encoder, an LLM, and a patch decoder to improve modeling efficiency for high-rate sequences and bridge the length mismatch between speech and text. The patch encoder aggregates four consecutive time steps of RVQ tokens into a single patch, downsampling the sequence to a 6.25 Hz representation for the LLM. The patch decoder autoregressively generates the full 25 Hz RVQ token sequence via a delayed-generation scheme.
59
+ ### MiMo-Audio
60
+ <p align="center">
61
+ <img width="95%" src="https://github.com/XiaomiMiMo/MiMo-Audio/blob/main/assets/architecture.png?raw=true">
62
+ </p>
63
+
64
+ ## Explore MiMo-Audio Now! 🚀🚀🚀
65
+ - 📰 **Read the Official Blog:** [MiMo-Audio Blog](https://xiaomimimo.github.io/MiMo-Audio-Demo)
66
+ - 📄 **Dive into the Technical Report:** [MiMo-Audio Technical Report](https://github.com/XiaomiMiMo/MiMo-Audio/blob/main/MiMo-Audio-Technical-Report.pdf)
67
+
68
+
69
+ ## Model Download
70
+ | Models | 🤗 Hugging Face |
71
+ |-------|-------|
72
+ | MiMo-Audio-Tokenizer | [XiaomiMiMo/MiMo-Audio-Tokenizer](https://huggingface.co/XiaomiMiMo/MiMo-Audio-Tokenizer) |
73
+ | MiMo-Audio-7B-Base | [XiaomiMiMo/MiMo-Audio-7B-Base](https://huggingface.co/XiaomiMiMo/MiMo-Audio-7B-Base) |
74
+ | MiMo-Audio-7B-Instruct | [XiaomiMiMo/MiMo-Audio-7B-Instruct](https://huggingface.co/XiaomiMiMo/MiMo-Audio-7B-Instruct) |
75
+
76
+
77
+
78
+ ## Getting Started
79
+
80
+ Spin up the MiMo-Audio demo in minutes with the built-in Gradio app.
81
+
82
+ ### Installation
83
+ ``` sh
84
+ git clone https://github.com/XiaomiMiMo/MiMo-Audio.git
85
+ cd MiMo-Audio
86
+ pip install -e .
87
+ ```
88
+ ### Run the demo
89
+ ``` sh
90
+ python run_mimo_audio.py
91
+ ```
92
+
93
+ This launches a local Gradio interface where you can try MiMo-Audio interactively.
94
+
95
+ <p align="center">
96
+ <img width="95%" src="https://github.com/XiaomiMiMo/MiMo-Audio/blob/main/assets/demo_ui.jpg?raw=true">
97
+ </p>
98
+
99
+ Enter the local paths for `MiMo-Audio-Tokenizer` and `MiMo-Audio-7B-Instruct`, then enjoy the full functionality of MiMo-Audio!
100
+
101
+ ## Inference Scripts
102
+
103
+ ### Base Model
104
+ We provide an example script to explore the **in-context learning** capabilities of `MiMo-Audio-7B-Base`.
105
+ See: [`inference_example_pretrain.py`](https://github.com/XiaomiMiMo/MiMo-Audio/blob/main/inference_example_pretrain.py)
106
+
107
+ ### Instruct Model
108
+ To try the instruction-tuned model `MiMo-Audio-7B-Instruct`, use the corresponding inference script.
109
+ See: [`inference_example_sft.py`](https://github.com/XiaomiMiMo/MiMo-Audio/blob/main/inference_example_sft.py)
110
+
111
+
112
+
113
+ ## Evaluation Toolkit
114
+ Full evaluation suite are available at 🌐[MiMo-Audio-Eval](https://github.com/XiaomiMiMo/MiMo-Audio-Eval).
115
+
116
+
117
+ This toolkit is designed to evaluate MiMo-Audio and other recent audio LLMs as mentioned in the paper. It provides a flexible and extensible framework, supporting a wide range of datasets, tasks, and models.
118
+
119
+ ## Citation
120
+
121
+ ```bibtex
122
+ @misc{coreteam2025mimoaudio,
123
+ title={MiMo-Audio: Audio Language Models are Few-Shot Learners},
124
+ author={LLM-Core-Team Xiaomi},
125
+ year={2025},
126
+ url={GitHub - XiaomiMiMo/MiMo-Audio},
127
+ }
128
+ ```
129
+
130
+
131
+ ## Contact
132
+
133
+ Please contact us at [mimo@xiaomi.com](mailto:mimo@xiaomi.com) or open an issue if you have any questions.
134
+
135
+ ## Use Restrictions
136
+
137
+ You are solely responsible for your use of XiaomiMiMo/MiMo-Audio-Tokenizer and any outputs, actions, or consequences arising therefrom, and you agree not to use the XiaomiMiMo/MiMo-Audio-Tokenizer or any derivatives thereof:
138
+ - For any unlawful, fraudulent, or malicious purpose, or in any manner that violates any applicable laws or regulations;
139
+ - To infringe upon the intellectual property rights, privacy rights, publicity rights, or other lawful rights or interests of any third party;
140
+ - To exploit, harm, harass, defame, unlawfully discriminate against, or otherwise adversely affect any individual or group, including minors or vulnerable persons;
141
+ - For any military purpose or application;
142
+ - To engage in or facilitate malicious cyber activities, including but not limited to malware, ransomware, phishing, credential theft, or unauthorized access, or any activity intended to compromise or unlawfully control computer systems, networks, or encryption systems;
143
+ - To access, collect, process, disclose, or disseminate personal data or other protected information without appropriate authorization or lawful basis; or to access, interact with, scrape, or automate any third-party platform or service in violation of any applicable laws, policies, or authorization requirements;
144
+ - To use the XiaomiMiMo/MiMo-Audio-Tokenizer in a manner that autonomously executes high-risk actions without appropriate human oversight or authorization.
145
+
146
+ This notice is an informational reminder only and does not amend the applicable model licence or impose additional licence conditions. The permissions granted under that licence remain unaffected. Nothing in this notice restricts uses permitted by applicable law, including applicable exceptions and limitations.
147
+
148
+ ### Usage enquiries and complaints
149
+
150
+ [mimo-legal@xiaomi.com](mailto:mimo-legal@xiaomi.com). For information on submitting a complaint, please visit the https://mimo.xiaomi.com.
config.json ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "max_audio_seconds": 1800,
3
+ "stride_size": 2,
4
+ "avg_pooler": 2,
5
+ "d_model": 1280,
6
+ "scale_embedding": false,
7
+ "kernel_size": 3,
8
+ "activation_function": "gelu",
9
+ "encoder_layers": 32,
10
+ "encoder_skip_layer_id": 3,
11
+ "encoder_attention_heads": 20,
12
+ "encoder_ffn_dim": 5120,
13
+ "encoder_causal": false,
14
+ "encoder_attn_window_size": [
15
+ -1,
16
+ -1
17
+ ],
18
+ "decoder_layers": 32,
19
+ "decoder_attention_heads": 20,
20
+ "decoder_ffn_dim": 5120,
21
+ "decoder_kernel_size": 3,
22
+ "decoder_stride_size": 2,
23
+ "decoder_causal": true,
24
+ "decoder_attn_window_size": [
25
+ -1,
26
+ -1
27
+ ],
28
+ "nfft": 960,
29
+ "vocoder_dim": 256,
30
+ "vocoder_intermediate_dim": 1024,
31
+ "vocoder_num_layers": 16,
32
+ "n_mels": 128,
33
+ "sampling_rate": 24000,
34
+ "hop_length": 240,
35
+ "window_size": 960,
36
+ "vocoder_padding": "same",
37
+ "fmin": 0,
38
+ "fmax": null,
39
+ "num_quantizers": 20,
40
+ "codebook_size": [
41
+ 1024,
42
+ 1024,
43
+ 128,
44
+ 128,
45
+ 128,
46
+ 128,
47
+ 128,
48
+ 128,
49
+ 128,
50
+ 128,
51
+ 128,
52
+ 128,
53
+ 128,
54
+ 128,
55
+ 128,
56
+ 128,
57
+ 128,
58
+ 128,
59
+ 128,
60
+ 128
61
+ ],
62
+ "threshold_ema_dead_code": 2,
63
+ "position_embedding_type": "rope",
64
+ "rope_theta": 10000,
65
+ "rope_type": "default",
66
+ "ln_type": "LayerNorm",
67
+ "vocoder_attention_heads": 16,
68
+ "vocoder_attn_window_size": [
69
+ 40,
70
+ 10
71
+ ]
72
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2614f14d9d692bed0b695cc7283f8dd65c9beaf10376853c9b9888844745e847
3
+ size 3906690080