pub struct InferenceWorkItem {
pub id: u64,
pub prompt_tokens: Vec<u32>,
pub max_tokens: usize,
pub params: SamplingParams,
pub created_at: Instant,
pub result_tx: SyncSender<Vec<u32>>,
}Expand description
A single unit of work to be processed by the inference engine.
Fields§
§id: u64Unique monotonically-increasing request identifier.
prompt_tokens: Vec<u32>Pre-tokenised prompt.
max_tokens: usizeMaximum number of tokens to generate.
params: SamplingParamsSampling hyper-parameters for this request.
created_at: InstantWall-clock time at which this item was submitted to the queue.
result_tx: SyncSender<Vec<u32>>Channel through which the inference result is delivered.
Implementations§
Auto Trait Implementations§
impl Freeze for InferenceWorkItem
impl RefUnwindSafe for InferenceWorkItem
impl Send for InferenceWorkItem
impl Sync for InferenceWorkItem
impl Unpin for InferenceWorkItem
impl UnsafeUnpin for InferenceWorkItem
impl UnwindSafe for InferenceWorkItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more