Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: Could not find: llms #309

Closed
mmoya91 opened this issue Sep 27, 2023 · 1 comment
Closed

AttributeError: Could not find: llms #309

mmoya91 opened this issue Sep 27, 2023 · 1 comment
Labels
bug Something isn't working third party Third-party software (integrations etc.)

Comments

@mmoya91
Copy link

mmoya91 commented Sep 27, 2023

I'm running into the following error

     98 if not has_langchain or any(
     99     [
    100         (handle.startswith("langchain"))
    101         for handle in registry.llm_models.get_all()
    102     ]
    103 ):
    104     return
--> 106 for class_id, cls in LangChain.get_type_to_cls_dict().items():
    107     registry.llm_models.register(
    108         f"langchain.{cls.__name__}.v1",
    109         func=LangChain._langchain_model_maker(class_id=class_id),
    110     )

File ~/.pyenv/versions/3.11.3/envs/document_classifier/lib/python3.11/site-packages/spacy_llm/models/langchain/model.py:38, in LangChain.get_type_to_cls_dict()
     33 @staticmethod
     34 def get_type_to_cls_dict() -> Dict[str, Type["langchain.llms.base.BaseLLM"]]:
     35     """Returns langchain.llms.type_to_cls_dict.
     36     RETURNS (Dict[str, Type[langchain.llms.base.BaseLLM]]): langchain.llms.type_to_cls_dict.
     37     """
---> 38     return langchain.llms.type_to_cls_dict

File ~/.pyenv/versions/3.11.3/envs/document_classifier/lib/python3.11/site-packages/langchain/__init__.py:308, in __getattr__(name)
    306     return SerpAPIWrapper
    307 else:
--> 308     raise AttributeError(f"Could not find: {name}")

AttributeError: Could not find: llms

whenever I try to use the following langchain config

[nlp]
lang = "en"
pipeline = ["llm"]

[components]

[components.llm]
factory = "llm"

[components.llm.task]
@llm_tasks = "spacy.TextCat.v1"
labels = ["COMPLIMENT", "INSULT"]

[components.llm.model]
@llm_models = "langchain.AzureOpenAI.v1"
name = "gpt-4"
@shadeMe
Copy link
Contributor

shadeMe commented Sep 27, 2023

Please refer to this issue - #307

@shadeMe shadeMe closed this as completed Sep 27, 2023
@rmitsch rmitsch added bug Something isn't working third party Third-party software (integrations etc.) labels Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working third party Third-party software (integrations etc.)
Projects
None yet
Development

No branches or pull requests

3 participants