mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-14 15:57:27 +00:00
API: Fix blocking iterator execution
Run these iterators on the background thread. On startup, the API spawns a background thread as needed to run sync code on without blocking the event loop. Use asyncio's run_thread function since it allows for errors to be propegated. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -72,7 +72,7 @@ async def load_model_gen(model_path: pathlib.Path, **kwargs):
|
||||
|
||||
|
||||
async def load_model(model_path: pathlib.Path, **kwargs):
|
||||
async for _, _, _ in load_model_gen(model_path, **kwargs):
|
||||
async for _ in load_model_gen(model_path, **kwargs):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user