pub struct ProcessorConfig {Show 25 fields
pub image_width: Option<u32>,
pub image_height: Option<u32>,
pub do_resize: bool,
pub resize_mode: ResizeMode,
pub resize_filter: Option<&'static str>,
pub padding_value: u8,
pub normalize: bool,
pub image_std: Vec<f32>,
pub image_mean: Vec<f32>,
pub nchw: bool,
pub unsigned: bool,
pub pad_image: bool,
pub pad_size: usize,
pub up_scale: f32,
pub image_tensor_layout: ImageTensorLayout,
pub model_max_length: Option<u64>,
pub tokenizer_file: Option<String>,
pub config_file: Option<String>,
pub special_tokens_map_file: Option<String>,
pub tokenizer_config_file: Option<String>,
pub generation_config_file: Option<String>,
pub vocab_file: Option<String>,
pub vocab_txt: Option<String>,
pub temperature: f32,
pub topp: f32,
}Expand description
Configuration for image and text processing pipelines.
Fields§
§image_width: Option<u32>Target image width for resizing.
image_height: Option<u32>Target image height for resizing.
do_resize: boolWhether to resize the image.
resize_mode: ResizeModeImage resizing mode.
resize_filter: Option<&'static str>Image resize filter algorithm.
padding_value: u8Padding value for image borders.
normalize: boolWhether to normalize image values.
image_std: Vec<f32>Standard deviation values for normalization.
image_mean: Vec<f32>Mean values for normalization.
nchw: boolWhether to use NCHW format (channels first).
unsigned: boolWhether to use unsigned integer format.
pad_image: boolWhether to pad image for super resolution.
pad_size: usizePadding size for super resolution.
up_scale: f32Up-scaling factor for super resolution.
image_tensor_layout: ImageTensorLayoutImage tensor layout format.
model_max_length: Option<u64>Maximum sequence length for tokenization.
tokenizer_file: Option<String>Path to tokenizer file.
config_file: Option<String>Path to model configuration file.
special_tokens_map_file: Option<String>Path to special tokens mapping file.
tokenizer_config_file: Option<String>Path to tokenizer configuration file.
generation_config_file: Option<String>Path to generation configuration file.
vocab_file: Option<String>Path to vocabulary file.
vocab_txt: Option<String>Path to vocabulary text file.
temperature: f32Temperature parameter for text generation.
topp: f32Top-p parameter for nucleus sampling.
Implementations§
Source§impl ProcessorConfig
impl ProcessorConfig
Sourcepub fn with_image_width(self, x: u32) -> Self
pub fn with_image_width(self, x: u32) -> Self
Sets the optional image_width field.
§Arguments
x- The value that will be automatically wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The value is automatically wrapped in Some, so you don’t need to pass Some(value).
§Example
let obj = ProcessorConfig::default().with_image_width(value);Generated by aksr - Builder pattern macro
Sourcepub fn image_width(&self) -> Option<u32>
pub fn image_width(&self) -> Option<u32>
Sourcepub fn with_image_height(self, x: u32) -> Self
pub fn with_image_height(self, x: u32) -> Self
Sets the optional image_height field.
§Arguments
x- The value that will be automatically wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The value is automatically wrapped in Some, so you don’t need to pass Some(value).
§Example
let obj = ProcessorConfig::default().with_image_height(value);Generated by aksr - Builder pattern macro
Sourcepub fn image_height(&self) -> Option<u32>
pub fn image_height(&self) -> Option<u32>
Sourcepub fn with_do_resize(self, x: bool) -> Self
pub fn with_do_resize(self, x: bool) -> Self
Sourcepub fn with_resize_mode(self, x: ResizeMode) -> Self
pub fn with_resize_mode(self, x: ResizeMode) -> Self
Sourcepub fn resize_mode(&self) -> &ResizeMode
pub fn resize_mode(&self) -> &ResizeMode
Sourcepub fn with_resize_filter(self, x: &'static str) -> Self
pub fn with_resize_filter(self, x: &'static str) -> Self
Sets the optional resize_filter field.
§Arguments
x- The value that will be automatically wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The value is automatically wrapped in Some, so you don’t need to pass Some(value).
§Example
let obj = ProcessorConfig::default().with_resize_filter(value);Generated by aksr - Builder pattern macro
Sourcepub fn resize_filter(&self) -> Option<&'static str>
pub fn resize_filter(&self) -> Option<&'static str>
Sourcepub fn with_padding_value(self, x: u8) -> Self
pub fn with_padding_value(self, x: u8) -> Self
Sourcepub fn padding_value(&self) -> u8
pub fn padding_value(&self) -> u8
Sourcepub fn with_normalize(self, x: bool) -> Self
pub fn with_normalize(self, x: bool) -> Self
Sourcepub fn with_image_std(self, x: &[f32]) -> Self
pub fn with_image_std(self, x: &[f32]) -> Self
Sets the image_std field from a slice.
§Arguments
x- A slice of elements to be converted into a vector
§Returns
Returns Self for method chaining.
§Note
If the slice is empty, the field remains unchanged.
§Example
let obj = ProcessorConfig::default().with_image_std(&[item1, item2]);Generated by aksr - Builder pattern macro
Sourcepub fn with_image_mean(self, x: &[f32]) -> Self
pub fn with_image_mean(self, x: &[f32]) -> Self
Sets the image_mean field from a slice.
§Arguments
x- A slice of elements to be converted into a vector
§Returns
Returns Self for method chaining.
§Note
If the slice is empty, the field remains unchanged.
§Example
let obj = ProcessorConfig::default().with_image_mean(&[item1, item2]);Generated by aksr - Builder pattern macro
Sourcepub fn image_mean(&self) -> &[f32]
pub fn image_mean(&self) -> &[f32]
Sourcepub fn with_unsigned(self, x: bool) -> Self
pub fn with_unsigned(self, x: bool) -> Self
Sourcepub fn with_pad_image(self, x: bool) -> Self
pub fn with_pad_image(self, x: bool) -> Self
Sourcepub fn with_pad_size(self, x: usize) -> Self
pub fn with_pad_size(self, x: usize) -> Self
Sourcepub fn with_up_scale(self, x: f32) -> Self
pub fn with_up_scale(self, x: f32) -> Self
Sourcepub fn with_image_tensor_layout(self, x: ImageTensorLayout) -> Self
pub fn with_image_tensor_layout(self, x: ImageTensorLayout) -> Self
Sourcepub fn image_tensor_layout(&self) -> &ImageTensorLayout
pub fn image_tensor_layout(&self) -> &ImageTensorLayout
Sourcepub fn with_model_max_length(self, x: u64) -> Self
pub fn with_model_max_length(self, x: u64) -> Self
Sets the optional model_max_length field.
§Arguments
x- The value that will be automatically wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The value is automatically wrapped in Some, so you don’t need to pass Some(value).
§Example
let obj = ProcessorConfig::default().with_model_max_length(value);Generated by aksr - Builder pattern macro
Sourcepub fn model_max_length(&self) -> Option<u64>
pub fn model_max_length(&self) -> Option<u64>
Sourcepub fn with_tokenizer_file(self, x: &str) -> Self
pub fn with_tokenizer_file(self, x: &str) -> Self
Sets the optional tokenizer_file field from a string slice.
§Arguments
x- A string slice that will be automatically converted toStringand wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The string slice is automatically converted to String and wrapped in Some.
§Example
let obj = ProcessorConfig::default().with_tokenizer_file("value");Generated by aksr - Builder pattern macro
Sourcepub fn tokenizer_file(&self) -> Option<&str>
pub fn tokenizer_file(&self) -> Option<&str>
Sourcepub fn with_config_file(self, x: &str) -> Self
pub fn with_config_file(self, x: &str) -> Self
Sets the optional config_file field from a string slice.
§Arguments
x- A string slice that will be automatically converted toStringand wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The string slice is automatically converted to String and wrapped in Some.
§Example
let obj = ProcessorConfig::default().with_config_file("value");Generated by aksr - Builder pattern macro
Sourcepub fn config_file(&self) -> Option<&str>
pub fn config_file(&self) -> Option<&str>
Sourcepub fn with_special_tokens_map_file(self, x: &str) -> Self
pub fn with_special_tokens_map_file(self, x: &str) -> Self
Sets the optional special_tokens_map_file field from a string slice.
§Arguments
x- A string slice that will be automatically converted toStringand wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The string slice is automatically converted to String and wrapped in Some.
§Example
let obj = ProcessorConfig::default().with_special_tokens_map_file("value");Generated by aksr - Builder pattern macro
Sourcepub fn special_tokens_map_file(&self) -> Option<&str>
pub fn special_tokens_map_file(&self) -> Option<&str>
Sourcepub fn with_tokenizer_config_file(self, x: &str) -> Self
pub fn with_tokenizer_config_file(self, x: &str) -> Self
Sets the optional tokenizer_config_file field from a string slice.
§Arguments
x- A string slice that will be automatically converted toStringand wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The string slice is automatically converted to String and wrapped in Some.
§Example
let obj = ProcessorConfig::default().with_tokenizer_config_file("value");Generated by aksr - Builder pattern macro
Sourcepub fn tokenizer_config_file(&self) -> Option<&str>
pub fn tokenizer_config_file(&self) -> Option<&str>
Sourcepub fn with_generation_config_file(self, x: &str) -> Self
pub fn with_generation_config_file(self, x: &str) -> Self
Sets the optional generation_config_file field from a string slice.
§Arguments
x- A string slice that will be automatically converted toStringand wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The string slice is automatically converted to String and wrapped in Some.
§Example
let obj = ProcessorConfig::default().with_generation_config_file("value");Generated by aksr - Builder pattern macro
Sourcepub fn generation_config_file(&self) -> Option<&str>
pub fn generation_config_file(&self) -> Option<&str>
Sourcepub fn with_vocab_file(self, x: &str) -> Self
pub fn with_vocab_file(self, x: &str) -> Self
Sets the optional vocab_file field from a string slice.
§Arguments
x- A string slice that will be automatically converted toStringand wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The string slice is automatically converted to String and wrapped in Some.
§Example
let obj = ProcessorConfig::default().with_vocab_file("value");Generated by aksr - Builder pattern macro
Sourcepub fn vocab_file(&self) -> Option<&str>
pub fn vocab_file(&self) -> Option<&str>
Sourcepub fn with_vocab_txt(self, x: &str) -> Self
pub fn with_vocab_txt(self, x: &str) -> Self
Sets the optional vocab_txt field from a string slice.
§Arguments
x- A string slice that will be automatically converted toStringand wrapped inSome
§Returns
Returns Self for method chaining.
§Note
The string slice is automatically converted to String and wrapped in Some.
§Example
let obj = ProcessorConfig::default().with_vocab_txt("value");Generated by aksr - Builder pattern macro
Sourcepub fn with_temperature(self, x: f32) -> Self
pub fn with_temperature(self, x: f32) -> Self
Sourcepub fn temperature(&self) -> f32
pub fn temperature(&self) -> f32
Trait Implementations§
Source§impl Clone for ProcessorConfig
impl Clone for ProcessorConfig
Source§fn clone(&self) -> ProcessorConfig
fn clone(&self) -> ProcessorConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProcessorConfig
impl Debug for ProcessorConfig
Auto Trait Implementations§
impl Freeze for ProcessorConfig
impl RefUnwindSafe for ProcessorConfig
impl Send for ProcessorConfig
impl Sync for ProcessorConfig
impl Unpin for ProcessorConfig
impl UnwindSafe for ProcessorConfig
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
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.