From 3af89066e8103aa5418f7a8481afb5e75d236ca5 Mon Sep 17 00:00:00 2001 From: Andrew Ginns Date: Tue, 28 Jun 2022 21:34:57 +0100 Subject: [PATCH 1/4] Simplified requirements: * No wandb login * wandb install as part of requirements.txt --- requirements.txt | 1 + setup.sh | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 3ff893b..0867d5f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ torch flax==0.4.2 +wandb \ No newline at end of file diff --git a/setup.sh b/setup.sh index 7df64c6..91f7483 100644 --- a/setup.sh +++ b/setup.sh @@ -9,7 +9,6 @@ git lfs install git clone https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384 ./pretrained/vqgan # download dalle-mini and dalle mega -pip install wandb -wandb login +wandb login --anonymously wandb artifact get --root=./pretrained/dalle_bart_mini dalle-mini/dalle-mini/mini-1:v0 wandb artifact get --root=./pretrained/dalle_bart_mega dalle-mini/dalle-mini/mega-1-fp16:v14 From 3c0c89797743607117cb0d0aa19744a41698c72a Mon Sep 17 00:00:00 2001 From: Andrew Ginns Date: Tue, 28 Jun 2022 22:01:26 +0100 Subject: [PATCH 2/4] Add flax model curl --- setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 91f7483..6eee680 100644 --- a/setup.sh +++ b/setup.sh @@ -2,11 +2,13 @@ pip install -r requirements.txt -mkdir -p pretrained +mkdir -p pretrained/vqgan # download vqgan git lfs install git clone https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384 ./pretrained/vqgan +# download the flax model +curl https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384/resolve/main/flax_model.msgpack -L --output ./pretrained/vqgan/flax_model.msgpack # download dalle-mini and dalle mega wandb login --anonymously From a3a247e6ec2629c73cf96ad22d3cd3c3ccaae5ef Mon Sep 17 00:00:00 2001 From: Haydn Jones Date: Tue, 28 Jun 2022 17:57:44 -0600 Subject: [PATCH 3/4] Fixed disabling of gradients in the torch code --- min_dalle/min_dalle_torch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/min_dalle/min_dalle_torch.py b/min_dalle/min_dalle_torch.py index 690e02c..e8a8563 100644 --- a/min_dalle/min_dalle_torch.py +++ b/min_dalle/min_dalle_torch.py @@ -2,7 +2,7 @@ import numpy from typing import Dict from torch import LongTensor, FloatTensor import torch -torch.no_grad() +torch.set_grad_enabled(False) from .models.vqgan_detokenizer import VQGanDetokenizer from .models.dalle_bart_encoder_torch import DalleBartEncoderTorch From 0af6b1731fee2ce58cc485405c0c6ad98d763c3c Mon Sep 17 00:00:00 2001 From: kuprel Date: Tue, 28 Jun 2022 21:18:24 -0400 Subject: [PATCH 4/4] Update setup.sh removed `git lfs` dependency --- setup.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.sh b/setup.sh index 6eee680..c506cb5 100644 --- a/setup.sh +++ b/setup.sh @@ -5,9 +5,6 @@ pip install -r requirements.txt mkdir -p pretrained/vqgan # download vqgan -git lfs install -git clone https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384 ./pretrained/vqgan -# download the flax model curl https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384/resolve/main/flax_model.msgpack -L --output ./pretrained/vqgan/flax_model.msgpack # download dalle-mini and dalle mega