tinyllava/TinyLLaVA-Gemma-SigLIP-2.4B

Model

TinyLLaVA

1

18 commits

3 repos using this model

3 linked in READMEs

updated May 18, 2024

See the code

README

TinyLLaVA

arXivGithubDemo TinyLLaVA has released a family of small-scale Large Multimodel Models(LMMs), ranging from 1.4B to 3.1B. Our best model, TinyLLaVA-Phi-2-SigLIP-3.1B, achieves better overall performance against existing 7B models such as LLaVA-1.5 and Qwen-VL.

Here, we introduce TinyLLaVA-Gemma-SigLIP-2.4B, which is trained by the TinyLLaVA Factory codebase. For LLM and vision tower, we choose Gemma-2B and siglip-so400m-patch14-384, respectively. The dataset used for training this model is the LLaVA dataset.

Usage

Before executing the following test code, you need to have the access to google/gemma-2b-it.

from transformers import AutoTokenizer, AutoModelForCausalLM

hf_path = 'tinyllava/TinyLLaVA-Gemma-SigLIP-2.4B'
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)

Result

model_namevqav2gqasqatextvqaMM-VETPOPEMMEMMMU
LLaVA-1.5-7B78.562.066.858.230.585.91510.7-
bczhou/TinyLLaVA-3.1B (our legacy model)79.962.069.159.132.086.41464.9-
tinyllava/TinyLLaVA-Gemma-SigLIP-2.4B78.461.664.453.626.986.41339.031.7
tinyllava/TinyLLaVA-Phi-2-SigLIP-3.1B80.162.173.060.337.587.21466.438.4

P.S. TinyLLaVA Factory is an open-source modular codebase for small-scale LMMs with a focus on simplicity of code implementations, extensibility of new features, and reproducibility of training results. This code repository provides standard training&evaluating pipelines, flexible data preprocessing&model configurations, and easily extensible architectures. Users can customize their own LMMs with minimal coding effort and less coding mistake.

TinyLLaVA Factory integrates a suite of cutting-edge models and methods.

  • LLM currently supports OpenELM, TinyLlama, StableLM, Qwen, Gemma, and Phi.
  • Vision tower currently supports CLIP, SigLIP, Dino, and combination of CLIP and Dino.
  • Connector currently supports MLP, Qformer, and Resampler.
conversational
custom_code
image-text-to-text
safetensors
text-generation
tinyllava
transformers

tinyllava/TinyLLaVA-Gemma-SigLIP-2.4B

Model

TinyLLaVA

1

18 commits

3 repos using this model

3 linked in READMEs

updated May 18, 2024

See the code

README

TinyLLaVA

arXivGithubDemo TinyLLaVA has released a family of small-scale Large Multimodel Models(LMMs), ranging from 1.4B to 3.1B. Our best model, TinyLLaVA-Phi-2-SigLIP-3.1B, achieves better overall performance against existing 7B models such as LLaVA-1.5 and Qwen-VL.

Here, we introduce TinyLLaVA-Gemma-SigLIP-2.4B, which is trained by the TinyLLaVA Factory codebase. For LLM and vision tower, we choose Gemma-2B and siglip-so400m-patch14-384, respectively. The dataset used for training this model is the LLaVA dataset.

Usage

Before executing the following test code, you need to have the access to google/gemma-2b-it.

from transformers import AutoTokenizer, AutoModelForCausalLM

hf_path = 'tinyllava/TinyLLaVA-Gemma-SigLIP-2.4B'
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)

Result

model_namevqav2gqasqatextvqaMM-VETPOPEMMEMMMU
LLaVA-1.5-7B78.562.066.858.230.585.91510.7-
bczhou/TinyLLaVA-3.1B (our legacy model)79.962.069.159.132.086.41464.9-
tinyllava/TinyLLaVA-Gemma-SigLIP-2.4B78.461.664.453.626.986.41339.031.7
tinyllava/TinyLLaVA-Phi-2-SigLIP-3.1B80.162.173.060.337.587.21466.438.4

P.S. TinyLLaVA Factory is an open-source modular codebase for small-scale LMMs with a focus on simplicity of code implementations, extensibility of new features, and reproducibility of training results. This code repository provides standard training&evaluating pipelines, flexible data preprocessing&model configurations, and easily extensible architectures. Users can customize their own LMMs with minimal coding effort and less coding mistake.

TinyLLaVA Factory integrates a suite of cutting-edge models and methods.

  • LLM currently supports OpenELM, TinyLlama, StableLM, Qwen, Gemma, and Phi.
  • Vision tower currently supports CLIP, SigLIP, Dino, and combination of CLIP and Dino.
  • Connector currently supports MLP, Qformer, and Resampler.
conversational
custom_code
image-text-to-text
safetensors
text-generation
tinyllava
transformers