SOAPAssist / gpt_index /async_utils.py
AbeerTrial's picture
Upload folder using huggingface_hub
8a58cf3
raw
history blame contribute delete
322 Bytes
"""Async utils."""
import asyncio
from typing import Any, Coroutine, List
def run_async_tasks(tasks: List[Coroutine]) -> List[Any]:
"""Run a list of async tasks."""
async def _gather() -> List[Any]:
return await asyncio.gather(*tasks)
outputs: List[Any] = asyncio.run(_gather())
return outputs