# HuggingFaceInstructEmbeddings

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/embeddings/huggingface/HuggingFaceInstructEmbeddings)

Wrapper around sentence_transformers embedding models.

To use, you should have the ``sentence_transformers``
and ``InstructorEmbedding`` python packages installed.

## Signature

```python
HuggingFaceInstructEmbeddings(
    self,
    **kwargs: Any = {},
)
```

## Description

**Example:**

.. code-block:: python

from langchain_community.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
)

## Extends

- `BaseModel`
- `Embeddings`

## Constructors

```python
__init__(
    self,
    **kwargs: Any = {},
)
```


## Properties

- `client`
- `model_name`
- `cache_folder`
- `model_kwargs`
- `encode_kwargs`
- `embed_instruction`
- `query_instruction`
- `show_progress`
- `model_config`

## Methods

- [`embed_documents()`](https://reference.langchain.com/python/langchain-community/embeddings/huggingface/HuggingFaceInstructEmbeddings/embed_documents)
- [`embed_query()`](https://reference.langchain.com/python/langchain-community/embeddings/huggingface/HuggingFaceInstructEmbeddings/embed_query)

## ⚠️ Deprecated

Deprecated since version 0.2.2.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/embeddings/huggingface.py#L133)