File size: 2,944 Bytes
0c788ea
 
 
 
d64c2c8
 
 
 
 
ba7ab3c
 
82af9e2
842816b
b81b2f1
d64c2c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0c788ea
 
 
780d12b
0c788ea
2cf952d
 
 
53f41d8
ba7ab3c
 
842816b
0c788ea
842816b
ba7ab3c
 
0c788ea
780d12b
 
 
 
 
 
 
 
 
0c788ea
 
f235458
0c788ea
 
 
f235458
0c788ea
 
 
66af387
0c788ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
license: other
tags:
- generated_from_trainer
- text generation
- stable diffusion
- midjourney
- text2image
- text to image
- prompt augment
- prompt engineering
thumbnail: https://i.imgur.com/DeKNHtC.jpg
datasets:
- pszemraj/text2image-multi-prompt
widget:
 - text: "morning sun over Jakarta"
   example_title: "morning sun"
 - text: "WARNING: pip is"
   example_title: "pip"
 - text: "sentient cheese"
   example_title: "sentient cheese"
 - text: "cheeps are"
   example_title: "cheeps"
 - text: "avocado armchair"
   example_title: "creative prompt"
 - text: "Landscape of"
   example_title: "landscape"
parameters:
  min_length: 16
  max_length: 96
  no_repeat_ngram_size: 1
  do_sample: True
---


# pszemraj/opt-350m-multiprompt

<a href="https://colab.research.google.com/gist/pszemraj/bdd1238ee4b8330aeec6774a16f9a677/opt-350m-multiprompt-demo.ipynb">
  <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
</a>

Generate/augment your prompt with a model trained on a large & diverse prompt dataset.

This model is a fine-tuned version of [facebook/opt-350m](https://huggingface.co/facebook/opt-350m) on the pszemraj/text2image-prompts-multi dataset.
It achieves the following results on the evaluation set:
- Loss: 1.6669
- eval steps per second: 16.21
- perplexity: 5.29

## Example


![landscape of florida](https://i.imgur.com/DeKNHtC.jpg)

<br>

_The above example was created with [DALL-E 2](https://labs.openai.com/sc/YbiY2kkuQeODzHNwUHn4D5RN) but will of course work with any text2image model._

## Intended uses & limitations

- The model will generate augmentations that are biased towards the training data, i.e. what people already asked for in the SD/midjourney discords, etc. Creating a larger dataset was an attempt at mitigating this through more data from different datasets.

## Training and evaluation data

See the `pszemraj/text2image-prompts-multi` dataset card for details. The dataset is a compilation of several text-to-image prompt datasets on huggingface  :)

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 0.0002
- train_batch_size: 8
- eval_batch_size: 4
- seed: 42
- distributed_type: multi-GPU
- num_devices: 2
- gradient_accumulation_steps: 16
- total_train_batch_size: 256
- total_eval_batch_size: 8
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.04
- num_epochs: 4.0

### Training results

| Training Loss | Epoch | Step | Validation Loss |
|:-------------:|:-----:|:----:|:---------------:|
| 2.1677        | 1.0   | 990  | 2.0888          |
| 1.856         | 2.0   | 1980 | 1.8215          |
| 1.6864        | 3.0   | 2970 | 1.6935          |
| 1.6228        | 4.0   | 3960 | 1.6670          |


### Framework versions

- Transformers 4.25.0.dev0
- Pytorch 1.13.0+cu117
- Datasets 2.6.1
- Tokenizers 0.13.1