🚀 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許可證。