Update README.md
Browse files
README.md
CHANGED
@@ -181,7 +181,7 @@ model-index:
|
|
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 |
-
π [
|
185 |
|
186 |
</div>
|
187 |
|
@@ -191,13 +191,103 @@ model-index:
|
|
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](
|
195 |
|
196 |
<div align="center">
|
197 |
-
<img src="
|
198 |
</div>
|
199 |
|
200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
## Citation
|
202 |
|
203 |
```bibtex
|
|
|
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 |
|
|
|
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-7B** checkpoint organized in the **HuggingFace format**, and thus, and 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-7b-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-7b-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
|