ProcessorConfig

Struct ProcessorConfig 

Source
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: bool

Whether to resize the image.

§resize_mode: ResizeMode

Image resizing mode.

§resize_filter: Option<&'static str>

Image resize filter algorithm.

§padding_value: u8

Padding value for image borders.

§normalize: bool

Whether to normalize image values.

§image_std: Vec<f32>

Standard deviation values for normalization.

§image_mean: Vec<f32>

Mean values for normalization.

§nchw: bool

Whether to use NCHW format (channels first).

§unsigned: bool

Whether to use unsigned integer format.

§pad_image: bool

Whether to pad image for super resolution.

§pad_size: usize

Padding size for super resolution.

§up_scale: f32

Up-scaling factor for super resolution.

§image_tensor_layout: ImageTensorLayout

Image 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: f32

Temperature parameter for text generation.

§topp: f32

Top-p parameter for nucleus sampling.

Implementations§

Source§

impl ProcessorConfig

Source

pub fn with_image_width(self, x: u32) -> Self

Sets the optional image_width field.

§Arguments
  • x - The value that will be automatically wrapped in Some
§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

Source

pub fn image_width(&self) -> Option<u32>

Returns the value of the optional image_width field.

§Example
let obj = ProcessorConfig::default();
let value = obj.image_width();

Generated by aksr - Builder pattern macro

Source

pub fn with_image_height(self, x: u32) -> Self

Sets the optional image_height field.

§Arguments
  • x - The value that will be automatically wrapped in Some
§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

Source

pub fn image_height(&self) -> Option<u32>

Returns the value of the optional image_height field.

§Example
let obj = ProcessorConfig::default();
let value = obj.image_height();

Generated by aksr - Builder pattern macro

Source

pub fn with_do_resize(self, x: bool) -> Self

Sets the do_resize field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = ProcessorConfig::default().with_do_resize(value);

Generated by aksr - Builder pattern macro

Source

pub fn do_resize(&self) -> bool

Returns the value of the do_resize field.

§Example
let obj = ProcessorConfig::default();
let value = obj.do_resize();

Generated by aksr - Builder pattern macro

Source

pub fn with_resize_mode(self, x: ResizeMode) -> Self

Sets the resize_mode field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = ProcessorConfig::default().with_resize_mode(value);

Generated by aksr - Builder pattern macro

Source

pub fn resize_mode(&self) -> &ResizeMode

Returns a reference to the resize_mode field.

§Example
let obj = ProcessorConfig::default();
let value = obj.resize_mode();

Generated by aksr - Builder pattern macro

Source

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 in Some
§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

Source

pub fn resize_filter(&self) -> Option<&'static str>

Returns the value of the optional resize_filter field.

§Example
let obj = ProcessorConfig::default();
let value = obj.resize_filter();

Generated by aksr - Builder pattern macro

Source

pub fn with_padding_value(self, x: u8) -> Self

Sets the padding_value field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = ProcessorConfig::default().with_padding_value(value);

Generated by aksr - Builder pattern macro

Source

pub fn padding_value(&self) -> u8

Returns the value of the padding_value field.

§Example
let obj = ProcessorConfig::default();
let value = obj.padding_value();

Generated by aksr - Builder pattern macro

Source

pub fn with_normalize(self, x: bool) -> Self

Sets the normalize field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = ProcessorConfig::default().with_normalize(value);

Generated by aksr - Builder pattern macro

Source

pub fn normalize(&self) -> bool

Returns the value of the normalize field.

§Example
let obj = ProcessorConfig::default();
let value = obj.normalize();

Generated by aksr - Builder pattern macro

Source

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

Source

pub fn image_std(&self) -> &[f32]

Returns a slice view of the image_std field.

§Example
let obj = ProcessorConfig::default();
let items = obj.image_std();

Generated by aksr - Builder pattern macro

Source

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

Source

pub fn image_mean(&self) -> &[f32]

Returns a slice view of the image_mean field.

§Example
let obj = ProcessorConfig::default();
let items = obj.image_mean();

Generated by aksr - Builder pattern macro

Source

pub fn with_nchw(self, x: bool) -> Self

Sets the nchw field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = ProcessorConfig::default().with_nchw(value);

Generated by aksr - Builder pattern macro

Source

pub fn nchw(&self) -> bool

Returns the value of the nchw field.

§Example
let obj = ProcessorConfig::default();
let value = obj.nchw();

Generated by aksr - Builder pattern macro

Source

pub fn with_unsigned(self, x: bool) -> Self

Sets the unsigned field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = ProcessorConfig::default().with_unsigned(value);

Generated by aksr - Builder pattern macro

Source

pub fn unsigned(&self) -> bool

Returns the value of the unsigned field.

§Example
let obj = ProcessorConfig::default();
let value = obj.unsigned();

Generated by aksr - Builder pattern macro

Source

pub fn with_pad_image(self, x: bool) -> Self

