pub struct ModelHelper {
pub context: String,
pub type_: String,
pub format: String,
pub source_gguf: String,
pub p64: String,
pub page_log2: u16,
pub layout: String,
pub converted_unix_ms: u64,
pub tokenizer: ModelHelperTokenizer,
pub notes: Vec<String>,
}Expand description
Behavioural + provenance metadata for a converted model package.
Fields§
§context: String§type_: String§format: String§source_gguf: String§p64: String§page_log2: u16§layout: String§converted_unix_ms: u64§tokenizer: ModelHelperTokenizer§notes: Vec<String>Implementations§
Source§impl ModelHelper
impl ModelHelper
pub fn new( source_gguf: impl Into<String>, p64_path: impl Into<String>, page_log2: u16, layout: impl Into<String>, tokenizer: ModelHelperTokenizer, ) -> Self
Sourcepub fn to_cbor_ld(&self) -> Result<Vec<u8>, String>
pub fn to_cbor_ld(&self) -> Result<Vec<u8>, String>
Interchange projection: encode as self-describe CBOR (tag 55799).
Sourcepub fn from_cbor_ld(bytes: &[u8]) -> Result<Self, String>
pub fn from_cbor_ld(bytes: &[u8]) -> Result<Self, String>
Interchange/migration projection: decode self-describe CBOR or a plain CBOR map.
Sourcepub fn write_beside_p64(&self, p64_path: &Path) -> Result<PathBuf, String>
pub fn write_beside_p64(&self, p64_path: &Path) -> Result<PathBuf, String>
Write {stem}.q42 as a canonical unified Q42 v3 volume.
Sourcepub fn load_beside_p64(p64_path: &Path) -> Result<Option<Self>, String>
pub fn load_beside_p64(p64_path: &Path) -> Result<Option<Self>, String>
Load the sibling canonical .q42; accept the former raw-CBOR name read-only.
Sourcepub fn apply_stops_to_tokenizer(&self, tok: &mut GgufTokenizer)
pub fn apply_stops_to_tokenizer(&self, tok: &mut GgufTokenizer)
Merge stop-token ids from this helper into a loaded tokenizer.
Trait Implementations§
Source§impl Clone for ModelHelper
impl Clone for ModelHelper
Source§fn clone(&self) -> ModelHelper
fn clone(&self) -> ModelHelper
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 ModelHelper
impl Debug for ModelHelper
Source§impl<'de> Deserialize<'de> for ModelHelper
impl<'de> Deserialize<'de> for ModelHelper
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ModelHelper
impl PartialEq for ModelHelper
Source§fn eq(&self, other: &ModelHelper) -> bool
fn eq(&self, other: &ModelHelper) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ModelHelper
impl Serialize for ModelHelper
impl StructuralPartialEq for ModelHelper
Auto Trait Implementations§
impl Freeze for ModelHelper
impl RefUnwindSafe for ModelHelper
impl Send for ModelHelper
impl Sync for ModelHelper
impl Unpin for ModelHelper
impl UnsafeUnpin for ModelHelper
impl UnwindSafe for ModelHelper
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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