Hi @Logan M I also used nest_asyncio.apply() but I am getting this error
NotImplementedError: Async generation not implemented for this LLM.
. This is the code snippet I am using it for QnA
start_time = time.perf_counter()
query_engine = loaded_index.as_query_engine(
text_qa_template=DEFAULT_TEXT_QA_PROMPT
)
# run each query in parallel
async def async_query(query_engine, questions):
tasks = [query_engine.aquery(q) for q in questions]
r = await asyncio.gather(*tasks)
return r
_ = asyncio.run(async_query(query_engine, query_list))
elapsed_time = time.perf_counter() - start_time
print(f"{elapsed_time:0.3f}s")