Downloads · 30 days
0
TnTerry/MEGL-LLaVA-Baseline-Action
MEGL-LLaVA-Baseline-Action is a machine learning model from TnTerry. Use it for the machine learning 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
0
Access
Public
Updated Oct 25, 2024
Repo size
237 MB
Likes
0
Public
Click a slice to open those files.
.safetensors237 MB · 98%
From the Hugging Face model README
Baseline LLaVA model for MEGL-Action
The model is fine-tuned with lora on the Action dataset, hence needs to be loaded with peft.
base_model = LlavaForConditionalGeneration.from_pretrained(
"llava-hf/llava-1.5-7b-hf",
device_map="auto"
)
model = PeftModel.from_pretrained(
base_model,
"TnTerry/MEGL-LLaVA-Baseline-Action",
device_map="auto"
)
To inference with this model, follow the official guidance on 🤗 for LLava inference.
inputs = processor(images=image, text=prompt, return_tensors="pt")
output = model.generate(**inputs, max_length=40)
decoded_output = processor.batch_decode(
output, skip_special_tokens=True, clean_up_tokenization_spaces=False
)[0]