diff --git a/docs/docs/how_to/embed_text.mdx b/docs/docs/how_to/embed_text.mdx index 1be7b054d1e..ed75a36a624 100644 --- a/docs/docs/how_to/embed_text.mdx +++ b/docs/docs/how_to/embed_text.mdx @@ -75,6 +75,31 @@ Otherwise you can initialize without any params: from langchain_cohere import CohereEmbeddings embeddings_model = CohereEmbeddings() +``` + + + + +To start we'll need to install the Hugging Face partner package: + +```bash +pip install langchain-huggingface +``` + +You can then load any [Sentence Transformers model](https://huggingface.co/models?library=sentence-transformers) from the Hugging Face Hub. + +```python +from langchain_huggingface import HuggingFaceEmbeddings + +embeddings_model = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2") +``` + +You can also leave the `model_name` blank to use the default [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2) model. + +```python +from langchain_huggingface import HuggingFaceEmbeddings + +embeddings_model = HuggingFaceEmbeddings() ```