Downloads · 30 days
17
1% of all-time downloads
Hon-Wong/VoRA-7B-Base
VoRA-7B-Base is a image-text-to-text model from Hon-Wong. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Downloads · 30 days
17
1% of all-time downloads
All-time downloads
1.2K
Public
Parameters
9.8B
39.4 GB on disk
Likes
5
Public
Click a slice to open those files.
.safetensors39.4 GB · 100%
From the Hugging Face model README
import torch
from transformers import AutoProcessor, AutoModelForCausalLM
model_name = "Hon-Wong/VoRA-7B-Base"
processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
conversation = [
{
"role":"user",
"content":[
{
"type":"image",
"url": "{image path or url}"
},
{
"type":"text",
"text":"<image> Describe this image."
}
]
}
]
model_inputs = processor.apply_chat_template(conversation, add_generation_prompt=True, tokenize=True, return_tensors='pt', return_dict=True).to(model.device)
gen_kwargs = {"max_new_tokens": 1024, "eos_token_id": processor.tokenizer.eos_token_id}
with torch.inference_mode():
outputs = model.generate(model_inputs, **gen_kwargs)
output_text = processor.tokenizer.batch_decode(
outputs, skip_special_tokens=True
)
print(output_text)