๐Ÿ”ค CS180 HW5: T5 Text Encoder Embeddings Generator

This space uses the DeepFloyd IF T5 text encoder to generate embeddings from your text prompts.

How to use:

  1. Enter your prompts in the text box (one prompt per line)
  2. Click "Generate Embeddings"
  3. Download the generated .pth file containing the embeddings

About the embeddings:

  • Each embedding has shape: [1, 77, 4096]
  • 77 = max sequence length
  • 4096 = embedding dimension of the T5 encoder
  • An empty prompt ('') is automatically added for Classifier Free Guidance (CFG)

๐Ÿ“ Note:

  • The first run may take a while as the model needs to download (~8GB)
  • Subsequent runs will be faster
  • The generated .pth file can be loaded in PyTorch using: torch.load('prompt_embeds_dict.pth')