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

Error with Langchain demo notebook #229

Open
2 tasks done
Tylersuard opened this issue Jul 6, 2023 · 3 comments · May be fixed by #302
Open
2 tasks done

Error with Langchain demo notebook #229

Tylersuard opened this issue Jul 6, 2023 · 3 comments · May be fixed by #302
Labels
bug Something isn't working

Comments

@Tylersuard
Copy link

Is this a new bug?

  • I believe this is a new bug
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

When running this notebook: https://colab.research.google.com/github/pinecone-io/examples/blob/master/generation/langchain/handbook/05-langchain-retrieval-augmentation.ipynb

from datasets import load_dataset
causes this error:


AttributeError Traceback (most recent call last)

in <cell line: 1>()
----> 1 from datasets import load_dataset
2
3 data = load_dataset("wikipedia", "20220301.simple", split='train[:10000]')
4 data

8 frames

/usr/local/lib/python3.10/dist-packages/multiprocess/dummy/init.py in
85 #
86
---> 87 class Condition(threading._Condition):
88 # XXX
89 if sys.version_info < (3, 0):

AttributeError: module 'threading' has no attribute '_Condition'

Expected Behavior

It should import load_dataset

Steps To Reproduce

Open this notebook and run all:
https://colab.research.google.com/github/pinecone-io/examples/blob/master/generation/langchain/handbook/05-langchain-retrieval-augmentation.ipynb

Relevant log output

No response

Environment

Colab notebook

Additional Context

No response

@Tylersuard Tylersuard added the bug Something isn't working label Jul 6, 2023
@tytung2020
Copy link

tytung2020 commented Jul 14, 2023

The following steps solve the problem for me:
!pip install --upgrade datasets multiprocess

!pip install --upgrade protobuf apache-beam

you may need to restart the runtime after each of these executions

miararoy added a commit that referenced this issue Jul 17, 2023
@temiwale88
Copy link

Thanks @tytung2020 .
And !pip install -qU "pinecone-client[grpc]"==2.2.1 didn't give me issues like xx2.22.
And...changed this

index = pinecone.GRPCIndex(index_name)

index.describe_index_stats()

To:

import time

index = pinecone.GRPCIndex(index_name)
# wait a moment for the index to be fully initialized
time.sleep(1)

index.describe_index_stats()

I'm simply replacing some code snippets in this notebook for what's working here

@davidonlaptop
Copy link

davidonlaptop commented Aug 7, 2023

This Poetry setup has worked for me using Python 3.9 :

pyproject.toml

[tool.poetry]
name = "aiexplore"
version = "0.1.0"
description = "Exploring OpenAI"
readme = "README.md"

[tool.poetry.dependencies]
python = "~3.9.17"
openai = "^0.27.7"
dill = "~0.3.1.1"
multiprocess = "<0.70.9"
datasets = "2.12.0"
protobuf = "3.19.3"
apache-beam = "~2.46.0"
pinecone-client = { version = "2.2.1", extras = ["grpc"] }
mwparserfromhell = "^0.6.4"
langchain = "^0.0.162"
tiktoken = "0.4.0"

[tool.poetry.group.dev.dependencies]
ipykernel = "^6.25.0"
pipdeptree = "^2.12.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Then:

poetry install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants