Emova Qwen 2 5 3b Hf
EMOVA是一种端到端全能模态大语言模型,支持视觉、听觉和语音功能,具备情感语音对话能力。
下载量 101
发布时间 : 3/11/2025
模型简介
EMOVA是一种新颖的端到端全能模态大语言模型,无需依赖外部模型即可实现视觉、听觉和语音功能。通过接收全能模态(即文本、视觉和语音)输入,EMOVA能够利用语音解码器和风格编码器生成带有生动情感控制的文本和语音响应。
模型特点
全能模态性能
在视觉语言和语音基准测试中同时达到顶尖可比结果,支持文本、视觉和语音输入输出。
情感语音对话
采用语义-声学解耦的语音分词器和轻量级风格控制模块,支持双语(中文和英文)语音对话和24种语音风格控制。
多样化配置
提供3B/7B/72B三种配置,支持不同计算预算下的全能模态使用。
模型能力
视觉语言理解
语音识别
情感语音生成
多模态对话
图像描述生成
文档理解
图表理解
数学问题解答
使用案例
智能助手
情感化语音助手
构建能够理解用户情感并做出相应语音回应的智能助手
支持24种语音风格控制
教育
多模态学习辅助
帮助学生理解图表、数学问题和科学概念
在ScienceQA-Img上达到92.7%准确率
客户服务
情感化客服机器人
提供带有情感色彩的客户服务对话
支持中文和英文双语服务
🚀 EMOVA-Qwen-2.5-3B-HF
EMOVA-Qwen-2.5-3B-HF 是一款端到端的全模态大语言模型,无需依赖外部模型,就能实现视觉、听觉和语言交互。它能根据文本、视觉和语音等多模态输入,生成文本和语音响应,并实现生动的情感控制。该模型具备通用的全模态理解和生成能力,在高级视觉语言理解、情感语音对话以及结构化数据理解的语音对话方面表现出色。
🚀 快速开始
本仓库包含以 HuggingFace 格式组织的 EMOVA-Qwen2.5-3B 检查点,因此可以使用 transformers Auto APIs 直接加载。
from transformers import AutoModel, AutoProcessor
from PIL import Image
import torch
### Uncomment if you want to use Ascend NPUs
# import torch_npu
# from torch_npu.contrib import transfer_to_npu
# prepare models and processors
model = AutoModel.from_pretrained(
"Emova-ollm/emova-qwen-2-5-3b-hf",
torch_dtype=torch.bfloat16,
attn_implementation='flash_attention_2', # OR 'sdpa' for Ascend NPUs
low_cpu_mem_usage=True,
trust_remote_code=True).eval().cuda()
processor = AutoProcessor.from_pretrained("Emova-ollm/emova-qwen-2-5-3b-hf", trust_remote_code=True)
# only necessary for spoken dialogue
# 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).
speeck_tokenizer = AutoModel.from_pretrained("Emova-ollm/emova_speech_tokenizer_hf", torch_dtype=torch.float32, trust_remote_code=True).eval().cuda()
processor.set_speech_tokenizer(speeck_tokenizer)
# Example 1: image-text
inputs = dict(
text=[
{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant."}]},
{"role": "user", "content": [{"type": "image"}, {"type": "text", "text": "What's shown in this image?"}]},
{"role": "assistant", "content": [{"type": "text", "text": "This image shows a red stop sign."}]},
{"role": "user", "content": [{"type": "text", "text": "Describe the image in more details."}]},
],
images=Image.open('path/to/image')
)
# Example 2: text-audio
inputs = dict(
text=[{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant."}]}],
audios='path/to/audio'
)
# Example 3: image-text-audio
inputs = dict(
text=[{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant."}]}],
images=Image.open('path/to/image'),
audios='path/to/audio'
)
# run processors
has_speech = 'audios' in inputs.keys()
inputs = processor(**inputs, return_tensors="pt")
inputs = inputs.to(model.device)
# prepare generation arguments
gen_kwargs = {"max_new_tokens": 4096, "do_sample": False} # add if necessary
speech_kwargs = {"speaker": "female", "output_wav_prefix": "output"} if has_speech else {}
# run generation
# for speech outputs, we will return the saved wav paths (c.f., output_wav_prefix)
with torch.no_grad():
outputs = model.generate(**inputs, **gen_kwargs)
outputs = outputs[:, inputs['input_ids'].shape[1]:]
print(processor.batch_decode(outputs, skip_special_tokens=True, **speech_kwargs))
✨ 主要特性
- 先进的全模态性能:EMOVA 在 视觉语言 和 语音 基准测试中同时取得了先进的可比结果。表现最佳的 EMOVA-72B 模型甚至超越了包括 GPT-4o 和 Gemini Pro 1.5 在内的商业模型。
- 情感语音对话:采用了 语义 - 声学解耦 的语音分词器和轻量级的 风格控制 模块,实现了无缝的全模态对齐和多样化的语音风格控制。EMOVA 支持 双语(中文和英文) 语音对话,具备 24 种语音风格 控制(即 2 种说话者、3 种音高和 4 种情感)。
- 多样化的配置:开源了 3 种配置,即 EMOVA-3B/7B/72B,以支持不同计算预算下的全模态使用。可以查看 模型库,为计算设备找到最合适的模型!
📦 安装指南
文档未提及安装步骤,故跳过该章节。
💻 使用示例
基础用法
# 以下是使用 EMOVA-Qwen-2.5-3B-HF 进行图像 - 文本交互的示例代码
from transformers import AutoModel, AutoProcessor
from PIL import Image
import torch
### Uncomment if you want to use Ascend NPUs
# import torch_npu
# from torch_npu.contrib import transfer_to_npu
# prepare models and processors
model = AutoModel.from_pretrained(
"Emova-ollm/emova-qwen-2-5-3b-hf",
torch_dtype=torch.bfloat16,
attn_implementation='flash_attention_2', # OR 'sdpa' for Ascend NPUs
low_cpu_mem_usage=True,
trust_remote_code=True).eval().cuda()
processor = AutoProcessor.from_pretrained("Emova-ollm/emova-qwen-2-5-3b-hf", trust_remote_code=True)
# only necessary for spoken dialogue
# 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).
speeck_tokenizer = AutoModel.from_pretrained("Emova-ollm/emova_speech_tokenizer_hf", torch_dtype=torch.float32, trust_remote_code=True).eval().cuda()
processor.set_speech_tokenizer(speeck_tokenizer)
# Example 1: image-text
inputs = dict(
text=[
{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant."}]},
{"role": "user", "content": [{"type": "image"}, {"type": "text", "text": "What's shown in this image?"}]},
{"role": "assistant", "content": [{"type": "text", "text": "This image shows a red stop sign."}]},
{"role": "user", "content": [{"type": "text", "text": "Describe the image in more details."}]},
],
images=Image.open('path/to/image')
)
# run processors
has_speech = 'audios' in inputs.keys()
inputs = processor(**inputs, return_tensors="pt")
inputs = inputs.to(model.device)
# prepare generation arguments
gen_kwargs = {"max_new_tokens": 4096, "do_sample": False} # add if necessary
speech_kwargs = {"speaker": "female", "output_wav_prefix": "output"} if has_speech else {}
# run generation
# for speech outputs, we will return the saved wav paths (c.f., output_wav_prefix)
with torch.no_grad():
outputs = model.generate(**inputs, **gen_kwargs)
outputs = outputs[:, inputs['input_ids'].shape[1]:]
print(processor.batch_decode(outputs, skip_special_tokens=True, **speech_kwargs))
高级用法
# 以下是使用 EMOVA-Qwen-2.5-3B-HF 进行图像 - 文本 - 音频交互的示例代码
from transformers import AutoModel, AutoProcessor
from PIL import Image
import torch
### Uncomment if you want to use Ascend NPUs
# import torch_npu
# from torch_npu.contrib import transfer_to_npu
# prepare models and processors
model = AutoModel.from_pretrained(
"Emova-ollm/emova-qwen-2-5-3b-hf",
torch_dtype=torch.bfloat16,
attn_implementation='flash_attention_2', # OR 'sdpa' for Ascend NPUs
low_cpu_mem_usage=True,
trust_remote_code=True).eval().cuda()
processor = AutoProcessor.from_pretrained("Emova-ollm/emova-qwen-2-5-3b-hf", trust_remote_code=True)
# only necessary for spoken dialogue
# 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).
speeck_tokenizer = AutoModel.from_pretrained("Emova-ollm/emova_speech_tokenizer_hf", torch_dtype=torch.float32, trust_remote_code=True).eval().cuda()
processor.set_speech_tokenizer(speeck_tokenizer)
# Example 3: image-text-audio
inputs = dict(
text=[{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant."}]}],
images=Image.open('path/to/image'),
audios='path/to/audio'
)
# run processors
has_speech = 'audios' in inputs.keys()
inputs = processor(**inputs, return_tensors="pt")
inputs = inputs.to(model.device)
# prepare generation arguments
gen_kwargs = {"max_new_tokens": 4096, "do_sample": False} # add if necessary
speech_kwargs = {"speaker": "female", "output_wav_prefix": "output"} if has_speech else {}
# run generation
# for speech outputs, we will return the saved wav paths (c.f., output_wav_prefix)
with torch.no_grad():
outputs = model.generate(**inputs, **gen_kwargs)
outputs = outputs[:, inputs['input_ids'].shape[1]:]
print(processor.batch_decode(outputs, skip_special_tokens=True, **speech_kwargs))
📚 详细文档
模型信息
属性 | 详情 |
---|---|
模型类型 | 多模态大语言模型 |
训练数据 | Emova-ollm/emova-alignment-7m、Emova-ollm/emova-sft-4m、Emova-ollm/emova-sft-speech-231k |
基础模型 | Emova-ollm/qwen2vit600m、Emova-ollm/Qwen2.5-3B-Instruct_add_speech_token_4096_nostrip |
性能表现
基准测试 | EMOVA-3B | EMOVA-7B | EMOVA-72B | GPT-4o | VITA 8x7B | VITA 1.5 | 百川全模态 |
---|---|---|---|---|---|---|---|
MME | 2175 | 2317 | 2402 | 2310 | 2097 | 2311 | 2187 |
MMBench | 79.2 | 83.0 | 86.4 | 83.4 | 71.8 | 76.6 | 76.2 |
SEED-Image | 74.9 | 75.5 | 76.6 | 77.1 | 72.6 | 74.2 | 74.1 |
MM-Vet | 57.3 | 59.4 | 64.8 | - | 41.6 | 51.1 | 65.4 |
RealWorldQA | 62.6 | 67.5 | 71.0 | 75.4 | 59.0 | 66.8 | 62.6 |
TextVQA | 77.2 | 78.0 | 81.4 | - | 71.8 | 74.9 | 74.3 |
ChartQA | 81.5 | 84.9 | 88.7 | 85.7 | 76.6 | 79.6 | 79.6 |
DocVQA | 93.5 | 94.2 | 95.9 | 92.8 | - | - | - |
InfoVQA | 71.2 | 75.1 | 83.2 | - | - | - | - |
OCRBench | 803 | 814 | 843 | 736 | 678 | 752 | 700 |
ScienceQA-Img | 92.7 | 96.4 | 98.2 | - | - | - | - |
AI2D | 78.6 | 81.7 | 85.8 | 84.6 | 73.1 | 79.3 | - |
MathVista | 62.6 | 65.5 | 69.9 | 63.8 | 44.9 | 66.2 | 51.9 |
Mathverse | 31.4 | 40.9 | 50.0 | - | - | - | - |
Librispeech (WER↓) | 5.4 | 4.1 | 2.9 | - | 3.4 | 8.1 | - |
🔧 技术细节
文档未提供相关技术细节,故跳过该章节。
📄 许可证
本模型采用 Apache-2.0 许可证。
📚 引用
@article{chen2024emova,
title={Emova: Empowering language models to see, hear and speak with vivid emotions},
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},
journal={arXiv preprint arXiv:2409.18042},
year={2024}
}
Align Base
ALIGN是一个视觉-语言双编码器模型,通过对比学习实现图像与文本表征的对齐,利用大规模噪声数据实现先进的跨模态表征效果。
多模态对齐
Transformers 英语

A
kakaobrain
78.28k
25
Biomedvlp CXR BERT Specialized
MIT
针对胸部X光领域优化的语言模型,通过改进词汇表、创新预训练流程和文本增强技术实现卓越性能
多模态对齐
Transformers 英语

B
microsoft
35.69k
28
Languagebind Image
MIT
LanguageBind是一种以语言为中心的多模态预训练方法,通过语言作为不同模态之间的纽带,实现语义对齐。
多模态对齐
Transformers

L
LanguageBind
25.71k
11
Languagebind Video FT
MIT
LanguageBind是一种以语言为中心的多模态预训练方法,通过语言作为不同模态之间的纽带,实现视频、红外、深度、音频等多种模态的语义对齐。
多模态对齐
Transformers

L
LanguageBind
22.97k
4
Languagebind Audio FT
MIT
LanguageBind是一种以语言为中心的多模态预训练方法,通过语言作为不同模态间的纽带实现语义对齐。
多模态对齐
Transformers

L
LanguageBind
12.59k
1
Languagebind Video Merge
MIT
LanguageBind是一种通过基于语言的语义对齐将视频-语言预训练扩展至N模态的多模态模型,获得了ICLR 2024的接收。
多模态对齐
Transformers

L
LanguageBind
10.96k
4
E5 V
E5-V是基于多模态大语言模型的通用嵌入方法,能够处理文本和图像输入并生成统一的嵌入表示。
多模态对齐
Transformers

E
royokong
5,619
22
M BERT Base ViT B
基于BERT-base-multilingual微调的多语言CLIP文本编码器,支持69种语言与CLIP视觉编码器对齐
多模态对齐
M
M-CLIP
3,376
12
M3D CLIP
Apache-2.0
M3D-CLIP是专为3D医学影像设计的CLIP模型,通过对比损失实现视觉与语言的对齐。
多模态对齐
Transformers

M
GoodBaiBai88
2,962
9
Languagebind Video Huge V1.5 FT
MIT
LanguageBind 是一种通过语言实现多模态语义对齐的预训练模型,能够将视频、音频、深度、热成像等多种模态与语言进行绑定,实现跨模态的理解和检索。
多模态对齐
Transformers

L
LanguageBind
2,711
4
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98