dalle-mini
dalle-mini copied to clipboard
Model (~5GB) has to be redownloaded when the container is restarted
Each time I restart the container I have to paste in the wandb key, and then it redownloads 5GB of model data. This can be very slow (even with 100mbps internet it takes about 10 minutes). Is there a way to make it save and load the model from disk?
Yea you can get both VQGan, and Dalle-mega models below. (don't forget the config json files) Current mega version is 14 at this moment.
https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384
https://wandb.ai/dalle-mini/dalle-mini/artifacts/DalleBart_model/mega-1-fp16/46cca62fd0ec6fcab873/files
Download them into a /mega
and /vqgan
folder . Optionally use wget
for faster download.
Then in your inference code you can use the folder where you place the models and config files like this:
DALLE_MODEL = "./models/mega"
DALLE_COMMIT_ID = None
VQGAN_REPO= "./models/vqgan"
VQGAN_COMMIT_ID= None
Now it shouldn't have to download those again. But it will still download a smaller wiki-text-dict file (never bothered with this one).
You will know if you missed a config file when it yells at you.
Yea you can get both VQGan, and Dalle-mega models below. (don't forget the config json files) Current mega version is 14 at this moment.
https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384
https://wandb.ai/dalle-mini/dalle-mini/artifacts/DalleBart_model/mega-1-fp16/46cca62fd0ec6fcab873/files
Download them into a
/mega
and/vqgan
folder . Optionally usewget
for faster download. Then in your inference code you can use the folder where you place the models and config files like this:DALLE_MODEL = "./models/mega" DALLE_COMMIT_ID = None
VQGAN_REPO= "./models/vqgan" VQGAN_COMMIT_ID= None
Now it shouldn't have to download those again. But it will still download a smaller wiki-text-dict file (never bothered with this one).
You will know if you missed a config file when it yells at you.
Thanks! It works great. I'd love to see this built into the notebook. Where can I get the CLIP model?
Not sure about that one.
Its worth noting as well - as I personally struggled with this - but you need to enable local_files_only
like this:
# Load dalle-mini
model, params = DalleBart.from_pretrained(
DALLE_MODEL, revision=DALLE_COMMIT_ID, dtype=jnp.float16, _do_init=False, local_files_only=True
)
# Load VQGAN
vqgan, vqgan_params = VQModel.from_pretrained(
VQGAN_REPO, revision=VQGAN_COMMIT_ID, _do_init=False, local_files_only=True
)
One other little thing that is probably obvious, but it took me a bit to figure out - if you are running the notebook locally the path to the "./models" folder is relative to the location of the ipynb file, so I had to put mine into the tools/inference/models to make it work with inference_pipeline.ipynb.