How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("image-text-to-text", model="htlou/mm-interp-AA_preference_random_0_30")
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
            {"type": "text", "text": "What animal is on the candy?"}
        ]
    },
]
pipe(text=messages)
# Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM

processor = AutoProcessor.from_pretrained("htlou/mm-interp-AA_preference_random_0_30")
model = AutoModelForMultimodalLM.from_pretrained("htlou/mm-interp-AA_preference_random_0_30", device_map="auto")
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
            {"type": "text", "text": "What animal is on the candy?"}
        ]
    },
]
inputs = processor.apply_chat_template(
	messages,
	add_generation_prompt=True,
	tokenize=True,
	return_dict=True,
	return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=40)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Quick Links

AA_preference_random_0_30

This model is a fine-tuned version of llava-hf/llava-v1.6-mistral-7b-hf on the AA_preference_random_0_30 dataset. It achieves the following results on the evaluation set:

  • Loss: 0.6184
  • Rewards/chosen: 0.7817
  • Rewards/rejected: -0.8532
  • Rewards/accuracies: 0.7708
  • Rewards/margins: 1.6349
  • Logps/rejected: -211.9707
  • Logps/chosen: -253.8823
  • Logits/rejected: -2.5581
  • Logits/chosen: -2.5412

Model description

More information needed

Intended uses & limitations

More information needed

Training and evaluation data

More information needed

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 1e-06
  • train_batch_size: 8
  • eval_batch_size: 8
  • seed: 42
  • distributed_type: multi-GPU
  • num_devices: 8
  • gradient_accumulation_steps: 4
  • total_train_batch_size: 256
  • total_eval_batch_size: 64
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: cosine
  • lr_scheduler_warmup_steps: 10
  • num_epochs: 3.0

Training results

Training Loss Epoch Step Validation Loss Rewards/chosen Rewards/rejected Rewards/accuracies Rewards/margins Logps/rejected Logps/chosen Logits/rejected Logits/chosen
0.2364 1.2422 50 0.5729 1.2346 0.1347 0.7292 1.0999 -202.0917 -249.3526 -2.5158 -2.5087
0.1061 2.4845 100 0.6159 0.7571 -0.8876 0.7569 1.6447 -212.3150 -254.1281 -2.5775 -2.5599

Framework versions

  • Transformers 4.45.2
  • Pytorch 2.4.0+cu121
  • Datasets 2.21.0
  • Tokenizers 0.20.3
Downloads last month
7
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for htlou/mm-interp-AA_preference_random_0_30

Finetuned
(189)
this model