Views
No views yet
openai/clip-vit-large-patch14).Afrostnova/clip-text-msmarco-corrector
to iteratively refine that hypothesis.vec2text InversionModel (T5-based encoder–decoder)CLIPTextModel — openai/clip-vit-large-patch14repeat (num_repeat_tokens=16)pip install vec2text package — upstream
does not support a CLIPTextModel embedder. You need the fork that adds CLIP support
(the one this model was trained with). With the wrong version, from_pretrained fails
because the CLIPTextModel embedder is unknown.1import vec2text
2
3inv = vec2text.models.InversionModel.from_pretrained("Afrostnova/clip-text-msmarco-inversion")
4cor = vec2text.models.CorrectorEncoderModel.from_pretrained("Afrostnova/clip-text-msmarco-corrector")
5corrector = vec2text.load_corrector(inv, cor)
6
7# `embeddings` = CLIP text-encoder last_hidden_state, pooled at the EOS position.
8text = vec2text.invert_embeddings(
9 embeddings=embeddings, # (batch, hidden_dim) on the same device as the model
10 corrector=corrector,
11 num_steps=20,
12 sequence_beam_width=1,
13)openai/clip-vit-large-patch14; override with the
CLIP_TEXT_ENCODER environment variable if you want a local copy.