File size: 2,590 Bytes
eae238c
 
6b69396
 
 
 
 
 
 
 
 
 
 
eae238c
 
76f8933
eae238c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6b69396
eae238c
 
 
 
 
 
 
 
 
 
6b69396
eae238c
 
 
 
 
 
 
 
 
6b69396
eae238c
6b69396
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---

license: mit
tags:
- t5
- embeddings
- prompts
- feature-extraction
language:
- en
pretty_name: "T5-XXL Embeddings for Image Generation Prompts"
task_categories:
- feature-extraction
- text-to-image
---


# T5-XXL Embeddings for Image Generation Prompts

This dataset contains 4096-dimensional text embeddings for prompts from the [Gustavosta/Stable-Diffusion-Prompts](https://huggingface.co/datasets/Gustavosta/Stable-Diffusion-Prompts) dataset.

## Model Used

The embeddings were generated using a T5-XXL encoder model. Specifically, the weights from `t5xxl_fp8_e4m3fn_scaled.safetensors` were used.

**Important Note:** While the source model weights were in a FP8 format, the embeddings in this dataset have been calculated and stored in full **`float32`** precision to ensure numerical stability and maximum quality.

## Data Fields

- `Prompt`: A `string` containing the original text prompt.
- `vector`: A `list` of `float32` numbers, representing the 4096-dimensional embedding of the prompt.

## Data Splits

- `train`: Contains 73718 prompts and their corresponding vectors.
- `test`: Contains 8192 prompts and their corresponding vectors, sampled from the end of the original train set.

## Usage

You can load the dataset easily using the `datasets` library:

```python

from datasets import load_dataset



# Load the dataset

dataset = load_dataset("JusteLeo/t5-xxl-embedding")



# Access the splits

train_data = dataset['train']

test_data = dataset['test']



# Example

print(train_data[0]['Prompt'])

print(len(train_data[0]['vector']))

# Output: 4096

```

### Citation and Credits

This dataset of embeddings was created by [JusteLeo](https://huggingface.co/JusteLeo). If you use this dataset in your work, please consider citing this repository.

#### Original Data

The text prompts used as a basis for this dataset are from the `Gustavosta/Stable-Diffusion-Prompts` dataset. A huge thank you to Gustavosta for providing the initial data.

-   **Original Prompt Dataset:** [Gustavosta/Stable-Diffusion-Prompts](https://huggingface.co/datasets/Gustavosta/Stable-Diffusion-Prompts)

#### Model

The embeddings were generated using an encoder based on the T5-XXL architecture.

-   **Base Model Architecture:** [google/t5-v1_1-xxl](https://huggingface.co/google/t5-v1_1-xxl) by Google.
-   **Specific Encoder Weights:** The model was loaded with specific `fp8` quantized weights from the `t5xxl_fp8_e4m3fn_scaled.safetensors` file.

### License

This dataset is licensed under the [MIT License](LICENSE).