diff --git a/requirements-dev.txt b/requirements-dev.txt index 39bdf903..e546e8d4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ mypy>=0.990,<1.1.0; platform_machine != "aarch64" and python_version >= "3.7" black==22.3.0 types-requests==2.28.11.16 # Prompting libraries needed for testing -langchain==0.0.249; python_version>="3.9" +langchain==0.0.302; python_version>="3.9" openai>=0.27; python_version>="3.9" # Necessary for running all local models on GPU. diff --git a/spacy_llm/models/langchain/model.py b/spacy_llm/models/langchain/model.py index b09d1788..668be9f3 100644 --- a/spacy_llm/models/langchain/model.py +++ b/spacy_llm/models/langchain/model.py @@ -5,6 +5,11 @@ from ...compat import has_langchain, langchain from ...registry import registry +try: + from langchain import llms # noqa: F401 +except (ImportError, AttributeError): + llms = None + class LangChain: def __init__(