pub trait Hyperparameters:
Sized
+ Default
+ Debug {
// Required methods
fn read_ggml(reader: &mut dyn BufRead) -> Result<Self, LoadError>;
fn write_ggml(
&self,
writer: &mut dyn Write,
) -> Result<(), HyperparametersWriteError>;
fn n_vocabulary(&self) -> usize;
}
Expand description
Implemented by model hyperparameters for interacting with hyperparameters without knowing what they are, as well as writing/reading them as required.
Required Methods§
Sourcefn read_ggml(reader: &mut dyn BufRead) -> Result<Self, LoadError>
fn read_ggml(reader: &mut dyn BufRead) -> Result<Self, LoadError>
Read the parameters in GGML format from a reader.
Sourcefn write_ggml(
&self,
writer: &mut dyn Write,
) -> Result<(), HyperparametersWriteError>
fn write_ggml( &self, writer: &mut dyn Write, ) -> Result<(), HyperparametersWriteError>
Write the parameters in GGML format to a writer.
Sourcefn n_vocabulary(&self) -> usize
fn n_vocabulary(&self) -> usize
Get the number of tokens in the vocabulary.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.