can I use task = "retrieval.query" with transformers library?

#92
by k0rruptt - opened

hi, I would like to use task = "retrieval.query" lora adapter but I am not sure if I can with transformers or if I must use sentence transformers instead.

I had embedded my initial documents with transformers library - not sure if that also means that I have to go back and embed my documents with sentence transformers.

all help appreciated ty!

Jina AI org

Hi @k0rruptt , yes you can use retrieval.query like this:

from transformers import AutoModel

model = AutoModel.from_pretrained("jinaai/jina-embeddings-v3", trust_remote_code=True)
embeddings = model.encode('some text', task="retrieval.query")

if you used transformers without specifying a task it means you haven't used any adapters

Hi @jupyterjazz - I didn't even think of trying this smh - thank for the response!

k0rruptt changed discussion status to closed

Sign up or log in to comment