Skip to content

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

Answered by SeeknnDestroy
michelebon asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @michelebon ,

Thank you so much for exploring autollm and for bringing this issue to our attention! We're thrilled to have you in our community. To quickly resolve the error you're encountering, you can use the nest_asyncio package. This package allows for nesting the asyncio event loop, which should fix the RuntimeError you're experiencing.

Here's what you can do:

  1. Right before the line where the error occurs, add the following code:

    import nest_asyncio
    nest_asyncio.apply()
  2. Additionally, change the embed_model parameter to embed_model="text-embedding-ada-002",.

This should help you move past the error. Meanwhile, I will be working on fixing this and updating the quickstart Colab …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by SeeknnDestroy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants