-
Notifications
You must be signed in to change notification settings - Fork 831
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
Issues while running test generation #1718
Labels
Comments
they @ayulockin thanks a lot for this detailed issue - do make the PR and we can fix this over there. What I'm wondering is why the tests for executor don't catch this? I might have missed something there but these are the tests if it helps you
thanks a lot 🙂 |
Hey @ayulockin I have raised a fix for this #1733 |
jjmachan
pushed a commit
that referenced
this issue
Dec 5, 2024
I went through hoops the last hr to try a few things to fix the issue documented in #1718 (except `MultiHopAbstractQuerySynthesizer` and `MultiHopSpecificQuerySynthesizer`). This PR proposes the most trivial fix. But it fixes this test generation issue: ``` from langchain_community.document_loaders import DirectoryLoader from ragas.testset import TestsetGenerator from ragas.llms import LangchainLLMWrapper from ragas.embeddings import LangchainEmbeddingsWrapper from langchain_openai import ChatOpenAI from langchain_openai import OpenAIEmbeddings path = "Sample_Docs_Markdown/" loader = DirectoryLoader(path, glob="**/*.md") docs = loader.load() generator_llm = LangchainLLMWrapper(ChatOpenAI(model="gpt-4o")) generator_embeddings = LangchainEmbeddingsWrapper(OpenAIEmbeddings()) generator = TestsetGenerator(llm=generator_llm, embedding_model=generator_embeddings) dataset = generator.generate_with_langchain_docs(docs, testset_size=10) ``` Also both `test_executor.py` and `test_executor_in_jupyter.ipynb` are passing. cc: @jjmachan
jjmachan
pushed a commit
that referenced
this issue
Dec 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have checked the documentation and related resources and couldn't resolve my bug.
Describe the bug
I installed
ragas
from themain
branch and trying to run the test generation quick start (code to reproduce). I am getting the error trace 1 (AttributeError: 'MultiHopSpecificQuerySynthesizer' object has no attribute 'get_node_clusters'
).I commented out this line:
ragas/src/ragas/testset/synthesizers/__init__.py
Line 25 in eb5f745
Running the code again gives me error trace 2 (
openai.APIConnectionError: Connection error.
). I initially thought it was openai's issue but this is originating fromRuntimeError: Event loop is closed
error. The event loop is being closed prematurely or reused after being closed.It is arising from here:
ragas/src/ragas/executor.py
Line 182 in eb5f745
I was able to fix this issue with a slight modification to the method above:
Now I am getting error trace 3 (
AttributeError: 'PersonaThemesMapping' object has no attribute 'mappping'. Did you mean: 'mapping'?
). I thus commented out this line as well:ragas/src/ragas/testset/synthesizers/__init__.py
Line 24 in eb5f745
It worked.
To summarize:
MultiHopAbstractQuerySynthesizer
andMultiHopSpecificQuerySynthesizer
aren't working for me.executor.py
file, I am unable to run test generation.Ragas version:
'0.2.7.dev5+geb5f745'
Python version:
3.10.12
Code to Reproduce
Error trace
MultiHopSpecificQuerySynthesizer
.MultiHopAbstractQuerySynthesizer
:Expected behavior
A clear and concise description of what you expected to happen.
Additional context
Add any other context about the problem here.
cc: @jjmachan do let me know if I am missing anything while running test generation. If not and my analysis is right, I can open the PR to at least fix the
executor.py
file (I need to test the fix on a jupyter session though.)The text was updated successfully, but these errors were encountered: