zhifeixie commited on
Commit
c1144d4
Β·
verified Β·
1 Parent(s): c7deb87

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +157 -0
README.md CHANGED
@@ -1,3 +1,160 @@
1
  ---
 
 
 
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ - zh
5
  license: apache-2.0
6
+ pipeline_tag: audio-text-to-text
7
+ tags:
8
+ - speech-language-model
9
+ - streaming
10
+ - audio
11
+ - multimodal
12
+ - qwen2.5-omni
13
+ datasets:
14
+ - zhifeixie/StreamAudio-2M
15
+ base_model:
16
+ - Qwen/Qwen2.5-Omni-3B
17
  ---
18
+ # Mini-Omni3: Streaming Audio-In, Text-Out Conversational Model
19
+
20
+ [**Code**](https://github.com/xzf-thu/Mini-Omni3) <!-- TODO: confirm repo URL -->
21
+
22
+ Mini-Omni3 is a streaming speech-language model that listens to audio in real time and decides, at each audio chunk, whether to keep listening or to start replying with text. The model alternates between a **LISTENING** state, where it consumes one encoder-output chunk per step and emits either `KEEP_SILENCE` or `TEXT_BEGIN`, and a **SPEAKING** state, where it autoregressively generates a text turn until `TEXT_END` and then returns to listening for the next chunk.
23
+
24
+ This design lets the model handle both spoken questions ("answer it") and ambient sounds ("decide based on the sound whether help is needed") within a single streaming session, without an external VAD or turn-taking heuristic.
25
+
26
+ The release contains the Mini-Omni3 language-model weights (sharded safetensors), a chunk-wise audio encoder adapted from Qwen2.5-Omni, and the matching tokenizer and model config.
27
+
28
+ ## Model Details
29
+
30
+ - **Model name:** Mini-Omni3
31
+ - **Task:** Streaming audio-conditioned text generation (audio in, text out)
32
+ - **Audio encoder:** Qwen2.5-Omni audio tower (chunk-wise)
33
+ - **Audio framing:** 16 kHz, padded to 0.4-second (6400-sample) boundaries; 10 encoder-output frames per chunk
34
+ - **Decoding states:** LISTENING (emits `KEEP_SILENCE` / `TEXT_BEGIN`) and SPEAKING (emits text until `TEXT_END`)
35
+ - **Default sampling:** temperature 0.3, top-k 3
36
+ - **Default max new tokens:** 4096 per session
37
+ - **License:** Apache-2.0
38
+
39
+ ## Repository Contents
40
+
41
+ ```text
42
+ Mini-Omni3/
43
+ β”œβ”€β”€ MiniOmni3_LM_sharded/ # Sharded safetensors of the LM weights
44
+ β”‚ β”œβ”€β”€ model.safetensors.index.json
45
+ β”‚ └── model-0000N-of-0000N.safetensors
46
+ β”œβ”€β”€ MiniOmni3_ChunkwisedEncoder.pth # Audio encoder weights (Qwen2.5-Omni audio tower)
47
+ β”œβ”€β”€ qwen_2_5_omni_config/ # Audio-encoder config (nested: thinker_config.audio_config)
48
+ β”œβ”€β”€ model_config.yaml # GPT config consumed by Config.from_file
49
+ β”œβ”€β”€ tokenizer.json # Tokenizer
50
+ └── README.md # This card
51
+ ```
52
+
53
+ ## Intended Use
54
+
55
+ Mini-Omni3 is intended for streaming conversational agents that need to react to audio as it arrives β€” for example, voice assistants that may interject mid-utterance, alarms that respond to ambient sound, or low-latency dialogue systems where waiting for a full utterance before replying is too slow. The model is not a transcription system; it produces a conversational reply (or silence) rather than a verbatim transcript.
56
+
57
+ ## Quick Start
58
+
59
+ ### Installation
60
+
61
+ ```bash
62
+ git clone https://github.com/xzf-thu/Mini-Omni3.git # TODO: confirm repo URL
63
+ cd Mini-Omni3
64
+ conda create -n mini-omni3 python=3.10 -y
65
+ conda activate mini-omni3
66
+ pip install -r requirements.txt
67
+ ```
68
+
69
+ ### Download the checkpoint
70
+
71
+ ```python
72
+ from huggingface_hub import snapshot_download
73
+
74
+ local_dir = snapshot_download(
75
+ repo_id="zhifeixie/Mini-Omni3",
76
+ repo_type="model",
77
+ )
78
+ print(local_dir)
79
+ ```
80
+
81
+ ### Python Usage
82
+
83
+ ```python
84
+ from src.miniomni3.generate.run import run_inference
85
+
86
+ run_inference(
87
+ checkpoint_dir=local_dir, # the path snapshot_download returned
88
+ audio_paths=["/path/to/audio.wav"], # offline mode: one round per path
89
+ device="cuda:0", # or "mps" / "cpu"
90
+ )
91
+ ```
92
+
93
+ For interactive use, omit `audio_paths` and `run_inference` will prompt for an audio path each round:
94
+
95
+ ```python
96
+ run_inference(checkpoint_dir=local_dir, rounds=5, device="cuda:0")
97
+ ```
98
+
99
+ ## Streaming Protocol
100
+
101
+ A single session looks like:
102
+
103
+ ```text
104
+ [system prompt tokens]
105
+ β”Œβ”€β”€β”€ LISTENING ───┐
106
+ β”‚ AUDIO_BEGIN PAD*10 ASSISTANT β†’ KEEP_SILENCE (keep listening)
107
+ β”‚ AUDIO_BEGIN PAD*10 ASSISTANT β†’ TEXT_BEGIN EMOTION (start replying)
108
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
109
+ β”Œβ”€β”€β”€ SPEAKING ────┐
110
+ β”‚ … text tokens … TEXT_END (reply finished)
111
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
112
+ β”Œβ”€β”€β”€ LISTENING ───┐ (next audio chunk)
113
+ …
114
+ ```
115
+
116
+ The model is trained to emit at most one `TEXT_BEGIN` per audio chunk. Each assistant turn begins with `TEXT_BEGIN`, followed by an emotion token, the reply tokens, and `TEXT_END`. Turns starting with `KEEP_SILENCE` indicate the model chose not to respond to that chunk.
117
+
118
+ ## Training Summary
119
+
120
+ <!-- TODO: fill in once details are public.
121
+ Suggested fields:
122
+ - Pretraining base
123
+ - SFT / instruction-tuning data
124
+ - Streaming-objective data construction (how KEEP_SILENCE / TEXT_BEGIN supervision was generated)
125
+ - Total tokens / hours of audio
126
+ - Hardware and duration
127
+ -->
128
+
129
+ ## Evaluation
130
+
131
+ <!-- TODO: fill in once benchmarks are decided.
132
+ Candidate metrics:
133
+ - Spoken-QA accuracy on held-out audio prompts
134
+ - False-trigger rate on ambient / non-speech audio (lower is better)
135
+ - Response-onset latency in encoder chunks from end of question
136
+ - Text quality of replies (e.g. GPT-judge or human preference)
137
+ -->
138
+
139
+ ## Limitations
140
+
141
+ - The model produces text, not speech. Pair it with a TTS system for end-to-end voice interaction.
142
+ - Audio must be 16 kHz mono; non-conforming inputs are resampled by `whisper.load_audio` and padded to 0.4-second boundaries before encoding.
143
+ - Decisions are made at 0.4-second granularity (one encoder chunk), which sets a floor on response-onset latency.
144
+ - Trailing partial audio chunks shorter than 10 encoder frames are dropped before generation.
145
+
146
+ ## Citation
147
+
148
+ <!-- TODO: replace with the real arxiv id and year once published. -->
149
+ ```bibtex
150
+ @misc{xie_miniomni3,
151
+ title = {Mini-Omni3: Streaming Audio-In, Text-Out Conversational Modeling},
152
+ author = {Zhifei Xie and collaborators},
153
+ year = {2026},
154
+ note = {Preprint in preparation}
155
+ }
156
+ ```
157
+
158
+ ## Acknowledgements
159
+
160
+ Mini-Omni3 builds on the Qwen2.5-Omni audio encoder. We thank the Qwen team and the maintainers of OpenAI Whisper for the audio-loading utilities used in this project.