pub struct ModelManifest {
pub name: String,
pub task: String,
pub description: Option<String>,
pub license: String,
pub hf_repo: Option<String>,
pub files: Vec<ModelFile>,
}Expand description
A model manifest (models/*.toml).
Fields§
§name: String§task: StringTask tag: “asr”, “tts”, “ocr”, “vlm”.
description: Option<String>§license: StringThe WEIGHTS’ license — surfaced to users because it may be more
restrictive than FFai’s MIT/Apache code license.
hf_repo: Option<String>Hugging Face repo id, e.g. “openai/whisper-tiny”.
files: Vec<ModelFile>Implementations§
Source§impl ModelManifest
impl ModelManifest
pub fn from_toml(text: &str) -> Result<Self>
pub fn load(path: &Path) -> Result<Self>
Sourcepub fn cache_path(&self) -> PathBuf
pub fn cache_path(&self) -> PathBuf
Directory this model’s files live in when placed manually.
Sourcepub fn is_cached(&self) -> bool
pub fn is_cached(&self) -> bool
True when every listed file already resolves locally — no network.
Sourcepub fn local_path(&self, name: &str) -> Option<PathBuf>
pub fn local_path(&self, name: &str) -> Option<PathBuf>
Resolve one file without touching the network: a manual placement
under Self::cache_path wins, otherwise the shared Hugging Face
cache (the same one transformers/faster-whisper use, so a model
downloaded by either side is not downloaded twice).
Sourcepub fn fetch(&self) -> Result<ResolvedModel>
pub fn fetch(&self) -> Result<ResolvedModel>
Resolve every file, downloading from the Hugging Face hub as needed.
Downloads are cached, so this is cheap on repeat calls — but it is still network I/O the first time, which is why benchmarks warm the cache outside any timed region (see docs/benchmarking.md).
Trait Implementations§
Source§impl Clone for ModelManifest
impl Clone for ModelManifest
Source§fn clone(&self) -> ModelManifest
fn clone(&self) -> ModelManifest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelManifest
impl Debug for ModelManifest
Source§impl<'de> Deserialize<'de> for ModelManifest
impl<'de> Deserialize<'de> for ModelManifest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ModelManifest
impl RefUnwindSafe for ModelManifest
impl Send for ModelManifest
impl Sync for ModelManifest
impl Unpin for ModelManifest
impl UnsafeUnpin for ModelManifest
impl UnwindSafe for ModelManifest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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> ⓘ
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