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
|
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 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
-
|
199 |
-
[More Information Needed]
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- Omni-modal-LLM
|
5 |
+
- Multi-modal-LLM
|
6 |
+
- Emotional-spoken-dialogue
|
7 |
+
license: apache-2.0
|
8 |
+
datasets:
|
9 |
+
- Emova-ollm/temp
|
10 |
+
- Emova-ollm/emova-sft-4m
|
11 |
+
- Emova-ollm/emova-sft-speech-231k
|
12 |
+
language:
|
13 |
+
- en
|
14 |
+
- zh
|
15 |
+
base_model:
|
16 |
+
- Emova-ollm/qwen2vit600m
|
17 |
+
- Emova-ollm/Qwen2.5-72B-Instruct_add_speech_token_4096_nostrip
|
18 |
+
model-index:
|
19 |
+
- name: emova-qwen-2-5-72b-hf
|
20 |
+
results:
|
21 |
+
- task:
|
22 |
+
type: multimodal
|
23 |
+
dataset:
|
24 |
+
name: AI2D
|
25 |
+
type: ai2d
|
26 |
+
metrics:
|
27 |
+
- type: accuracy
|
28 |
+
value: 85.8
|
29 |
+
name: accuracy
|
30 |
+
verified: true
|
31 |
+
- task:
|
32 |
+
type: multimodal
|
33 |
+
dataset:
|
34 |
+
name: ChartQA
|
35 |
+
type: chartqa
|
36 |
+
metrics:
|
37 |
+
- type: accuracy
|
38 |
+
value: 88.7
|
39 |
+
name: accuracy
|
40 |
+
verified: true
|
41 |
+
- task:
|
42 |
+
type: multimodal
|
43 |
+
dataset:
|
44 |
+
name: DocVQA
|
45 |
+
type: docvqa
|
46 |
+
metrics:
|
47 |
+
- type: accuracy
|
48 |
+
value: 95.9
|
49 |
+
name: accuracy
|
50 |
+
verified: true
|
51 |
+
- task:
|
52 |
+
type: multimodal
|
53 |
+
dataset:
|
54 |
+
name: InfoVQA
|
55 |
+
type: infovqa
|
56 |
+
metrics:
|
57 |
+
- type: accuracy
|
58 |
+
value: 83.2
|
59 |
+
name: accuracy
|
60 |
+
verified: true
|
61 |
+
- task:
|
62 |
+
type: multimodal
|
63 |
+
dataset:
|
64 |
+
name: MathVerse
|
65 |
+
type: mathverse
|
66 |
+
metrics:
|
67 |
+
- type: accuracy
|
68 |
+
value: 50.0
|
69 |
+
name: accuracy
|
70 |
+
verified: true
|
71 |
+
- task:
|
72 |
+
type: multimodal
|
73 |
+
dataset:
|
74 |
+
name: MathVista
|
75 |
+
type: mathvista
|
76 |
+
metrics:
|
77 |
+
- type: accuracy
|
78 |
+
value: 69.9
|
79 |
+
name: accuracy
|
80 |
+
verified: true
|
81 |
+
- task:
|
82 |
+
type: multimodal
|
83 |
+
dataset:
|
84 |
+
name: MMBench
|
85 |
+
type: mmbench
|
86 |
+
metrics:
|
87 |
+
- type: accuracy
|
88 |
+
value: 86.4
|
89 |
+
name: accuracy
|
90 |
+
verified: true
|
91 |
+
- task:
|
92 |
+
type: multimodal
|
93 |
+
dataset:
|
94 |
+
name: MME
|
95 |
+
type: mme
|
96 |
+
metrics:
|
97 |
+
- type: score
|
98 |
+
value: 2402
|
99 |
+
name: score
|
100 |
+
verified: true
|
101 |
+
- task:
|
102 |
+
type: multimodal
|
103 |
+
dataset:
|
104 |
+
name: MMVet
|
105 |
+
type: mmvet
|
106 |
+
metrics:
|
107 |
+
- type: accuracy
|
108 |
+
value: 64.8
|
109 |
+
name: accuracy
|
110 |
+
verified: true
|
111 |
+
- task:
|
112 |
+
type: multimodal
|
113 |
+
dataset:
|
114 |
+
name: OCRBench
|
115 |
+
type: ocrbench
|
116 |
+
metrics:
|
117 |
+
- type: accuracy
|
118 |
+
value: 843
|
119 |
+
name: accuracy
|
120 |
+
verified: true
|
121 |
+
- task:
|
122 |
+
type: multimodal
|
123 |
+
dataset:
|
124 |
+
name: RealWorldQA
|
125 |
+
type: realworldqa
|
126 |
+
metrics:
|
127 |
+
- type: accuracy
|
128 |
+
value: 71.0
|
129 |
+
name: accuracy
|
130 |
+
verified: true
|
131 |
+
- task:
|
132 |
+
type: multimodal
|
133 |
+
dataset:
|
134 |
+
name: Seed-Bench-Image
|
135 |
+
type: seed-bench-image
|
136 |
+
metrics:
|
137 |
+
- type: accuracy
|
138 |
+
value: 76.6
|
139 |
+
name: accuracy
|
140 |
+
verified: true
|
141 |
+
- task:
|
142 |
+
type: multimodal
|
143 |
+
dataset:
|
144 |
+
name: Science-QA
|
145 |
+
type: science-qa
|
146 |
+
metrics:
|
147 |
+
- type: accuracy
|
148 |
+
value: 98.2
|
149 |
+
name: accuracy
|
150 |
+
verified: true
|
151 |
+
- task:
|
152 |
+
type: multimodal
|
153 |
+
dataset:
|
154 |
+
name: TextVQA
|
155 |
+
type: textvqa
|
156 |
+
metrics:
|
157 |
+
- type: accuracy
|
158 |
+
value: 81.4
|
159 |
+
name: accuracy
|
160 |
+
verified: true
|
161 |
+
- task:
|
162 |
+
name: Automatic Speech Recognition
|
163 |
+
type: automatic-speech-recognition
|
164 |
+
dataset:
|
165 |
+
name: LibriSpeech (clean)
|
166 |
+
type: librispeech_asr
|
167 |
+
config: clean
|
168 |
+
split: test
|
169 |
+
args:
|
170 |
+
language: en
|
171 |
+
metrics:
|
172 |
+
- name: Test WER
|
173 |
+
type: wer
|
174 |
+
value: 2.9
|
175 |
---
|
176 |
|
177 |
+
# EMOVA-Qwen-2.5-72B-HF
|
178 |
|
179 |
+
<div align="center">
|
180 |
+
|
181 |
+
<img src="https://emova-ollm.github.io/static/images/icons/emova_icon2.png" width="300em"></img>
|
182 |
|
183 |
+
🤗 [EMOVA-Models](https://huggingface.co/collections/Emova-ollm/emova-models-67779d377bb8261e6057a320) | 🤗 [EMOVA-Datasets](https://huggingface.co/collections/Emova-ollm/emova-datasets-67779be7d02447a2d0891bf6) | 🤗 [EMOVA-Demo](https://huggingface.co/spaces/Emova-ollm/EMOVA-demo) <br/>
|
184 |
+
📄 [Paper](https://arxiv.org/abs/2409.18042) | 🌐 [Project-Page](https://emova-ollm.github.io/) | 💻 [Github](https://github.com/emova-ollm/EMOVA) | 💻 [EMOVA-Speech-Tokenizer-Github](https://github.com/emova-ollm/EMOVA_speech_tokenizer)
|
185 |
+
|
186 |
+
</div>
|
187 |
+
|
188 |
+
## Model Summary
|
189 |
+
|
190 |
+
**EMOVA** (**EM**otionally **O**mni-present **V**oice **A**ssistant) is a novel end-to-end omni-modal LLM that can see, hear and speak without relying on external models. Given the omni-modal (i.e., textual, visual and speech) inputs, EMOVA can generate both textual and speech responses with vivid emotional controls by utilizing the speech decoder together with a style encoder. EMOVA possesses general omni-modal understanding and generation capabilities, featuring its superiority in advanced vision-language understanding, emotional spoken dialogue, and spoken dialogue with structural data understanding. We summarize its key advantages as:
|
191 |
+
|
192 |
+
- **State-of-the-art omni-modality performance**: EMOVA achieves state-of-the-art comparable results on both **vision-language** and **speech** benchmarks simultaneously. Our best performing model, **EMOVA-72B**, even surpasses commercial models including GPT-4o and Gemini Pro 1.5.
|
193 |
+
- **Emotional spoken dialogue**: A **semantic-acoustic disentangled** speech tokenizer and a lightweight **style control** module are adopted for seamless omni-modal alignment and diverse speech style controllability. EMOVA supports **bilingual (Chinese and English)** spoken dialogue with **24 speech style** controls (i.e., 2 speakers, 3 pitches and 4 emotions).
|
194 |
+
- **Diverse configurations**: We open-source 3 configurations, **EMOVA-3B/7B/72B**, to support omni-modal usage under different computational budgets. Check our [Model Zoo](https://huggingface.co/collections/Emova-ollm/emova-models-67779d377bb8261e6057a320) and find the best fit model for your computational devices!
|
195 |
+
|
196 |
+
<div align="center">
|
197 |
+
<img src="https://emova-ollm.github.io/static/images/model_architecture.png" width=100%></img>
|
198 |
+
</div>
|
199 |
+
|
200 |
+
|
201 |
+
## Performance
|
202 |
+
|
203 |
+
|
204 |
+
| Benchmarks | EMOVA-3B | EMOVA-7B | EMOVA-72B | GPT-4o | VITA 8x7B | VITA 1.5 | Baichuan-Omni |
|
205 |
+
|:------------------:|:-------: |:--------:|:---------:|:------:|:---------:|:--------:|:-------------:|
|
206 |
+
| **MME** | 2175 | 2317 | 2402 | 2310 | 2097 | 2311 | 2187 |
|
207 |
+
| **MMBench** | 79.2 | 83.0 | 86.4 | 83.4 | 71.8 | 76.6 | 76.2 |
|
208 |
+
| **SEED-Image** | 74.9 | 75.5 | 76.6 | 77.1 | 72.6 | 74.2 | 74.1 |
|
209 |
+
| **MM-Vet** | 57.3 | 59.4 | 64.8 | - | 41.6 | 51.1 | 65.4 |
|
210 |
+
| **RealWorldQA** | 62.6 | 67.5 | 71.0 | 75.4 | 59.0 | 66.8 | 62.6 |
|
211 |
+
| **TextVQA** | 77.2 | 78.0 | 81.4 | - | 71.8 | 74.9 | 74.3 |
|
212 |
+
| **ChartQA** | 81.5 | 84.9 | 88.7 | 85.7 | 76.6 | 79.6 | 79.6 |
|
213 |
+
| **DocVQA** | 93.5 | 94.2 | 95.9 | 92.8 | - | - | - |
|
214 |
+
| **InfoVQA** | 71.2 | 75.1 | 83.2 | - | - | - | - |
|
215 |
+
| **OCRBench** | 803 | 814 | 843 | 736 | 678 | 752 | 700 |
|
216 |
+
| **ScienceQA-Img** | 92.7 | 96.4 | 98.2 | - | - | - | - |
|
217 |
+
| **AI2D** | 78.6 | 81.7 | 85.8 | 84.6 | 73.1 | 79.3 | - |
|
218 |
+
| **MathVista** | 62.6 | 65.5 | 69.9 | 63.8 | 44.9 | 66.2 | 51.9 |
|
219 |
+
| **Mathverse** | 31.4 | 40.9 | 50.0 | - | - | - | - |
|
220 |
+
| **Librispeech (WER↓)** | 5.4 | 4.1 | 2.9 | - | 3.4 | 8.1 | - |
|
221 |
+
|
222 |
+
|
223 |
+
## Usage
|
224 |
+
|
225 |
+
This repo contains the **EMOVA-Qwen2.5-72B** checkpoint organized in the **HuggingFace format**, and thus, can be directly loaded with **transformers Auto APIs**.
|
226 |
+
|
227 |
+
```python
|
228 |
+
from transformers import AutoModel, AutoProcessor
|
229 |
+
from PIL import Image
|
230 |
+
import torch
|
231 |
+
|
232 |
+
### Uncomment if you want to use Ascend NPUs
|
233 |
+
# import torch_npu
|
234 |
+
# from torch_npu.contrib import transfer_to_npu
|
235 |
+
|
236 |
+
# prepare models and processors
|
237 |
+
model = AutoModel.from_pretrained(
|
238 |
+
"Emova-ollm/emova-qwen-2-5-72b-hf",
|
239 |
+
torch_dtype=torch.bfloat16,
|
240 |
+
attn_implementation='flash_attention_2', # OR 'sdpa' for Ascend NPUs
|
241 |
+
low_cpu_mem_usage=True,
|
242 |
+
trust_remote_code=True).eval().cuda()
|
243 |
+
processor = AutoProcessor.from_pretrained("Emova-ollm/emova-qwen-2-5-72b-hf", trust_remote_code=True)
|
244 |
+
|
245 |
+
# only necessary for spoken dialogue
|
246 |
+
# Note to inference with speech inputs/outputs, **emova_speech_tokenizer** is still a necessary dependency (https://huggingface.co/Emova-ollm/emova_speech_tokenizer_hf#install).
|
247 |
+
speeck_tokenizer = AutoModel.from_pretrained("Emova-ollm/emova_speech_tokenizer_hf", torch_dtype=torch.float32, trust_remote_code=True).eval().cuda()
|
248 |
+
processor.set_speech_tokenizer(speeck_tokenizer)
|
249 |
+
|
250 |
+
# Example 1: image-text
|
251 |
+
inputs = dict(
|
252 |
+
text=[
|
253 |
+
{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant."}]},
|
254 |
+
{"role": "user", "content": [{"type": "image"}, {"type": "text", "text": "What's shown in this image?"}]},
|
255 |
+
{"role": "assistant", "content": [{"type": "text", "text": "This image shows a red stop sign."}]},
|
256 |
+
{"role": "user", "content": [{"type": "text", "text": "Describe the image in more details."}]},
|
257 |
+
],
|
258 |
+
images=Image.open('path/to/image')
|
259 |
+
)
|
260 |
+
|
261 |
+
# Example 2: text-audio
|
262 |
+
inputs = dict(
|
263 |
+
text=[{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant."}]}],
|
264 |
+
audios='path/to/audio'
|
265 |
+
)
|
266 |
+
|
267 |
+
# Example 3: image-text-audio
|
268 |
+
inputs = dict(
|
269 |
+
text=[{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant."}]}],
|
270 |
+
images=Image.open('path/to/image'),
|
271 |
+
audios='path/to/audio'
|
272 |
+
)
|
273 |
+
|
274 |
+
# run processors
|
275 |
+
has_speech = 'audios' in inputs.keys()
|
276 |
+
inputs = processor(**inputs, return_tensors="pt")
|
277 |
+
inputs = inputs.to(model.device)
|
278 |
+
|
279 |
+
# prepare generation arguments
|
280 |
+
gen_kwargs = {"max_new_tokens": 4096, "do_sample": False} # add if necessary
|
281 |
+
speech_kwargs = {"speaker": "female", "output_wav_prefix": "output"} if has_speech else {}
|
282 |
+
|
283 |
+
# run generation
|
284 |
+
# for speech outputs, we will return the saved wav paths (c.f., output_wav_prefix)
|
285 |
+
with torch.no_grad():
|
286 |
+
outputs = model.generate(**inputs, **gen_kwargs)
|
287 |
+
outputs = outputs[:, inputs['input_ids'].shape[1]:]
|
288 |
+
print(processor.batch_decode(outputs, skip_special_tokens=True, **speech_kwargs))
|
289 |
+
```
|
290 |
+
|
291 |
+
## Citation
|
292 |
+
|
293 |
+
```bibtex
|
294 |
+
@article{chen2024emova,
|
295 |
+
title={Emova: Empowering language models to see, hear and speak with vivid emotions},
|
296 |
+
author={Chen, Kai and Gou, Yunhao and Huang, Runhui and Liu, Zhili and Tan, Daxin and Xu, Jing and Wang, Chunwei and Zhu, Yi and Zeng, Yihan and Yang, Kuo and others},
|
297 |
+
journal={arXiv preprint arXiv:2409.18042},
|
298 |
+
year={2024}
|
299 |
+
}
|
300 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|