Sets the pad_image field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = ProcessorConfig::default().with_pad_image(value);

Generated by aksr - Builder pattern macro

Source

pub fn pad_image(&self) -> bool

Returns the value of the pad_image field.

§Example
let obj = ProcessorConfig::default();
let value = obj.pad_image();

Generated by aksr - Builder pattern macro

Source

pub fn with_pad_size(self, x: usize) -> Self

Sets the pad_size field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = ProcessorConfig::default().with_pad_size(value);

Generated by aksr - Builder pattern macro

Source

pub fn pad_size(&self) -> usize

Returns the value of the pad_size field.

§Example
let obj = ProcessorConfig::default();
let value = obj.pad_size();

Generated by aksr - Builder pattern macro

Source

pub fn with_up_scale(self, x: f32) -> Self

Sets the up_scale field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = ProcessorConfig::default().with_up_scale(value);

Generated by aksr - Builder pattern macro

Source

pub fn up_scale(&self) -> f32

Returns the value of the up_scale field.

§Example
let obj = ProcessorConfig::default();
let value = obj.up_scale();

Generated by aksr - Builder pattern macro

Source

pub fn with_image_tensor_layout(self, x: ImageTensorLayout) -> Self

Sets the image_tensor_layout field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = ProcessorConfig::default().with_image_tensor_layout(value);

Generated by aksr - Builder pattern macro

Source

pub fn image_tensor_layout(&self) -> &ImageTensorLayout

Returns a reference to the image_tensor_layout field.

§Example
let obj = ProcessorConfig::default();
let value = obj.image_tensor_layout();

Generated by aksr - Builder pattern macro

Source

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 in Some
§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

Source

pub fn model_max_length(&self) -> Option<u64>

Returns the value of the optional model_max_length field.

§Example
let obj = ProcessorConfig::default();
let value = obj.model_max_length();

Generated by aksr - Builder pattern macro

Source

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 to String and wrapped in Some
§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

Source

pub fn tokenizer_file(&self) -> Option<&str>

Returns an optional string slice of the tokenizer_file field.

§Example
let obj = ProcessorConfig::default();
let value = obj.tokenizer_file();

Generated by aksr - Builder pattern macro

Source

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 to String and wrapped in Some
§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

Source

pub fn config_file(&self) -> Option<&str>

Returns an optional string slice of the config_file field.

§Example
let obj = ProcessorConfig::default();
let value = obj.config_file();

Generated by aksr - Builder pattern macro

Source

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 to String and wrapped in Some
§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

Source

pub fn special_tokens_map_file(&self) -> Option<&str>

Returns an optional string slice of the special_tokens_map_file field.

§Example
let obj = ProcessorConfig::default();
let value = obj.special_tokens_map_file();

Generated by aksr - Builder pattern macro

Source

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 to String and wrapped in Some
§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

Source

pub fn tokenizer_config_file(&self) -> Option<&str>

Returns an optional string slice of the tokenizer_config_file field.

§Example
let obj = ProcessorConfig::default();
let value = obj.tokenizer_config_file();

Generated by aksr - Builder pattern macro

Source

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 to String and wrapped in Some
§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

Source

pub fn generation_config_file(&self) -> Option<&str>

Returns an optional string slice of the generation_config_file field.

§Example
let obj = ProcessorConfig::default();
let value = obj.generation_config_file();

Generated by aksr - Builder pattern macro

Source

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 to String and wrapped in Some
§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

Source

pub fn vocab_file(&self) -> Option<&str>

Returns an optional string slice of the vocab_file field.

§Example
let obj = ProcessorConfig::default();
let value = obj.vocab_file();

Generated by aksr - Builder pattern macro

Source

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 to String and wrapped in Some
§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

Source

pub fn vocab_txt(&self) -> Option<&str>

Returns an optional string slice of the vocab_txt field.

§Example
let obj = ProcessorConfig::default();
let value = obj.vocab_txt();

Generated by aksr - Builder pattern macro

Source

pub fn with_temperature(self, x: f32) -> Self

Sets the temperature field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = ProcessorConfig::default().with_temperature(value);

Generated by aksr - Builder pattern macro

Source

pub fn temperature(&self) -> f32

Returns the value of the temperature field.

§Example
let obj = ProcessorConfig::default();
let value = obj.temperature();

Generated by aksr - Builder pattern macro

Source

pub fn with_topp(self, x: f32) -> Self

Sets the topp field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = ProcessorConfig::default().with_topp(value);

Generated by aksr - Builder pattern macro

Source

pub fn topp(&self) -> f32

Returns the value of the topp field.

§Example
let obj = ProcessorConfig::default();
let value = obj.topp();

Generated by aksr - Builder pattern macro

Trait Implementations§

Source§

impl Clone for ProcessorConfig

Source§

fn clone(&self) -> ProcessorConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProcessorConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProcessorConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V