Find answers from the community

Updated last year

Asyncio

At a glance

The community member is encountering a RuntimeError when trying to run asyncio.run() from a running event loop. Another community member suggests using nest_asyncio.apply() at the top of the code to resolve the issue.

node_questions_0 = dataset_generator.generate_questions_from_nodes(num=10)
47 print(f"[Node {idx}] Generated questions:\n {node_questions_0}")
48

1 frames
/usr/lib/python3.10/asyncio/runners.py in run(main, debug)
31 """
32 if events._get_running_loop() is not None:
---> 33 raise RuntimeError(
34 "asyncio.run() cannot be called from a running event loop")
35

RuntimeError: asyncio.run() cannot be called from a running event loop

getting this issue with add knowledge finetune
L
D
2 comments
Plain Text
import nest_asyncio
nest_asyncio.apply()


Put that at the top of your code
Add a reply
Sign up and join the conversation on Discord