pub enum Decoding {
Greedy,
Sampled {
temperature: f32,
top_p: Option<f32>,
top_k: Option<usize>,
seed: u64,
},
}Expand description
How a VLM decoder picks each next token.
This is an enum rather than a bag of Option fields on purpose, and the
reason is the whole of Gate 2’s determinism requirement: there is no way to
spell “sampling without a seed”. A temperature: Option<f32> beside a
seed: Option<u64> lets a caller set one and forget the other, and the
result is output that cannot be reproduced — silently, and only noticed
when someone tries to re-run a ledger line.
Byte-stability is the one property every other FFai component already
holds. Mercury TTS ships it as a competitive claim its reference
structurally cannot match (TtsOptions::seed); Carmenta gates on
byte-identity; Diana matches PyTorch detection-for-detection. Argus does
not get to be the exception, so the type makes the exception
unrepresentable.
Variants§
Greedy
Always the argmax. Deterministic by construction, and the default.
#[default] rather than a hand-written impl Default: the default
belongs to the type, and a separate impl is one more place for it to
drift away from what this doc comment promises.
Sampled
Stochastic — and always seeded, because seed is not optional here.
Same input + same options + same seed = same bytes.
Trait Implementations§
impl StructuralPartialEq for Decoding
Auto Trait Implementations§
impl Freeze for Decoding
impl RefUnwindSafe for Decoding
impl Send for Decoding
impl Sync for Decoding
impl Unpin for Decoding
impl UnsafeUnpin for Decoding
impl UnwindSafe for Decoding
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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