Export DalleBart.generate results as binary or image

#31
by Larvik - opened

Hi, since free-tier Google Colab GPU and most PCs cannot run dalle-mega,
while even Colab CPU can run the VQGAN to get the images (feeds with ShardedDeviceArray binary from other machine).

So I think there may be an option to export the vector from DalleBart.generate instead of images.
In the colab notebook I added these lines:

'''
# remove BOS
encoded_images = encoded_images.sequences[..., 1:]
hux= np.array(encoded_images,dtype=np.uint16)
with open('oz.bin',mode='ba+') as f:
hux.tofile(f)
# decode images
'''
The values inside the vector seems be like 0 to 16384, as I have seen, so they can be stored in a 16bit png "image" as well.

By dalle-mega I mean dalle-mini/mega-1-fp16:latest,
which used in this huggingface site and has different outputs than dalle-mini/wzoooa1c:latest

Sign up or log in to comment