forked from Archives/langchain
c1807d8408
# What does this PR do? Bring support of `encode_kwargs` for ` HuggingFaceInstructEmbeddings`, change the docstring example and add a test to illustrate with `normalize_embeddings`. Fixes #3605 (Similar to #3914) Use case: ```python from langchain.embeddings import HuggingFaceInstructEmbeddings model_name = "hkunlp/instructor-large" model_kwargs = {'device': 'cpu'} encode_kwargs = {'normalize_embeddings': True} hf = HuggingFaceInstructEmbeddings( model_name=model_name, model_kwargs=model_kwargs, encode_kwargs=encode_kwargs ) ``` |
||
---|---|---|
.. | ||
agent | ||
cache | ||
callbacks | ||
chains | ||
chat_models | ||
client | ||
document_loaders | ||
embeddings | ||
examples | ||
llms | ||
memory | ||
prompts | ||
retrievers | ||
utilities | ||
vectorstores | ||
__init__.py | ||
.env.example | ||
conftest.py | ||
test_document_transformers.py | ||
test_nlp_text_splitters.py | ||
test_pdf_pagesplitter.py | ||
test_schema.py | ||
test_text_splitter.py |