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

LCDocument import error due to TYPE_CHECKING condition #1809

Open
netbuddy opened this issue Jan 6, 2025 · 1 comment
Open

LCDocument import error due to TYPE_CHECKING condition #1809

netbuddy opened this issue Jan 6, 2025 · 1 comment
Labels
answered 🤖 The question has been answered. Will be closed automatically if no new comments bug Something isn't working

Comments

@netbuddy
Copy link

netbuddy commented Jan 6, 2025

[ ] I have checked the documentation and related resources and couldn't resolve my bug.

Describe the bug
When I run https://github.com/explodinggradients/ragas/blob/main/docs/howtos/integrations/llamaindex.ipynb in google colab, I get the following error:

NameError Traceback (most recent call last)
in <cell line: 2>()
1 # generate testset
----> 2 testset = generator.generate_with_llamaindex_docs(
3 documents,
4 testset_size=5,
5 )

1 frames
/usr/local/lib/python3.10/dist-packages/ragas/testset/synthesizers/generate.py in (.0)
239 # create the transforms
240 transforms = default_transforms(
--> 241 documents=[LCDocument(page_content=doc.text) for doc in documents],
242 llm=llm_for_transforms,
243 embedding_model=embedding_model_for_transforms,

NameError: name 'LCDocument' is not defined

Ragas version: 0.2.9
Python version: 3.10

Code to Reproduce
Share code to reproduce the issue

Error trace

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
In ragas/testset/synthesizers/generate.py, LCDocument is imported under a TYPE_CHECKING condition, and the value of TYPE_CHECKING is false.

@netbuddy netbuddy added the bug Something isn't working label Jan 6, 2025
@jjmachan
Copy link
Member

jjmachan commented Jan 7, 2025

hey @netbuddy thanks for reporting this 🙂

we merged a fix for this in #1804 could you check it out? it will be out in this weeks release.

If it solves it feel free to close this issue.

@jjmachan jjmachan added the answered 🤖 The question has been answered. Will be closed automatically if no new comments label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered 🤖 The question has been answered. Will be closed automatically if no new comments bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants