readme: ---
  license: apache-2.0
  ---
  Install lumi:
  ```
  git clone https://github.com/ontocord/lumi
  pip install transformers  sentencepiece
  ```
  
  Install models:
  ```
  from lumi.modeling_vlt5 import *
  from lumi.tokenization_vlt5 import *
  from lumi.modeling_dalle import *
  import torch
  minidalle = DalleModel.from_pretrained("ontocord/minidalle").eval().half().to('cuda')
  vlt5 = VLT5.from_pretrained("ontocord/vlt5").eval().half().to('cuda')
  vlt5_tokenizer = VLT5Tokenizer.from_pretrained("ontocord/vlt5")
  
  ```
  
  Use:
  ```
  
  text="""A woman riding a black horse next to a blue fence in central park"""
  
  img = minidalle.generate(
      text=text,
      image_output=True,
      token_output=False
  )
  
    
  print (vlt5_image2text(vlt5, vlt5_tokenizer, "caption:",  img)["text"])
  print (vlt5_image2text(vlt5, vlt5_tokenizer, "vqa: what is she riding?",  img)["text"])
  print (vlt5_image2text(vlt5, vlt5_tokenizer, "vqa: what is the color of the fence?",  img)["text"])
  print (vlt5_image2text(vlt5, vlt5_tokenizer, "vqa: how many horses are there?",  img)["text"])
  print (vlt5_image2text(vlt5, vlt5_tokenizer, "vqa: is it a man or woman riding the horse?",  img)["text"])
  print (vlt5_image2text(vlt5, vlt5_tokenizer, "vqa: are they at the beach?",  img)["text"])
  print (vlt5_image2text(vlt5, vlt5_tokenizer, "vqa: are they at the city?",  img)["text"])
  print (vlt5_image2text(vlt5, vlt5_tokenizer, "vqa: are they at the park?",  img)["text"])
  print (vlt5_image2text(vlt5, vlt5_tokenizer, "vqa: are they in space?",  img)["text"])
  
  
  ```