Skip to content

The agent engineering platform.

docs: HFEmbeddings: Add more information to model_kwargs/encode_kwargs (#19594)

Tom Aarsene0a1278d2b12
diff --git a/libs/community/langchain_community/embeddings/huggingface.py b/libs/community/langchain_community/embeddings/huggingface.py
index 3d83ce2c49..3c9cee3892 100644
--- a/libs/community/langchain_community/embeddings/huggingface.py
+++ b/libs/community/langchain_community/embeddings/huggingface.py
@@ -44,9 +44,14 @@ class HuggingFaceEmbeddings(BaseModel, Embeddings):
"""Path to store models.
Can be also set by SENTENCE_TRANSFORMERS_HOME environment variable."""
model_kwargs: Dict[str, Any] = Field(default_factory=dict)
- """Keyword arguments to pass to the model."""
+ """Keyword arguments to pass to the Sentence Transformer model, such as `device`,
+ `prompts`, `default_prompt_name`, `revision`, `trust_remote_code`, or `token`.
+ See also the Sentence Transformer documentation: https://sbert.net/docs/package_reference/SentenceTransformer.html#sentence_transformers.SentenceTransformer"""
encode_kwargs: Dict[str, Any] = Field(default_factory=dict)
- """Keyword arguments to pass when calling the `encode` method of the model."""
+ """Keyword arguments to pass when calling the `encode` method of the Sentence
+ Transformer model, such as `prompt_name`, `prompt`, `batch_size`, `precision`,
+ `normalize_embeddings`, and more.
+ See also the Sentence Transformer documentation: https://sbert.net/docs/package_reference/SentenceTransformer.html#sentence_transformers.SentenceTransformer.encode"""
multi_process: bool = False
"""Run encode() on multiple GPUs."""
show_progress: bool = False