pub struct LocalModel {
pub id: &'static str,
pub revision: &'static str,
pub files: &'static [ModelFile],
pub max_tokens: usize,
pub architecture: Architecture,
}Expand description
A model the local provider can run.
Fields§
§id: &'static strHugging Face repository id.
revision: &'static str§files: &'static [ModelFile]§max_tokens: usizeLongest input in tokens; a longer function is embedded by its head.
architecture: ArchitectureImplementations§
Source§impl LocalModel
impl LocalModel
Sourcepub fn dir(&self, cache_root: &Path) -> PathBuf
pub fn dir(&self, cache_root: &Path) -> PathBuf
Where the files live: <cache>/models/<owner>--<name>/<revision>.
Sourcepub fn is_downloaded(&self, dir: &Path) -> bool
pub fn is_downloaded(&self, dir: &Path) -> bool
Whether every file is in dir, verified. A download stamps the
directory once every file’s SHA-256 matched; files that have their
pinned sizes but no stamp (copied in by hand, or left by an earlier
build) are hashed once here, and stamped when they match. A size
alone proves nothing: an interrupted or overlapping download can
leave a file of the right size with the wrong bytes.
Sourcepub fn is_stamped(&self, dir: &Path) -> bool
pub fn is_stamped(&self, dir: &Path) -> bool
Whether every file in dir has its pinned size and the directory
carries this model’s stamp. Unlike Self::is_downloaded, it never
hashes a file or writes a stamp, so it is cheap enough for a listing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LocalModel
impl RefUnwindSafe for LocalModel
impl Send for LocalModel
impl Sync for LocalModel
impl Unpin for LocalModel
impl UnsafeUnpin for LocalModel
impl UnwindSafe for LocalModel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more