Views
No views yet
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3hf_path = 'tinyllava/TinyLLaVA-Phi-2-SigLIP-3.1B'
4model = AutoModelForCausalLM.from_pretrained(hf_path, trust_remote_code=True)
5model.cuda()
6config = model.config
7tokenizer = AutoTokenizer.from_pretrained(hf_path, use_fast=False, model_max_length = config.tokenizer_model_max_length,padding_side = config.tokenizer_padding_side)
8prompt="What are these?"
9image_url="http://images.cocodataset.org/test-stuff2017/000000000001.jpg"
10output_text, genertaion_time = model.chat(prompt=prompt, image=image_url, tokenizer=tokenizer)
11
12print('model output:', output_text)
13print('runing time:', genertaion_time)| model_name | vqav2 | gqa | sqa | textvqa | MM-VET | POPE | MME | MMMU |
|---|---|---|---|---|---|---|---|---|
| LLaVA-1.5-7B | 78.5 | 62.0 | 66.8 | 58.2 | 30.5 | 85.9 | 1510.7 | - |
| bczhou/TinyLLaVA-3.1B (our legacy model) | 79.9 | 62.0 | 69.1 | 59.1 | 32.0 | 86.4 | 1464.9 | - |
| tinyllava/TinyLLaVA-Gemma-SigLIP-2.4B | 78.4 | 61.6 | 64.4 | 53.6 | 26.9 | 86.4 | 1339.0 | 31.7 |
| tinyllava/TinyLLaVA-Phi-2-SigLIP-3.1B | 80.1 | 62.1 | 73.0 | 60.3 | 37.5 | 87.2 | 1466.4 | 38.4 |