CoolFace
Modelpublic

cpu4dream/llava-small-OpenELM-AIMv2-0.6B-auto

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes10downloads
Model Card

<center><span style="font-size:2em;">Tiny Llava 4 CPU ๐Ÿ›</span></center>


๐Ÿš€ Model Overview

tiny-llava-open-elm-aimv2 is a lightweight image-text-to-text model that combines [OpenELM 270M - INSTRUCT](https://huggingface.co/apple/OpenELM-270M-Instruct) as the LLM backbone and [AIMv2-Large-Patch14-224-distilled (309M)](https://huggingface.co/apple/aimv2-large-patch14-224-distilled) as the vision encoder. The model has been fine-tuned using LoRA (Low-Rank Adaptation) for efficient training. It was developed using the [TinyLLaVA Factory](https://github.com/TinyLLaVA/TinyLLaVA_Factory) codebase, which provides a modular framework for lightweight multi-modal models.

The model is designed to run efficiently on CPU, making it ideal for resource-constrained environments. It is trained and evaluated on POPE and TextVQA benchmarks. The total model size is 0.6B parameters.


Usage

Execute the following test code:

python
from transformers import AutoTokenizer, AutoModelForCausalLM
hf_path = 'cpu4dream/llava-small-OpenELM-AIMv2-0.6B-auto'
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)

๐Ÿ“Š Performance

Model NameVQAv2GQASQATextVQAMM-VETPOPEMMEMMMU
LLaVA-1.5-7B78.562.066.858.230.585.91510.7-
bczhou/TinyLLaVA-3.1B79.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
cpu4dream/llava-small-OpenELM-AIMv2-0.6B---39.68-83.93--

๐Ÿ”— References