Change8
Error2 reports

Fix NotForkableError

in LangChain

Solution

The "NotForkableError" in Langchain often arises from attempting to serialize and fork objects (like chains or agents) containing non-forkable attributes, such as those referencing CUDA tensors or file descriptors. To fix this, ensure states related to CUDA tensors stay on the main process or are moved to shared memory, and avoid passing objects that hold file descriptors to the forked process. Alternatively, consider using a different parallelization method that does not rely on forking, like multiprocessing with the 'spawn' or 'threading' start methods, alongside appropriate serialization techniques.

Timeline

First reported:3h ago
Last reported:2h ago

Need More Help?

View the full changelog and migration guides for LangChain

View LangChain Changelog