mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-17 15:35:14 +00:00
community: fix huggingface deprecations (#22522)
This commit is contained in:
@@ -21,7 +21,7 @@ DEFAULT_QUERY_BGE_INSTRUCTION_ZH = "为这个句子生成表示以用于检索
|
|||||||
@deprecated(
|
@deprecated(
|
||||||
since="0.2.2",
|
since="0.2.2",
|
||||||
removal="0.3.0",
|
removal="0.3.0",
|
||||||
alternative_import="from langchain_huggingface import HuggingFaceEmbeddings",
|
alternative_import="langchain_huggingface.HuggingFaceEmbeddings",
|
||||||
)
|
)
|
||||||
class HuggingFaceEmbeddings(BaseModel, Embeddings):
|
class HuggingFaceEmbeddings(BaseModel, Embeddings):
|
||||||
"""HuggingFace sentence_transformers embedding models.
|
"""HuggingFace sentence_transformers embedding models.
|
||||||
|
@@ -13,7 +13,7 @@ VALID_TASKS = ("feature-extraction",)
|
|||||||
@deprecated(
|
@deprecated(
|
||||||
since="0.2.2",
|
since="0.2.2",
|
||||||
removal="0.3.0",
|
removal="0.3.0",
|
||||||
alternative_import="from langchain_huggingface import HuggingFaceEndpointEmbeddings", # noqa: E501
|
alternative_import="langchain_huggingface.HuggingFaceEndpointEmbeddings",
|
||||||
)
|
)
|
||||||
class HuggingFaceHubEmbeddings(BaseModel, Embeddings):
|
class HuggingFaceHubEmbeddings(BaseModel, Embeddings):
|
||||||
"""HuggingFaceHub embedding models.
|
"""HuggingFaceHub embedding models.
|
||||||
|
@@ -25,7 +25,7 @@ VALID_TASKS = (
|
|||||||
@deprecated(
|
@deprecated(
|
||||||
since="0.0.37",
|
since="0.0.37",
|
||||||
removal="0.3",
|
removal="0.3",
|
||||||
alternative_import="from langchain_huggingface import HuggingFaceEndpoint",
|
alternative_import="langchain_huggingface.HuggingFaceEndpoint",
|
||||||
)
|
)
|
||||||
class HuggingFaceEndpoint(LLM):
|
class HuggingFaceEndpoint(LLM):
|
||||||
"""
|
"""
|
||||||
|
@@ -23,7 +23,7 @@ VALID_TASKS_DICT = {
|
|||||||
@deprecated(
|
@deprecated(
|
||||||
"0.0.21",
|
"0.0.21",
|
||||||
removal="0.3.0",
|
removal="0.3.0",
|
||||||
alternative_import="from langchain_huggingface import HuggingFaceEndpoint",
|
alternative_import="langchain_huggingface.HuggingFaceEndpoint",
|
||||||
)
|
)
|
||||||
class HuggingFaceHub(LLM):
|
class HuggingFaceHub(LLM):
|
||||||
"""HuggingFaceHub models.
|
"""HuggingFaceHub models.
|
||||||
|
@@ -26,7 +26,7 @@ logger = logging.getLogger(__name__)
|
|||||||
@deprecated(
|
@deprecated(
|
||||||
since="0.0.37",
|
since="0.0.37",
|
||||||
removal="0.3",
|
removal="0.3",
|
||||||
alternative_import="from langchain_huggingface import HuggingFacePipeline",
|
alternative_import="langchain_huggingface.HuggingFacePipeline",
|
||||||
)
|
)
|
||||||
class HuggingFacePipeline(BaseLLM):
|
class HuggingFacePipeline(BaseLLM):
|
||||||
"""HuggingFace Pipeline API.
|
"""HuggingFace Pipeline API.
|
||||||
|
@@ -17,7 +17,7 @@ logger = logging.getLogger(__name__)
|
|||||||
@deprecated(
|
@deprecated(
|
||||||
"0.0.21",
|
"0.0.21",
|
||||||
removal="0.3.0",
|
removal="0.3.0",
|
||||||
alternative_import="from langchain_huggingface import HuggingFaceEndpoint",
|
alternative_import="langchain_huggingface.HuggingFaceEndpoint",
|
||||||
)
|
)
|
||||||
class HuggingFaceTextGenInference(LLM):
|
class HuggingFaceTextGenInference(LLM):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user