Skip to content

How to pass instructions for Instruction-based embedding models #293

Closed Answered by michaelfeil
axeloh asked this question in Q&A
Discussion options

You must be logged in to vote

Its just a prompt template. Unless up-streamed in sentence-transformers & properly specified in config.json, I wish to not accommodate prompt templates in infinity.

Instructor expects a special tuple, but ultimatley also formats it using a similar function. The instructor models are quite outdated, and Mistral to large, I would recommend using Bert/Deberta/.. models!

For SFT Mistral the template is the following:
https://huggingface.co/Salesforce/SFR-Embedding-Mistral

def get_detailed_instruct(task_description: str, query: str) -> str:
    return f'Instruct: {task_description}\nQuery: {query}'

Please manage this piece of code client side.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by axeloh
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants