GenerateManyOptions
Options for GeneratorPool.generateMany: those of every request, plus progress.
Defined in: engine/src/worker/pool.ts:96
Extends
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
cache? | boolean | false: neither read nor write the worker's model cache for this request (default true). | GenerateOptions.cache | engine/src/worker/pool.ts:92 |
onDone? | (done: number, total: number) => void | Called as each entity lands, with how many have and how many were asked for. | - | engine/src/worker/pool.ts:98 |
priority? | number | Queue priority (default 0): a free worker takes the highest-priority queued request, in the order they were queued within one priority. Running requests are never pre-empted. Change it later with GeneratorPool.reprioritise. | GenerateOptions.priority | engine/src/worker/pool.ts:81 |
signal? | AbortSignal | Cancel the request. A queued one leaves the queue; a running one rejects at once and its result is discarded when it lands, but the worker still finishes it, because a generator runs synchronously and cannot be interrupted (see respawnOnAbort for the alternative). Either way the promise rejects with signal.reason: a DOMException named "AbortError" unless abort() was given a reason of its own, as with fetch. An already-aborted signal rejects without queueing anything. | GenerateOptions.signal | engine/src/worker/pool.ts:90 |
EncodeSource
A model to encode, as it travels to the worker: ModelSource without the sparse brick map, whose bricks come ahead of it in chunk messages (a map of hundreds of thousands of small arrays is slow to structured-clone; packed chunks transfer).
GenerateOptions
How to run one request, for GeneratorPool.generate. Every field is optional.