Skip to content

Commit 1ac4eac

Browse files
authored
fix: attempting a simple fix for #1718 (#1721)
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
1 parent 99d1a47 commit 1ac4eac

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ragas/executor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
from ragas.run_config import RunConfig
1212
from ragas.utils import batched
1313

14+
import nest_asyncio
15+
nest_asyncio.apply()
16+
1417
logger = logging.getLogger(__name__)
1518

1619

0 commit comments

Comments
 (0)