Replies: 1 comment 2 replies
-
Hiya, I think what you're looking for is simply
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I have a question about the asyncio inside the bentoml.
Currently, my service requires an async function call from the predict function(for redis request).
To this end, I used
asyncio.get_event_loop()
and the following error occurred.RuntimeError: There is no current event loop in thread 'AnyIO worker thread'.
I solved this problem using
asyncio.new_event_loop()
instead ofasyncio.get_event_loop()
.However, I wonder why
asyncio.get_event_loop()
does not work inside the bentoml service.I also tried to call the predict function from the runner’s init function for warmup, where
asyncio.get_event_loop()
works well, but the following error occurs inloop.run_until_complete
.RuntimeError: this event loop is already running.
When running the Bentoml service, what influences the async function call?
Is there another appropriate way to call async functions in the bentoml service?
Please note that below is a simplified example of our code.
bento_service.py
predictor.py
async_util.py
Beta Was this translation helpful? Give feedback.
All reactions