Skip to main content

encode_int8_embeddings

Function encode_int8_embeddings 

Source
pub fn encode_int8_embeddings(
    embeddings: &[f32],
    n: usize,
    dim: usize,
) -> Result<Vec<u8>>
Expand description

Encode the int8 embeddings section payload. Layout matches INT8_PAYLOAD_VERSION / INT8_SCALE_KIND_PER_VECTOR.

embeddings is n * dim row-major f32 values. Returns a buffer ready to write as the embeddings section (encoding = INT8).