Instructions to use HumorR1/policy-e1b-sft-thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HumorR1/policy-e1b-sft-thinking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="HumorR1/policy-e1b-sft-thinking") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("HumorR1/policy-e1b-sft-thinking") model = AutoModelForImageTextToText.from_pretrained("HumorR1/policy-e1b-sft-thinking") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use HumorR1/policy-e1b-sft-thinking with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HumorR1/policy-e1b-sft-thinking" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HumorR1/policy-e1b-sft-thinking", "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/HumorR1/policy-e1b-sft-thinking
- SGLang
How to use HumorR1/policy-e1b-sft-thinking 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 "HumorR1/policy-e1b-sft-thinking" \ --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": "HumorR1/policy-e1b-sft-thinking", "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 "HumorR1/policy-e1b-sft-thinking" \ --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": "HumorR1/policy-e1b-sft-thinking", "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 HumorR1/policy-e1b-sft-thinking with Docker Model Runner:
docker model run hf.co/HumorR1/policy-e1b-sft-thinking
humor-r1 — SFT, with thinking (Qwen3-VL-2B-Thinking + LoRA, merged) (E1b)
LoRA-adapted Qwen3-VL-2B-Thinking supervised fine-tuned on (image, synthetic thinking, chosen caption) triples, then merged. Output format: {thinking}</think>\n\n<caption>X</caption>.
Training data
- 271 New Yorker contests, top-rated caption per contest
(
yguooo/newyorker_caption_ranking). - The 60k Bradley-Terry preference pairs underlying the reward model (separate split).
- We deliberately do NOT use the dataset's GPT-4o-generated Scene/Twist/Location/Entities descriptions in the prompt, since they hand-feed scene content to a vision-language model that can already see the image; this makes the policy and reward model usable on any single-panel cartoon, not just the curated subset.
How it fits the project
Part of a 2x2 ablation over training method (SFT, GRPO) and output
format (no thinking, thinking) for humor caption generation. See
HumorR1/rm-qwen25vl-3b-nodesc for the reward model used to train (and
score) this policy.
Inference
Backbone: Qwen/Qwen3-VL-2B-Thinking.
This repo is a merged full model; load with transformers.AutoModelForCausalLM.from_pretrained.
from PIL import Image
from transformers import AutoProcessor
from vllm import LLM, SamplingParams
processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-2B-Thinking", trust_remote_code=True)
llm = LLM(model="Qwen/Qwen3-VL-2B-Thinking", trust_remote_code=True, dtype="bfloat16",
max_model_len=4096)
# Caption format: <caption>X</caption>; thinking variant prefixes <think>...</think>.
Reward model used during training
HumorR1/rm-qwen25vl-3b-nodesc(held-out pairwise accuracy 0.6635).
- Downloads last month
- 17
Model tree for HumorR1/policy-e1b-sft-thinking
Base model
Qwen/Qwen3-VL-2B-Thinking