Repository navigation
Description
hello. i'm trying to use the models locally to avoid downloading them at each run.
using
DALLE_MODEL = "dalle-mini/dalle-mini/mega-1-fp16:latest"
DALLE_COMMIT_ID = None
works fine and gives me a result but it will download the models at each run.
i've downloaded the models locally using
git lfs install
git clone https://huggingface.co/dalle-mini/dalle-mega
git lfs install
git clone https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384
under a /model directory
and now use
DALLE_MODEL = "./models/mega/dalle-mega"
DALLE_COMMIT_ID = None
VQGAN_REPO= "./models/vqgan/vqgan_imagenet_f16_16384"
VQGAN_COMMIT_ID= None
but now it gives me a memory error :
Traceback (most recent call last):
File "dalle.py", line 44, in
params = replicate(params)
File "/mnt/shared/foss-20/dalle-mini/dallemini/lib/python3.8/site-packages/flax/jax_utils.py", line 56, in replicate
return jax.device_put_replicated(tree, devices)
File "/mnt/shared/foss-20/dalle-mini/dallemini/lib/python3.8/site-packages/jax/_src/api.py", line 2877, in device_put_replicated
return tree_map(_device_put_replicated, x)
File "/mnt/shared/foss-20/dalle-mini/dallemini/lib/python3.8/site-packages/jax/_src/tree_util.py", line 205, in tree_map
return treedef.unflatten(f(*xs) for xs in zip(*all_leaves))
File "/mnt/shared/foss-20/dalle-mini/dallemini/lib/python3.8/site-packages/jax/_src/tree_util.py", line 205, in
return treedef.unflatten(f(*xs) for xs in zip(*all_leaves))
File "/mnt/shared/foss-20/dalle-mini/dallemini/lib/python3.8/site-packages/jax/_src/api.py", line 2865, in _device_put_replicated
buf, = dispatch.device_put(x, devices[0])
File "/mnt/shared/foss-20/dalle-mini/dallemini/lib/python3.8/site-packages/jax/_src/dispatch.py", line 1024, in device_put
return device_put_handlers[type(x)](x, device)
File "/mnt/shared/foss-20/dalle-mini/dallemini/lib/python3.8/site-packages/jax/_src/dispatch.py", line 1055, in _device_put_device_array
x = _copy_device_array_to_device(x, device)
File "/mnt/shared/foss-20/dalle-mini/dallemini/lib/python3.8/site-packages/jax/_src/dispatch.py", line 1082, in _copy_device_array_to_device
moved_buf = backend.buffer_from_pyval(x.device_buffer.to_py(), device)
jaxlib.xla_extension.XlaRuntimeError: RESOURCE_EXHAUSTED: Out of memory while trying to allocate 402653184 bytes.
i have a Nvidia GTX 1080 with 8192 MB of memory.
but i wonder why it works when downloading the models. is it using a smaller part of it ?
sorry if all this are dumb questions.
thanks in advance
Activity