<jupyter_start><jupyter_text>Train [DALLE-pytorch](github.com/lucidrains/DALLE-pytorch) from [lucidrains](https:/github.com/lucidrains/)Notebook by [afiaka87](https://github.com/afiaka87) With help from:valteralfred, robvanvolt, rom1504, janEbert, mehdidc, gabriel_syme, robvanvolt, mega b<jupyter_code># @title Licensed under the MIT License
 
# Copyright (c) 2021 <NAME>
 
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
 
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.<jupyter_output><empty_output><jupyter_text>Installation + Weights & Biases LoginA free tier account for `https://wandb.ai` is required for experiment tracking.<jupyter_code>%%writefile download_cah.sh
mkdir /content/CAH
cd /content/CAH
wget --continue https://the-eye.eu/public/AI/cah/laion400m-dat-release.torrent
aria2c --continue --seed-time=0 --file-allocation='trunc' --select-file=1-100 laion400m-dat-release.torrent
cd /content
!source download_cah.sh
#@title (Advanced) - DALLE-pytorch Repository and Branch Name

#@markdown Install `DALLE-pytorch` from source.

#@markdown Defaults to latest branch.
repository_url = "https://github.com/lucidrains/DALLE-pytorch.git" #@param {type: "string"}
branch = "main" #@param {type: "string"}

!git clone -b "$branch" --single-branch "$repository_url"
!git clone https://github.com/mehdidc/DALLE-pytorch
%pip install wandb
%cd /content/DALLE-pytorch
!python setup.py install
%cd /content/
#@title Log in to Weights & Biasess
#@markdown DALLE-pytorch uses W&B (https://www.wandb.ai) for experiment tracking.

#@markdown If you don't want to make a free account; you can find generations in `/content/wandb` in the folder for your specific run.

#@markdown **It's recommended to use W&B.**

!wandb login<jupyter_output><empty_output><jupyter_text>Train DALLE-pytorch<jupyter_code>%pip uninstall taming-transformers-rom1504
%pip install omegaconf
!git clone https://github.com/CompVis/taming-transformers
%pip install -e taming-transformers
%pip install pytorch-lightning
!python /content/DALLE-pytorch/train_dalle.py --dim 512 --truncate_captions --depth 8 --shift_tokens --random_resize_crop_lower_ratio 1.0 --wandb_name "train_dalle_colab" --rotary_emb --wds=jpg,txt --image_text_folder=/content/CAH/laion400m-dat-release<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup