Skip to main content

Module worker

Module worker 

Source
Expand description

Inference on a worker thread: callers submit a request and read streamed text, and can cancel.

Structs§

Canceller
Stops a generation from another thread or task.
GenerateRequest
One generation request.
Generation
A running generation.
Stats
Worker
An engine on its own thread. The engine is loaded on the first request (and again after a failed load), so creating a worker is cheap. Requests run one at a time, in order.

Enums§

Chunk
What a generation streams back.
StopCause

Traits§

Engine
A loaded model. on_text gets each piece of text as it is sampled and returns false to stop.