From e0bee0d93f1b0f9e0a4c96d2d0c7535c6105d56b Mon Sep 17 00:00:00 2001 From: Raphael Mitsch Date: Mon, 13 Nov 2023 10:47:12 +0100 Subject: [PATCH] Update langchain pin. Modify langchain import. (#365) --- setup.cfg | 2 +- spacy_llm/models/langchain/model.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 2464317a..24e95770 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,7 +45,7 @@ spacy_misc = [options.extras_require] langchain = - langchain==0.0.331 + langchain==0.0.335 transformers = torch>=1.13.1,<2.0 transformers>=4.28.1,<5.0 diff --git a/spacy_llm/models/langchain/model.py b/spacy_llm/models/langchain/model.py index 6c491fd3..03657cdf 100644 --- a/spacy_llm/models/langchain/model.py +++ b/spacy_llm/models/langchain/model.py @@ -43,7 +43,7 @@ def get_type_to_cls_dict() -> Dict[ """Returns langchain.llms.type_to_cls_dict. RETURNS (Dict[str, Type[langchain.base_language.BaseLanguageModel]]): langchain.llms.type_to_cls_dict. """ - return langchain.llms.type_to_cls_dict + return getattr(langchain.llms, "type_to_cls_dict") def __call__(self, prompts: Iterable[Any]) -> Iterable[Any]: """Executes prompts on specified API.