Apply patch [skip ci]

This commit is contained in:
open-swe[bot] 2025-07-31 00:13:51 +00:00
parent 72df882ae9
commit 5b6e25a88f

View File

@ -44,23 +44,19 @@ class HuggingFaceEmbeddings(BaseModel, Embeddings):
"""Model name to use."""
cache_folder: Optional[str] = None
"""Path to store models.
Can be also set by SENTENCE_TRANSFORMERS_HOME environment variable."""
Can be also set by TRANSFORMERS_CACHE environment variable."""
model_kwargs: dict[str, Any] = Field(default_factory=dict)
"""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"""
"""Keyword arguments to pass to the transformer model, such as `device`,
`revision`, `trust_remote_code`, or `token`."""
encode_kwargs: dict[str, Any] = Field(default_factory=dict)
"""Keyword arguments to pass when calling the `encode` method for the documents 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"""
"""Keyword arguments to pass when calling the `encode` method for the documents,
such as `batch_size`, `normalize_embeddings`, and more."""
query_encode_kwargs: dict[str, Any] = Field(default_factory=dict)
"""Keyword arguments to pass when calling the `encode` method for the query 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"""
"""Keyword arguments to pass when calling the `encode` method for the query,
such as `batch_size`, `normalize_embeddings`, and more."""
multi_process: bool = False
"""Run encode() on multiple GPUs."""
"""Run encode() on multiple GPUs. Note: This feature is not supported with transformers
and will be ignored with a warning."""
show_progress: bool = False
"""Whether to show a progress bar."""
@ -174,3 +170,4 @@ class HuggingFaceEmbeddings(BaseModel, Embeddings):
)
return self._embed([text], embed_kwargs)[0]