Instructions to use bigshanedogg/clip-flant5-xxl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bigshanedogg/clip-flant5-xxl with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="bigshanedogg/clip-flant5-xxl", trust_remote_code=True)# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("bigshanedogg/clip-flant5-xxl", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bigshanedogg/clip-flant5-xxl with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bigshanedogg/clip-flant5-xxl" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bigshanedogg/clip-flant5-xxl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/bigshanedogg/clip-flant5-xxl
- SGLang
How to use bigshanedogg/clip-flant5-xxl 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 "bigshanedogg/clip-flant5-xxl" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bigshanedogg/clip-flant5-xxl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "bigshanedogg/clip-flant5-xxl" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bigshanedogg/clip-flant5-xxl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use bigshanedogg/clip-flant5-xxl with Docker Model Runner:
docker model run hf.co/bigshanedogg/clip-flant5-xxl
CLIP-FlanT5-XXL (VQAScore) — trust_remote_code HuggingFace format
Unofficial transformers-format port of CLIP-FlanT5-XXL, the VQAScore judge from "Evaluating
Text-to-Visual Generation with Image-to-Text Generation" (Lin et al., 2024). It bundles a self-contained
modeling_clipflant5.py and an auto_map, so the model loads with
AutoModelForSeq2SeqLM.from_pretrained(..., trust_remote_code=True) under transformers 5.X (and 4.57) with
no llava / t2v_metrics dependency and no pinned old transformers.
Not an official release. Model, weights, and architecture (
CLIPT5ForConditionalGeneration) are by Zhiqiu Lin et al. — original weightszhiqiulin/clip-flant5-xxl(Apache-2.0), code https://github.com/linzhiqiu/CLIP-FlanT5 and https://github.com/linzhiqiu/t2v_metrics, paper arXiv:2404.01291. This repo re-packages that checkpoint fortrust_remote_codeloading and is used as the paper-strict VQAScore judge for the CVTG-2K benchmark (TextCrafter, arXiv:2503.23461).
What it is
A CLIP ViT-L/14-336 vision tower + a FlanT5-XXL encoder-decoder. Image patch features are projected and
spliced into the T5 encoder inputs at an <image> placeholder; the T5 decoder then scores an answer.
VQAScore = the probability the decoder assigns to "Yes" for the question
'Does this figure show "{caption}"? Please answer yes or no.' (exp(-CrossEntropy) under teacher forcing) —
a reference-free image↔text alignment score.
modeling_clipflant5.py consolidates the upstream clip_t5.py + vision tower + projector + preprocessing
(t5_tokenizer_image_token, expand2square) into one module using only public T5/CLIP transformers API.
transformers-5.X note.
generate()/prepare_inputs_for_generationare intentionally removed — they indexed the legacy tuple KV-cache (gone in 5.X), and VQAScore needs only the teacher-forcedforward()+ logits. Use this model for scoring, not free-form generation.
Usage (scoring)
import torch
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model = AutoModelForSeq2SeqLM.from_pretrained("bigshanedogg/clip-flant5-xxl", trust_remote_code=True).eval()
tokenizer = AutoTokenizer.from_pretrained("bigshanedogg/clip-flant5-xxl")
# Preprocess the image with model.vision_tower.image_processor, wrap the question with
# `format_question(...)` (t5_chat), tokenize with `t5_tokenizer_image_token`, then run a teacher-forced
# forward with labels="Yes" and read exp(-CrossEntropy) — see modeling_clipflant5.py's docstring.
Licensing
- CLIP-FlanT5 model / weights / code (Zhiqiu Lin et al.): Apache-2.0 — https://github.com/linzhiqiu/CLIP-FlanT5
- FlanT5-XXL base (Google): Apache-2.0. OpenAI CLIP ViT-L/14-336 vision tower: MIT.
- This port (
modeling_clipflant5.py, packaging): Apache-2.0 — seeLICENSE; attribution inNOTICE.
- Downloads last month
- -