Skip to main content

Hyperparameters

Trait Hyperparameters 

Source
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§

Source

fn read_ggml(reader: &mut dyn BufRead) -> Result<Self, LoadError>

Read the parameters in GGML format from a reader.

Source

fn write_ggml( &self, writer: &mut dyn Write, ) -> Result<(), HyperparametersWriteError>

Write the parameters in GGML format to a writer.

Source

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".

Implementors§