Downloads · 30 days
8
5% of all-time downloads
Afrostnova/clip-text-msmarco-corrector
clip-text-msmarco-corrector is a machine learning model from Afrostnova. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for vec2text. The card lists the license as other.
A vec2text corrector model for the CLIP ViT-L/14 text encoder embeddings (the text encoder used by Stable Diffusion v1.5, identical to openai/clip-vit-large-patch14).
Downloads · 30 days
8
5% of all-time downloads
All-time downloads
171
Public
Parameters
253M
1 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1 GB · 100%
From the Hugging Face model README
A vec2text corrector model for the CLIP ViT-L/14 text encoder embeddings
(the text encoder used by Stable Diffusion v1.5, identical to
openai/clip-vit-large-patch14).
Given an initial text hypothesis from the inversion model, this model iteratively
corrects it to better match the target embedding. It is used together with the
inversion model
Afrostnova/clip-text-msmarco-inversion
— it is not used standalone and it reuses the inversion model's tokenizer.
vec2text CorrectorEncoderModelCLIPTextModel — openai/clip-vit-large-patch14ClipTextModel-msmarco__msl32__58epochRequires the vec2text fork that supports the CLIPTextModel embedder (the one this
model was trained with), not the upstream pip install vec2text package.
import vec2text
inv = vec2text.models.InversionModel.from_pretrained("Afrostnova/clip-text-msmarco-inversion")
cor = vec2text.models.CorrectorEncoderModel.from_pretrained("Afrostnova/clip-text-msmarco-corrector")
corrector = vec2text.load_corrector(inv, cor)
text = vec2text.invert_embeddings(
embeddings=embeddings, # CLIP text-encoder last_hidden_state pooled at EOS
corrector=corrector,
num_steps=20,
sequence_beam_width=1,
)