pub struct ModelOptions {
pub backend: Backend,
pub device: Option<Device>,
pub no_mmap: bool,
}Expand description
Options for loading a model.
Fields§
§backend: BackendWhich backend to request. Default Backend::Auto. An explicit device
must match a non-Auto backend request.
device: Option<Device>Exact process-local compute device. None applies the backend’s
automatic policy; Some selects that device or fails without fallback.
no_mmap: boolCopy the weights into memory instead of memory-mapping the model file.
Default false: where the device can use host memory (CPU, Metal on
Apple silicon) the weights are served from the file’s page cache, which
the OS can reclaim. Don’t truncate or rewrite a mapped model file in
place; write a new file and rename it over the old one. The
TRANSCRIBE_NO_MMAP=1 environment variable forces true.
Trait Implementations§
Source§impl Clone for ModelOptions
impl Clone for ModelOptions
Source§impl Debug for ModelOptions
impl Debug for ModelOptions
Source§impl Default for ModelOptions
impl Default for ModelOptions
impl Eq for ModelOptions
Source§impl PartialEq for ModelOptions
impl PartialEq for ModelOptions
impl StructuralPartialEq for ModelOptions
Auto Trait Implementations§
impl Freeze for ModelOptions
impl RefUnwindSafe for ModelOptions
impl Send for ModelOptions
impl Sync for ModelOptions
impl Unpin for ModelOptions
impl UnsafeUnpin for ModelOptions
impl UnwindSafe for ModelOptions
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