cpu4dream/llava-small-OpenELM-AIMv2-0.6B-auto
<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:
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)