pub struct InferenceOptions {
pub device: Device,
pub generation_mode: GenerationMode,
pub max_new_tokens: usize,
pub temperature: f32,
pub repetition_penalty: f32,
pub top_p: f32,
pub prompt_style: PromptStyle,
pub max_image_side: Option<u32>,
pub preload_language_model: bool,
}Expand description
Inference settings (device, decode, prompt, optional resize for speed).
Fields§
§device: Device§generation_mode: GenerationMode§max_new_tokens: usize§temperature: f32§repetition_penalty: f32§top_p: f32§prompt_style: PromptStyle§max_image_side: Option<u32>Resize so the longest edge is at most this many pixels before patchify (faster).
preload_language_model: boolCompile LM graphs on LocateAnythingSession::open.
Implementations§
Source§impl InferenceOptions
impl InferenceOptions
Sourcepub fn for_grounding() -> InferenceOptions
pub fn for_grounding() -> InferenceOptions
Greedy hybrid defaults suited to grounding (processor prompt).
pub fn device(self, device: Device) -> InferenceOptions
pub fn device_name(self, name: &str) -> Result<InferenceOptions, Error>
pub fn max_new_tokens(self, n: usize) -> InferenceOptions
pub fn generation_mode(self, mode: GenerationMode) -> InferenceOptions
pub fn prompt_style(self, style: PromptStyle) -> InferenceOptions
pub fn max_image_side(self, side: u32) -> InferenceOptions
pub fn preload_language_model(self, yes: bool) -> InferenceOptions
Trait Implementations§
Source§impl Clone for InferenceOptions
impl Clone for InferenceOptions
Source§fn clone(&self) -> InferenceOptions
fn clone(&self) -> InferenceOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InferenceOptions
impl RefUnwindSafe for InferenceOptions
impl Send for InferenceOptions
impl Sync for InferenceOptions
impl Unpin for InferenceOptions
impl UnsafeUnpin for InferenceOptions
impl UnwindSafe for InferenceOptions
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
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,
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