Adding query prompt when using with sentence-transformers

#17
by Reggie - opened

Hi,
I'm trying to use the model with Sentence Transformers, and was wondering how the query prompt can be added for certain embeds?

WhereIsAI org

hi @Reggie , maybe you can manually set the prompts like

from angle_emb import Prompts

model.encode(Prompts.C.format(text))
model.encode(Prompts.C.format(text='some text'))

Just to confirm, the above will essentially convert my query into this: Represent this sentence for searching relevant passages: some text
Is my understanding right?

WhereIsAI org
edited Feb 20

hi @Reggie , maybe you can manually set the prompts like

from angle_emb import Prompts

model.encode(Prompts.C.format(text))

Sorry, I made a mistake. It should be Prompts.C.format(text=query)

Sign up or log in to comment