🚀 TinyLLaVA
TinyLLaVA发布了一系列小规模的大多模态模型(LMMs),模型规模从0.55B到3.1B不等。我们表现最优的模型TinyLLaVA - Phi - 2 - SigLIP - 3.1B,在整体性能上优于现有的7B模型,如LLaVA - 1.5和Qwen - VL。
🚀 快速开始
模型介绍
这里,我们介绍TinyLLaVA - OpenELM - 450M - SigLIP - 0.89B,该模型由TinyLLaVA Factory代码库训练得到。对于大语言模型(LLM)和视觉塔,我们分别选择了[OpenELM - 450M - Instruct](apple/OpenELM - 450M - Instruct)和[siglip - so400m - patch14 - 384](https://huggingface.co/google/siglip - so400m - patch14 - 384)。训练此模型使用的数据集是[LLaVA](https://github.com/haotian - liu/LLaVA/blob/main/docs/Data.md)数据集。
使用示例
基础用法
执行以下测试代码:
from transformers import AutoTokenizer, AutoModelForCausalLM
hf_path = 'jiajunlong/TinyLLaVA-OpenELM-450M-SigLIP-0.89B'
model = AutoModelForCausalLM.from_pretrained(hf_path, trust_remote_code=True)
model.cuda()
config = model.config
tokenizer = AutoTokenizer.from_pretrained(hf_path, use_fast=False, model_max_length = config.tokenizer_model_max_length,padding_side = config.tokenizer_padding_side)
prompt="What are these?"
image_url="http://images.cocodataset.org/test-stuff2017/000000000001.jpg"
output_text, genertaion_time = model.chat(prompt=prompt, image=image_url, tokenizer=tokenizer)
print('model output:', output_text)
print('runing time:', genertaion_time)
结果展示
模型名称 |
GQA |
TextVQA |
SQA |
VQAv2 |
MME |
MMB |
MM - VET |
[TinyLLaVA - 1.5B](https://huggingface.co/bczhou/TinyLLaVA - 1.5B) |
60.3 |
51.7 |
60.3 |
76.9 |
1276.5 |
55.2 |
25.8 |
[TinyLLaVA - 0.89B](https://huggingface.co/jiajunlong/TinyLLaVA - OpenELM - 450M - SigLIP - 0.89B) |
53.87 |
44.02 |
54.09 |
71.74 |
1118.75 |
37.8 |
20 |
关于TinyLLaVA Factory
TinyLLaVA Factory是一个用于小规模大多模态模型的开源模块化代码库,专注于代码实现的简洁性、新特性的可扩展性以及训练结果的可复现性。此代码仓库提供了标准的训练和评估流程、灵活的数据预处理和模型配置,以及易于扩展的架构。用户可以用最少的编码工作和更少的编码错误来定制自己的大多模态模型。
TinyLLaVA Factory集成了一系列前沿的模型和方法:
- 大语言模型(LLM)目前支持OpenELM、TinyLlama、StableLM、Qwen、Gemma和Phi。
- 视觉塔目前支持CLIP、SigLIP、Dino以及CLIP和Dino的组合。
- 连接器目前支持MLP、Qformer和Resampler。
📄 许可证
本项目采用Apache - 2.0许可证。