SamAct commited on
Commit
fff848a
1 Parent(s): d37887a

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +273 -0
README.md ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: DALL·E mini
3
+ emoji: 🥑
4
+ colorFrom: yellow
5
+ colorTo: green
6
+ sdk: gradio
7
+ sdk_version: 3.0.3
8
+ app_file: app/gradio/app.py
9
+ pinned: True
10
+ license: apache-2.0
11
+ ---
12
+
13
+ # DALL·E Mini
14
+
15
+ [![Join us on Discord](https://img.shields.io/discord/823813159592001537?color=5865F2&logo=discord&logoColor=white)](https://discord.gg/xBPBXfcFHd)
16
+
17
+ _Generate images from a text prompt_
18
+
19
+ <img src="https://github.com/borisdayma/dalle-mini/raw/main/img/logo.png" width="200">
20
+
21
+ Our logo was generated with DALL·E mini using the prompt "logo of an armchair in the shape of an avocado".
22
+
23
+ ## How to use it?
24
+
25
+ There are several ways to use DALL·E mini to create your own images:
26
+
27
+ * use [the official DALL·E Mini demo](https://huggingface.co/spaces/dalle-mini/dalle-mini)
28
+
29
+ * experiment with the pipeline step by step through our [`inference pipeline notebook`](tools/inference/inference_pipeline.ipynb)
30
+
31
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/borisdayma/dalle-mini/blob/main/tools/inference/inference_pipeline.ipynb)
32
+
33
+ * spin off your own app with [DALL-E Playground repository](https://github.com/saharmor/dalle-playground) (thanks [Sahar](https://twitter.com/theaievangelist))
34
+
35
+ * try [DALL·E Flow](https://github.com/jina-ai/dalle-flow) project for generating, diffusion, upscaling in a Human-in-the-Loop workflow.
36
+
37
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/jina-ai/dalle-flow/blob/main/client.ipynb)
38
+
39
+ ## How does it work?
40
+
41
+ Refer to [our report](https://wandb.ai/dalle-mini/dalle-mini/reports/DALL-E-mini-Generate-images-from-any-text-prompt--VmlldzoyMDE4NDAy).
42
+
43
+ ## Contributing
44
+
45
+ Join the community on the [LAION Discord](https://discord.gg/xBPBXfcFHd).
46
+ Any contribution is welcome, from reporting issues to proposing fixes/improvements or testing the model with cool prompts!
47
+
48
+ ## Development
49
+
50
+ ### Dependencies Installation
51
+
52
+ For inference only, use `pip install git+https://github.com/borisdayma/dalle-mini.git`.
53
+
54
+ For development, clone the repo and use `pip install -e ".[dev]"`.
55
+ Before making a PR, check style with `make style`.
56
+
57
+ ### Training of DALL·E mini
58
+
59
+ Use [`tools/train/train.py`](tools/train/train.py).
60
+
61
+ You can also adjust the [sweep configuration file](https://docs.wandb.ai/guides/sweeps) if you need to perform a hyperparameter search.
62
+
63
+ ## FAQ
64
+
65
+ ### Where to find the latest models?
66
+
67
+ Trained models are on 🤗 Model Hub:
68
+
69
+ * [VQGAN-f16-16384](https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384) for encoding/decoding images
70
+ * [DALL·E mini](https://huggingface.co/flax-community/dalle-mini) for generating images from a text prompt
71
+
72
+ ### Where does the logo come from?
73
+
74
+ The "armchair in the shape of an avocado" was used by OpenAI when releasing DALL·E to illustrate the model's capabilities. Having successful predictions on this prompt represents a big milestone to us.
75
+
76
+ ## Acknowledgements
77
+
78
+ * 🤗 Hugging Face for organizing [the FLAX/JAX community week](https://github.com/huggingface/transformers/tree/master/examples/research_projects/jax-projects)
79
+ * Google [TPU Research Cloud (TRC) program](https://sites.research.google/trc/) for providing computing resources
80
+ * [Weights & Biases](https://wandb.com/) for providing the infrastructure for experiment tracking and model management
81
+
82
+ ## Authors & Contributors
83
+
84
+ DALL·E mini was initially developed by:
85
+
86
+ * [Boris Dayma](https://github.com/borisdayma)
87
+ * [Suraj Patil](https://github.com/patil-suraj)
88
+ * [Pedro Cuenca](https://github.com/pcuenca)
89
+ * [Khalid Saifullah](https://github.com/khalidsaifullaah)
90
+ * [Tanishq Abraham](https://github.com/tmabraham)
91
+ * [Phúc Lê Khắc](https://github.com/lkhphuc)
92
+ * [Luke Melas](https://github.com/lukemelas)
93
+ * [Ritobrata Ghosh](https://github.com/ghosh-r)
94
+
95
+ Many thanks to the people who helped make it better:
96
+
97
+ * the [DALLE-Pytorch](https://discord.gg/xBPBXfcFHd) and [EleutherAI](https://www.eleuther.ai/) communities for testing and exchanging cool ideas
98
+ * [Rohan Anil](https://github.com/rohan-anil) for adding Distributed Shampoo optimizer and always giving great suggestions
99
+ * [Phil Wang](https://github.com/lucidrains) has provided a lot of cool implementations of transformer variants and gives interesting insights with [x-transformers](https://github.com/lucidrains/x-transformers)
100
+ * [Katherine Crowson](https://github.com/crowsonkb) for [super conditioning](https://twitter.com/RiversHaveWings/status/1478093658716966912)
101
+ * the [Gradio team](https://gradio.app/) made an amazing UI for our app
102
+
103
+ ## Citing DALL·E mini
104
+
105
+ If you find DALL·E mini useful in your research or wish to refer, please use the following BibTeX entry.
106
+
107
+ ```text
108
+ @misc{Dayma_DALL·E_Mini_2021,
109
+ author = {Dayma, Boris and Patil, Suraj and Cuenca, Pedro and Saifullah, Khalid and Abraham, Tanishq and Lê Khắc, Phúc and Melas, Luke and Ghosh, Ritobrata},
110
+ doi = {10.5281/zenodo.5146400},
111
+ month = {7},
112
+ title = {DALL·E Mini},
113
+ url = {https://github.com/borisdayma/dalle-mini},
114
+ year = {2021}
115
+ }
116
+ ```
117
+
118
+ ## References
119
+
120
+ Original DALL·E from "[Zero-Shot Text-to-Image Generation](https://arxiv.org/abs/2102.12092)" with image quantization from "[Learning Transferable Visual Models From Natural Language Supervision](https://arxiv.org/abs/2103.00020)".
121
+
122
+ Image encoder from "[Taming Transformers for High-Resolution Image Synthesis](https://arxiv.org/abs/2012.09841v2)".
123
+
124
+ Sequence to sequence model based on "[BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https://arxiv.org/abs/1910.13461v1)" with implementation of a few variants:
125
+
126
+ * "[GLU Variants Improve Transformer](https://arxiv.org/abs/2002.05202)"
127
+ * "[Deepnet: Scaling Transformers to 1,000 Layers](https://arxiv.org/abs/2203.00555)"
128
+ * "[NormFormer: Improved Transformer Pretraining with Extra Normalization](https://arxiv.org/abs/2110.09456)"
129
+ * "[Swin Transformer: Hierarchical Vision Transformer using Shifted Windows](https://arxiv.org/abs/2103.14030)"
130
+ * "[CogView: Mastering Text-to-Image Generation via Transformers](https://arxiv.org/abs/2105.13290v2)"
131
+ * "[Root Mean Square Layer Normalization](https://arxiv.org/abs/1910.07467)"
132
+ * "[Sinkformers: Transformers with Doubly Stochastic Attention](https://arxiv.org/abs/2110.11773)"
133
+
134
+ Main optimizer (Distributed Shampoo) from "[Scalable Second Order Optimization for Deep Learning](https://arxiv.org/abs/2002.09018)".
135
+
136
+ ### Citations
137
+
138
+ ```text
139
+ @misc{
140
+ title={Zero-Shot Text-to-Image Generation},
141
+ author={Aditya Ramesh and Mikhail Pavlov and Gabriel Goh and Scott Gray and Chelsea Voss and Alec Radford and Mark Chen and Ilya Sutskever},
142
+ year={2021},
143
+ eprint={2102.12092},
144
+ archivePrefix={arXiv},
145
+ primaryClass={cs.CV}
146
+ }
147
+ ```
148
+
149
+ ```text
150
+ @misc{
151
+ title={Learning Transferable Visual Models From Natural Language Supervision},
152
+ author={Alec Radford and Jong Wook Kim and Chris Hallacy and Aditya Ramesh and Gabriel Goh and Sandhini Agarwal and Girish Sastry and Amanda Askell and Pamela Mishkin and Jack Clark and Gretchen Krueger and Ilya Sutskever},
153
+ year={2021},
154
+ eprint={2103.00020},
155
+ archivePrefix={arXiv},
156
+ primaryClass={cs.CV}
157
+ }
158
+ ```
159
+
160
+ ```text
161
+ @misc{
162
+ title={Taming Transformers for High-Resolution Image Synthesis},
163
+ author={Patrick Esser and Robin Rombach and Björn Ommer},
164
+ year={2021},
165
+ eprint={2012.09841},
166
+ archivePrefix={arXiv},
167
+ primaryClass={cs.CV}
168
+ }
169
+ ```
170
+
171
+ ```text
172
+ @misc{
173
+ title={BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension},
174
+ author={Mike Lewis and Yinhan Liu and Naman Goyal and Marjan Ghazvininejad and Abdelrahman Mohamed and Omer Levy and Ves Stoyanov and Luke Zettlemoyer},
175
+ year={2019},
176
+ eprint={1910.13461},
177
+ archivePrefix={arXiv},
178
+ primaryClass={cs.CL}
179
+ }
180
+ ```
181
+
182
+ ```text
183
+ @misc{
184
+ title={Scalable Second Order Optimization for Deep Learning},
185
+ author={Rohan Anil and Vineet Gupta and Tomer Koren and Kevin Regan and Yoram Singer},
186
+ year={2021},
187
+ eprint={2002.09018},
188
+ archivePrefix={arXiv},
189
+ primaryClass={cs.LG}
190
+ }
191
+ ```
192
+
193
+ ```text
194
+ @misc{
195
+ title={GLU Variants Improve Transformer},
196
+ author={Noam Shazeer},
197
+ year={2020},
198
+ url={https://arxiv.org/abs/2002.05202}
199
+ }
200
+ ```
201
+
202
+ ```text
203
+ @misc{
204
+ title={DeepNet: Scaling transformers to 1,000 layers},
205
+ author={Wang, Hongyu and Ma, Shuming and Dong, Li and Huang, Shaohan and Zhang, Dongdong and Wei, Furu},
206
+ year={2022},
207
+ eprint={2203.00555}
208
+ archivePrefix={arXiv},
209
+ primaryClass={cs.LG}
210
+ }
211
+ ```
212
+
213
+ ```text
214
+ @misc{
215
+ title={NormFormer: Improved Transformer Pretraining with Extra Normalization},
216
+ author={Sam Shleifer and Jason Weston and Myle Ott},
217
+ year={2021},
218
+ eprint={2110.09456},
219
+ archivePrefix={arXiv},
220
+ primaryClass={cs.CL}
221
+ }
222
+ ```
223
+
224
+ ```text
225
+ @inproceedings{
226
+ title={Swin Transformer V2: Scaling Up Capacity and Resolution},
227
+ author={Ze Liu and Han Hu and Yutong Lin and Zhuliang Yao and Zhenda Xie and Yixuan Wei and Jia Ning and Yue Cao and Zheng Zhang and Li Dong and Furu Wei and Baining Guo},
228
+ booktitle={International Conference on Computer Vision and Pattern Recognition (CVPR)},
229
+ year={2022}
230
+ }
231
+ ```
232
+
233
+ ```text
234
+ @misc{
235
+ title = {CogView: Mastering Text-to-Image Generation via Transformers},
236
+ author = {Ming Ding and Zhuoyi Yang and Wenyi Hong and Wendi Zheng and Chang Zhou and Da Yin and Junyang Lin and Xu Zou and Zhou Shao and Hongxia Yang and Jie Tang},
237
+ year = {2021},
238
+ eprint = {2105.13290},
239
+ archivePrefix = {arXiv},
240
+ primaryClass = {cs.CV}
241
+ }
242
+ ```
243
+
244
+ ```text
245
+ @misc{
246
+ title = {Root Mean Square Layer Normalization},
247
+ author = {Biao Zhang and Rico Sennrich},
248
+ year = {2019},
249
+ eprint = {1910.07467},
250
+ archivePrefix = {arXiv},
251
+ primaryClass = {cs.LG}
252
+ }
253
+ ```
254
+
255
+ ```text
256
+ @misc{
257
+ title = {Sinkformers: Transformers with Doubly Stochastic Attention},
258
+ url = {https://arxiv.org/abs/2110.11773},
259
+ author = {Sander, Michael E. and Ablin, Pierre and Blondel, Mathieu and Peyré, Gabriel},
260
+ publisher = {arXiv},
261
+ year = {2021},
262
+ }
263
+ ```
264
+
265
+ ```text
266
+ @misc{
267
+ title = {Smooth activations and reproducibility in deep networks},
268
+ url = {https://arxiv.org/abs/2010.09931},
269
+ author = {Shamir, Gil I. and Lin, Dong and Coviello, Lorenzo},
270
+ publisher = {arXiv},
271
+ year = {2020},
272
+ }
273
+ ```