mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-16 08:06:14 +00:00
Apply patch [skip ci]
This commit is contained in:
parent
a5ce851693
commit
67380e040c
@ -1,3 +1,23 @@
|
||||
"""Deprecated module for sentence transformer embeddings.
|
||||
|
||||
This module previously provided SentenceTransformerEmbeddings which used the
|
||||
sentence-transformers library. The sentence-transformers dependency has been removed
|
||||
from LangChain.
|
||||
|
||||
For embedding functionality, please use:
|
||||
- HuggingFaceEmbeddings from langchain_huggingface which now uses transformers directly
|
||||
- Or install langchain-community which may still contain the legacy implementation
|
||||
|
||||
Example migration:
|
||||
# Old way (deprecated):
|
||||
# from langchain.embeddings import SentenceTransformerEmbeddings
|
||||
# embeddings = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")
|
||||
|
||||
# New way:
|
||||
from langchain_huggingface import HuggingFaceEmbeddings
|
||||
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain._api import create_importer
|
||||
@ -19,3 +39,4 @@ def __getattr__(name: str) -> Any:
|
||||
|
||||
|
||||
__all__ = ["SentenceTransformerEmbeddings"]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user