MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / __anext__

Method __anext__

python/ctranslate2/extensions.py:458–470  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

456 return self
457
458 async def __anext__(self):
459 if self.shutdown_event.is_set():
460 raise StopAsyncIteration
461
462 try:
463 item = await self.queue.get()
464 if item is None:
465 self.shutdown_event.set()
466 raise StopAsyncIteration
467 return item
468 except asyncio.CancelledError:
469 self.shutdown_event.set()
470 raise StopAsyncIteration
471
472
473def _generate_tokens(process_func, *args, **kwargs):

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected