pub struct ModelManager { /* private fields */ }Expand description
The models of a list that fit this machine, to download, try, use and remove. A model that does not fit is not offered, unless it is already installed and still fits in memory. Build it once and keep it: downloads belong to it.
use ravenrs_ai::{CATALOG, ModelFolder, ModelManager};
let manager = ModelManager::new(CATALOG, ModelFolder::new("models"));Implementations§
Source§impl ModelManager
impl ModelManager
Sourcepub fn new(catalog: &[LocalModel], folder: ModelFolder) -> Self
pub fn new(catalog: &[LocalModel], folder: ModelFolder) -> Self
The models of catalog that fit this machine, kept in folder.
Sourcepub fn for_machine(
catalog: &[LocalModel],
folder: ModelFolder,
machine: &Machine,
) -> Self
pub fn for_machine( catalog: &[LocalModel], folder: ModelFolder, machine: &Machine, ) -> Self
The models of catalog that fit machine.
Sourcepub fn labels(self, labels: ModelManagerLabels) -> Self
pub fn labels(self, labels: ModelManagerLabels) -> Self
The words it shows.
Sourcepub fn assistant(&self) -> Option<LocalAssistant>
pub fn assistant(&self) -> Option<LocalAssistant>
The model in use, ready to be asked, if there is one.
Sourcepub fn model_in_use(&self) -> Option<LocalModel>
pub fn model_in_use(&self) -> Option<LocalModel>
The model in use, if any.
Trait Implementations§
Source§impl Clone for ModelManager
impl Clone for ModelManager
Source§fn clone(&self) -> ModelManager
fn clone(&self) -> ModelManager
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 moreSource§impl Debug for ModelManager
impl Debug for ModelManager
Auto Trait Implementations§
impl !RefUnwindSafe for ModelManager
impl !Send for ModelManager
impl !Sync for ModelManager
impl !UnwindSafe for ModelManager
impl Freeze for ModelManager
impl Unpin for ModelManager
impl UnsafeUnpin for ModelManager
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels;
None keeps the content size.