Downloads · 30 days
28
9% of all-time downloads
bigshanedogg/clip-flant5-xxl
clip-flant5-xxl is a image-text-to-text model from bigshanedogg. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
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 modelingclipflant5.p…
Downloads · 30 days
28
9% of all-time downloads
All-time downloads
328
Public
Repo size
22.9 GB
Likes
0
Public
Click a slice to open those files.
.bin22.9 GB · 100%
From the Hugging Face model README
trust_remote_code HuggingFace formatUnofficial 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).
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.
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.
modeling_clipflant5.py, packaging): Apache-2.0 — see LICENSE; attribution in
NOTICE.