Find answers from the community

Updated 3 months ago

```

Plain Text
----> 4 dataset_generator.generate_questions_from_nodes()

File ~/Desktop/gen-ai-bot-builder/fastapi/genai_env_4/lib/python3.9/site-packages/nest_asyncio.py:99, in _patch_loop.<locals>.run_until_complete(self, future)
     96 if not f.done():
     97     raise RuntimeError(
     98         'Event loop stopped before Future completed.')
---> 99 return f.result()

File /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/futures.py:201, in Future.result(self)
    199 self.__log_traceback = False
    200 if self._exception is not None:
--> 201     raise self._exception
    202 return self._result

File /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py:256, in Task.__step(***failed resolving arguments***)
    252 try:
    253     if exc is None:
    254         # We use the `send` method directly, because coroutines
    255         # don't have `__iter__` and `__next__` methods.
--> 256         result = coro.send(None)
    257     else:
    258         result = coro.throw(exc)

File ~/Desktop/gen-ai-bot-builder/fastapi/genai_env_4/lib/python3.9/site-packages/llama_index/llama_dataset/generator.py:218, in RagDatasetGenerator.agenerate_questions_from_nodes(self)
    216 """Generates questions for each document."""
    217 dataset = await self._agenerate_dataset(self.nodes, labelled=False)
--> 218 return dataset.questions

AttributeError: 'LabelledRagDataset' object has no attribute 'questions'


The error occurs when I'm trying to this this line:
Plain Text
RagDatasetGenerator.from_documents(documents)


Any idea on the solution to this?
L
2 comments
Looking at the code, it seems like a bug to me
I'm surprised mypy didn't catcht this
Add a reply
Sign up and join the conversation on Discord