llm2vec icon indicating copy to clipboard operation
llm2vec copied to clipboard

Refactor prompt template formation

Open vaibhavad opened this issue 1 year ago • 1 comments

Currently prompt template design is implemented here, which means the package needs to be edited for any new model or a different template.

It should be shifted to training script

vaibhavad avatar May 07 '24 17:05 vaibhavad

Can be done in this way

class CustomModel(LLM2Vec):
    def prepare_for_tokenization(self, text):
        text = (
                "<start_of_turn>user " + text.strip() + "<end_of_turn> \n\n"
                + "<start_of_turn>model "
            )
        return text

vaibhavad avatar Aug 29 '24 23:08 vaibhavad