INNER CODE UNIT · Python
image_vq_id
FoundationVision/Liquid · evaluation/app.py:266
image_vq_id = torch.cat(pred_tokens,dim=1)-ori_vocabe_size
image_vq_id = torch.clamp(image_vq_id, min=0, max=8191)
generated_image_list = []
for index, generate_id in enumerate(image_vq_id):
rec_img = image_tokenizer.pil_from_img_toks(generate_id)
generated_image_list.append(rec_img)
# rec_img.save('{}/{}.jpg'.format(image_save_pth,str(idx)))
torch.cuda.empty_cache()
# yield gr.Image(value=generated_image_list[0], label="Generated Image", show_download_button=True)
yield show_gallery(generated_image_list)
def bot_streaming_T2T(message, history,temperature):
print(message)
global stop_flag
stop_flag = True
time.sleep(0.2)