mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-15 23:57:21 +00:00
Apply patch [skip ci]
This commit is contained in:
parent
72df882ae9
commit
5b6e25a88f
@ -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]
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user