nemo_curator.stages.text.experimental.translation.utils.async_utils

View as Markdown

Small async helpers shared by translation stages.

Module Contents

Functions

NameDescription
run_async_safeRun a coroutine from sync code, even if a loop is already active.

Data

_T

API

nemo_curator.stages.text.experimental.translation.utils.async_utils.run_async_safe(
coro_fn: collections.abc.Callable[[], collections.abc.Coroutine[object, object, nemo_curator.stages.text.experimental.translation.utils.async_utils._T]]
) -> nemo_curator.stages.text.experimental.translation.utils.async_utils._T

Run a coroutine from sync code, even if a loop is already active.

nemo_curator.stages.text.experimental.translation.utils.async_utils._T = TypeVar('_T')