Update langchain_community/embeddings/huggingface.py for Sentence-Transformers v2.4.0 #18074
johneckberg
announced in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked
Feature request
Update huggingface.py as Sentence Transformers now supports prompt templates.
Some of the logic for embedding using
HuggingFaceBgeEmbeddings
might now be redundant as prompts/instructions can be handled inside of Sentence Transformers. Note that not all INSTRUCTOR models are not supported in Sentence Transformers yet. I would be more than happy to work on this!Motivation
Yesterday, a new version of the sentence-tranformers library was released. This version now supports prompt templates as well as some INSTRUCTOR models through the use of the
prompts
parameter. Prompts is an optional argument that accepts a dictionary of prompts with prompt names to prompt texts. Prompts can also be passed as a string using theprompt
option.Proposal (If applicable)
No response
Beta Was this translation helpful? Give feedback.
All reactions