Last active
January 3, 2024 02:15
-
-
Save korakot/f1d835321fa14075227add61b90debb3 to your computer and use it in GitHub Desktop.
Use asyncio (async) in Colab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nest_asyncio | |
nest_asyncio.apply() |
I forgot how exactly. But if you import asyncio and there's a problem in Colab, you can try the code above.
ok, i had that problem just now lol
This comment from mohamed mofid is missing?
I think you just make a new event loop and pass it to nest_asyncio.apply() the start using it like this:
self.loop = asyncio.new_event_loop()
nest_asyncio.apply(self.loop)
asyncio.set_event_loop(self.loop)
I found that in GitHub:
https://github.com/erdewit/nest_asyncio/blob/master/tests/nest_test.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
could you please share how it works
thanks ;)