This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
RuntimeError: asyncio.run() cannot be called from a running event loop #138
Answered
by
SeeknnDestroy
andysingal
asked this question in
Q&A
-
Notebook: https://colab.research.google.com/github/safevideo/autollm/blob/main/examples/quickstart.ipynb |
Beta Was this translation helpful? Give feedback.
Answered by
SeeknnDestroy
Nov 8, 2023
Replies: 1 comment
-
Hello @andysingal Thank you for using The error is due to the attempt to start an async !pip install nest_asyncio
import nest_asyncio
from autoLm import AutoFastAPI
nest_asyncio.apply()
app = AutoFastAPI.from_query_engine(query_engine)
# Now you can run the app without the RuntimeError
uvicorn.run(app, host="0.0.0.0", port=8000) We hope this helps, and we’re here for any further questions or feedback. Best, |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
fcakyon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @andysingal
Thank you for using
autollm
and for reporting this issue.The error is due to the attempt to start an async
uvicorn
server in Google Colab, which already runs in an async event loop. To resolve this, usenest_asyncio
to patch the event loop. Here’s the code snippet you can use:We hope this helps, and we’re here for any further questions or feedback.
Best,
Talha