OpenInterpreter / 01

The #1 open-source voice interface for desktop, mobile, and ESP32 chips.
https://01.openinterpreter.com/
GNU Affero General Public License v3.0
4.92k stars 517 forks source link

Fix Asyncio Bug #246

Open rbrisita opened 5 months ago

rbrisita commented 5 months ago

Fixing asyncio.Queue creation and usage by decoupling app, queues, and uvicorn config. This fixes issue #244. Creating from_user and to_device outside the main coroutine event loop creates futures in another event loop. With this fix the 01OS responds better and with voice using local models.

Tested on Debian 11 with Python versions 3.9.19 and 3.11.9

Resources in regard to this fix: https://stackoverflow.com/questions/53724665/using-queues-results-in-asyncio-exception-got-future-future-pending-attached https://github.com/fastapi-users/fastapi-users/discussions/663#discussioncomment-1025558 https://github.com/tiangolo/fastapi/issues/3854#issuecomment-911570879 https://github.com/tiangolo/fastapi/discussions/6566