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

langchain error on Ubuntu 20.04 (python 3.9) #2

Closed
lightonh opened this issue Apr 26, 2023 · 8 comments
Closed

langchain error on Ubuntu 20.04 (python 3.9) #2

lightonh opened this issue Apr 26, 2023 · 8 comments
Assignees

Comments

@lightonh
Copy link

Traceback (most recent call last):
File "/home/lightonh/NeMo-Guardrails/examples/demo_chain_as_action.py", line 76, in
demo()
File "/home/lightonh/NeMo-Guardrails/examples/demo_chain_as_action.py", line 71, in demo
result = app.generate(messages=history)
File "/home/lightonh/NeMo-Guardrails/nemoguardrails/rails/llm/llmrails.py", line 162, in generate
return asyncio.run(self.generate_async(prompt=prompt, messages=messages))
File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/home/lightonh/NeMo-Guardrails/nemoguardrails/rails/llm/llmrails.py", line 121, in generate_async
new_events = await self.runtime.generate_events(events)
File "/home/lightonh/NeMo-Guardrails/nemoguardrails/flows/runtime.py", line 144, in generate_events
next_events = await self._process_start_action(events)
File "/home/lightonh/NeMo-Guardrails/nemoguardrails/flows/runtime.py", line 251, in _process_start_action
parameters = inspect.signature(fn).parameters
File "/usr/lib/python3.9/inspect.py", line 3113, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
File "/usr/lib/python3.9/inspect.py", line 2862, in from_callable
return _signature_from_callable(obj, sigcls=cls,
File "/usr/lib/python3.9/inspect.py", line 2328, in _signature_from_callable
if _signature_is_builtin(obj):
File "/usr/lib/python3.9/inspect.py", line 1875, in _signature_is_builtin
obj in (type, object))
File "pydantic/main.py", line 911, in pydantic.main.BaseModel.eq
File "/home/lightonh/.virtualenvs/NeMo-Guardrails/lib/python3.9/site-packages/langchain/chains/base.py", line 249, in dict
_dict["_type"] = self._chain_type
File "/home/lightonh/.virtualenvs/NeMo-Guardrails/lib/python3.9/site-packages/langchain/chains/base.py", line 38, in _chain_type
raise NotImplementedError("Saving not supported for this chain type.")
NotImplementedError: Saving not supported for this chain type.

@lightonh
Copy link
Author

Package Version


aiohttp 3.8.4
aiosignal 1.3.1
annoy 1.17.1
anyio 3.6.2
astroid 2.15.4
async-timeout 4.0.2
attrs 23.1.0
black 23.3.0
certifi 2022.12.7
cfgv 3.3.1
charset-normalizer 3.1.0
click 8.1.3
cmake 3.26.3
dataclasses-json 0.5.7
dill 0.3.6
distlib 0.3.6
exceptiongroup 1.1.1
fastapi 0.95.0
filelock 3.12.0
frozenlist 1.3.3
fsspec 2023.4.0
greenlet 2.0.2
h11 0.14.0
httpcore 0.16.3
httpx 0.23.3
huggingface-hub 0.14.1
identify 2.5.23
idna 3.4
iniconfig 2.0.0
isort 5.12.0
Jinja2 3.1.2
joblib 1.2.0
langchain 0.0.137
lazy-object-proxy 1.9.0
lit 16.0.2
MarkupSafe 2.1.2
marshmallow 3.19.0
marshmallow-enum 1.5.1
mccabe 0.7.0
mpmath 1.3.0
multidict 6.0.4
mypy 1.1.1
mypy-extensions 1.0.0
networkx 3.1
nltk 3.8.1
nodeenv 1.7.0
numpy 1.24.3
nvidia-cublas-cu11 11.10.3.66
nvidia-cuda-cupti-cu11 11.7.101
nvidia-cuda-nvrtc-cu11 11.7.99
nvidia-cuda-runtime-cu11 11.7.99
nvidia-cudnn-cu11 8.5.0.96
nvidia-cufft-cu11 10.9.0.58
nvidia-curand-cu11 10.2.10.91
nvidia-cusolver-cu11 11.4.0.1
nvidia-cusparse-cu11 11.7.4.91
nvidia-nccl-cu11 2.14.3
nvidia-nvtx-cu11 11.7.91
openai 0.27.4
openapi-schema-pydantic 1.2.4
packaging 23.1
pathspec 0.11.1
Pillow 9.5.0
pip 23.1.1
platformdirs 3.3.0
pluggy 1.0.0
pre-commit 3.1.1
pydantic 1.10.6
pylint 2.17.0
pytest 7.2.2
pytest-asyncio 0.21.0
PyYAML 6.0
regex 2023.3.23
requests 2.28.2
rfc3986 1.5.0
scikit-learn 1.2.2
scipy 1.10.1
sentence-transformers 2.2.2
sentencepiece 0.1.98
setuptools 65.5.1
simpleeval 0.9.13
sniffio 1.3.0
SQLAlchemy 1.4.47
starlette 0.26.1
sympy 1.11.1
tenacity 8.2.2
threadpoolctl 3.1.0
tokenizers 0.13.3
tomli 2.0.1
tomlkit 0.11.7
torch 2.0.0
torchvision 0.15.1
tqdm 4.65.0
transformers 4.28.1
triton 2.0.0
typer 0.7.0
typing_extensions 4.5.0
typing-inspect 0.8.0
urllib3 1.26.15
uvicorn 0.21.1
virtualenv 20.22.0
wheel 0.37.1
wrapt 1.15.0
yarl 1.9.2

@aptlin
Copy link

aptlin commented Apr 26, 2023

Can reproduce with LangChain 0.0.137 and 0.0.149 (latest). Looks like a bug with chain serialization, since demos work if we do not make the _chain_type property abstract (e.g. by just changing this line to return 'default' instead).

cc @hwchase17

@drazvan
Copy link
Collaborator

drazvan commented Apr 26, 2023

Thanks for reporting this @lightonh and @aptlin. Just pushed a fix for this. We will release a patch version on PyPI very soon as well.

@drazvan drazvan closed this as completed Apr 26, 2023
@PetreanuAndi
Copy link

This keeps happening.
langchain 0.0.161
trying to run your "demo_chain_as_action.py", nothing else changed.

@Kamalabot
Copy link

@drazvan Tried it with langchain 0.0.174 the below error continues to occur.
Tried the fix suggested by @aptlin, it is not working.

@drazvan
Copy link
Collaborator

drazvan commented May 21, 2023

Just to confirm, are you using the main branch from GitHub or the package from PyPI (we haven't yet pushed the fix; we'll push a new version at the end of the month)?

@drazvan drazvan reopened this May 21, 2023
@Kamalabot
Copy link

Using the pypi package, not the main branch. Will try the main branch and see how it goes.

@Willis75
Copy link

Using the pypi package, not the main branch. Will try the main branch and see how it goes.

Hello, did it work?

drazvan pushed a commit that referenced this issue Jun 5, 2024
Adds some documentation changes and changes to PII interface
@Pouyanpi Pouyanpi closed this as completed Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants