mirror of
https://github.com/hwchase17/langchain
synced 2024-11-08 07:10:35 +00:00
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 ) ``` |
||
---|---|---|
.. | ||
__init__.py | ||
test_cohere.py | ||
test_elasticsearch.py | ||
test_google_palm.py | ||
test_huggingface_hub.py | ||
test_huggingface.py | ||
test_jina.py | ||
test_llamacpp.py | ||
test_modelscope_hub.py | ||
test_mosaicml.py | ||
test_openai.py | ||
test_self_hosted.py | ||
test_sentence_transformer.py | ||
test_tensorflow_hub.py | ||
test_vertexai.py |