# Decoding a CLIP embedding

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdecoding-a-clip-embedding%2F25200%3E%5C
**Category:** 🧨 Diffusers\
**Created:** [October 29, 2022, 7:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdecoding-a-clip-embedding%2F25200 "2022-10-29T19:11:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fredguth](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/fredguth/32/2843_2.png) [@fredguth](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ffredguth)%5C
**Post date:** [October 29, 2022, 7:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdecoding-a-clip-embedding%2F25200%2F1 "2022-10-29T19:11:19Z")

</div>

I can transform a text (prompt) into clip embeddings with:

`prompt -> tokenizer -> tokens -> CLIPTextModel.from_pretrained -> embeddings`

I would like to decode an embedding to a prompt:

`embeddings -> ??? -> tokens -> tokenizer -> prompt`

How do I convert CLIP embeddings into tokens?

---

<div class="post-metadata">

**Author:** ![fredguth](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/fredguth/32/2843_2.png) [@fredguth](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ffredguth)%5C
**Post date:** [November 1, 2022, 3:08pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdecoding-a-clip-embedding%2F25200%2F2 "2022-11-01T15:08:32Z")

</div>

I figured out that the CLIPTextModel is a lossy encoder, thus there is no direct way to decode an embedding.
