Trait MmapEmbeddings

Source
pub trait MmapEmbeddings
where Self: Sized,
{ // Required method fn mmap_embeddings(read: &mut BufReader<File>) -> Result<Self>; }
Expand description

Memory-map finalfusion embeddings.

This trait is used to read finalfusion embeddings while memory mapping the embedding matrix. This leads to considerable memory savings, since the operating system will load the relevant pages from disk on demand.

Required Methods§

Source

fn mmap_embeddings(read: &mut BufReader<File>) -> Result<Self>

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.

Implementors§

Source§

impl<V, S> MmapEmbeddings for Embeddings<V, S>
where Self: Sized, V: ReadChunk, S: MmapChunk,