mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-04 12:18:24 +00:00
HuggingFaceEndpoint: Correct Example for ImportError (#1176)
When I try to import the Class HuggingFaceEndpoint I get an Import Error: cannot import name 'HuggingFaceEndpoint' from 'langchain'. (langchain version 0.0.88) These two imports work fine: from langchain import HuggingFacePipeline and from langchain import HuggingFaceHub. So I corrected the import statement in the example. There is probably a better solution to this, but this fixes the Error for me.
This commit is contained in:
parent
0c84ce1082
commit
af94f1dd97
@ -28,6 +28,7 @@ from langchain.llms import (
|
|||||||
Cohere,
|
Cohere,
|
||||||
ForefrontAI,
|
ForefrontAI,
|
||||||
GooseAI,
|
GooseAI,
|
||||||
|
HuggingFaceEndpoint,
|
||||||
HuggingFaceHub,
|
HuggingFaceHub,
|
||||||
OpenAI,
|
OpenAI,
|
||||||
Petals,
|
Petals,
|
||||||
@ -76,6 +77,7 @@ __all__ = [
|
|||||||
"PromptTemplate",
|
"PromptTemplate",
|
||||||
"ReActChain",
|
"ReActChain",
|
||||||
"Wikipedia",
|
"Wikipedia",
|
||||||
|
"HuggingFaceEndpoint",
|
||||||
"HuggingFaceHub",
|
"HuggingFaceHub",
|
||||||
"HuggingFacePipeline",
|
"HuggingFacePipeline",
|
||||||
"SQLDatabase",
|
"SQLDatabase",
|
||||||
|
@ -8,6 +8,7 @@ from langchain.llms.cerebriumai import CerebriumAI
|
|||||||
from langchain.llms.cohere import Cohere
|
from langchain.llms.cohere import Cohere
|
||||||
from langchain.llms.forefrontai import ForefrontAI
|
from langchain.llms.forefrontai import ForefrontAI
|
||||||
from langchain.llms.gooseai import GooseAI
|
from langchain.llms.gooseai import GooseAI
|
||||||
|
from langchain.llms.huggingface_endpoint import HuggingFaceEndpoint
|
||||||
from langchain.llms.huggingface_hub import HuggingFaceHub
|
from langchain.llms.huggingface_hub import HuggingFaceHub
|
||||||
from langchain.llms.huggingface_pipeline import HuggingFacePipeline
|
from langchain.llms.huggingface_pipeline import HuggingFacePipeline
|
||||||
from langchain.llms.nlpcloud import NLPCloud
|
from langchain.llms.nlpcloud import NLPCloud
|
||||||
@ -26,6 +27,7 @@ __all__ = [
|
|||||||
"NLPCloud",
|
"NLPCloud",
|
||||||
"OpenAI",
|
"OpenAI",
|
||||||
"Petals",
|
"Petals",
|
||||||
|
"HuggingFaceEndpoint",
|
||||||
"HuggingFaceHub",
|
"HuggingFaceHub",
|
||||||
"HuggingFacePipeline",
|
"HuggingFacePipeline",
|
||||||
"AI21",
|
"AI21",
|
||||||
@ -43,6 +45,7 @@ type_to_cls_dict: Dict[str, Type[BaseLLM]] = {
|
|||||||
"forefrontai": ForefrontAI,
|
"forefrontai": ForefrontAI,
|
||||||
"gooseai": GooseAI,
|
"gooseai": GooseAI,
|
||||||
"huggingface_hub": HuggingFaceHub,
|
"huggingface_hub": HuggingFaceHub,
|
||||||
|
"huggingface_endpoint": HuggingFaceEndpoint,
|
||||||
"nlpcloud": NLPCloud,
|
"nlpcloud": NLPCloud,
|
||||||
"openai": OpenAI,
|
"openai": OpenAI,
|
||||||
"petals": Petals,
|
"petals": Petals,
|
||||||
|
@ -23,7 +23,7 @@ class HuggingFaceEndpoint(LLM, BaseModel):
|
|||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from langchain import HuggingFaceEndpoint
|
from langchain.llms.huggingface_endpoint import HuggingFaceEndpoint
|
||||||
endpoint_url = (
|
endpoint_url = (
|
||||||
"https://abcdefghijklmnop.us-east-1.aws.endpoints.huggingface.cloud"
|
"https://abcdefghijklmnop.us-east-1.aws.endpoints.huggingface.cloud"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user