Instructions to use theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented", trust_remote_code=True) 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 AutoModelForImageTextToText model = AutoModelForImageTextToText.from_pretrained("theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented
- SGLang
How to use theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented with Docker Model Runner:
docker model run hf.co/theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented
Molmo2-4B Pairwise Judge (Direct Augmented, merged)
This is a standalone BF16 Molmo2-4B model fine-tuned for pairwise judging of
AI-generated videos. Given a user's preference questionnaire, a generation
prompt, and two candidate videos, it emits exactly one token: 1, 2, or
Tie.
The model was produced by merging the LoRA adapter from
molmo2_pairwise_judge_direct_augmented into the local Molmo2-4B base. The
adapter used rank 32, alpha 64, dropout 0.05, and targeted att_proj,
attn_out, ff_proj, and ff_out.
Loading
The repository contains the Molmo2 custom model, processor, tokenizer, and
video-processing code needed for trust_remote_code=True:
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "theblackcat102/Molmo2-4B-Pairwise-Judge-Direct-Augmented"
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
model_id,
trust_remote_code=True,
dtype=torch.bfloat16,
device_map="auto",
)
Use the Molmo2 chat-template format with type="video" content. The answer
should be constrained or post-processed to the expected labels (1, 2, or
Tie) when evaluating this judge.
Prompt format
Send one user message containing the preference questionnaire, the generation
task and prompt, then the two candidate videos in order. Finish with the
question asking for exactly one label. The order of the videos defines the
meaning of 1 and 2.
messages = [{
"role": "user",
"content": [
{
"type": "text",
"text": """You are simulating a specific human judge of AI-generated videos. You are given that person's video-preference questionnaire and two candidate videos generated for the same prompt. Decide which of the two videos this person would prefer, or whether they would consider them a tie.
User video preference questionnaire.
Which video qualities matter most: {qualities}
Most wanted kind of generated video: {wanted_kind}
Preferred amount of motion: {motion_preference}
Preferred camera treatment: {camera_preference}
Preferred overall visual treatment: {visual_preference}
{example_comparisons}""",
},
{
"type": "text",
"text": "Generation task: {task}.\nPrompt used to generate both videos: \"{generation_prompt}\"",
},
{"type": "text", "text": "Video 1:"},
{"type": "video", "video": "/path/to/video_1.mp4"},
{"type": "text", "text": "Video 2:"},
{"type": "video", "video": "/path/to/video_2.mp4"},
{
"type": "text",
"text": "Which video would this person prefer: 1, 2, or Tie? Answer with exactly one token.",
},
],
}]
inputs = processor.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
return_dict=True,
)
outputs = model.generate(**inputs, max_new_tokens=3, do_sample=False)
answer = processor.tokenizer.decode(
outputs[0, inputs["input_ids"].shape[1]:],
skip_special_tokens=True,
).strip()
{example_comparisons} should contain zero or more lines in the same style as
the training data, for example: Example comparison - City flight (option A: Model A; option B: Model B): Preferred option A, preference strength: Moderate, decision factors: Camera and framing. Keep the final request
unchanged and pass videos in the same order as their labels.
Provenance and validation
The base model was the local allenai/Molmo2-4B export at merge time. The
merged weights contain no PEFT adapter wrapper and load as
Molmo2ForConditionalGeneration. A fresh-process smoke test loaded the
standalone model and processor and ran a local two-video validation example,
generating 2 with greedy decoding and three new tokens.
This model is intended for research evaluation of video preferences. Its outputs reflect the training judge and should not be interpreted as an objective measure of video quality.
- Downloads last month
- 22