def enc_text(txt):
    if a.translate:
        txt = translator.translate(txt, dest='en').text
    emb = model_clip.encode_text(clip.tokenize(txt).cuda()[:77])
    return emb.detach().clone()
def enc_text(txt):
    if a.translate:
        txt = translator.translate(txt, dest='en').text
    emb = model_clip.encode_text(clip.tokenize(txt).cuda()[:77])
    return emb.detach().clone()