Skip to main content

decode_embedding_with_dim

Function decode_embedding_with_dim 

Source
pub fn decode_embedding_with_dim(bytes: &[u8], dims: usize) -> Result<Vec<f32>>
Expand description

Decode a stored vector that must have dims dimensions. Besides the binary format of encode_embedding, this reads the legacy format a JSON array of numbers (older daemon databases stored vectors that way). Any other blob, including binary of the wrong length, is an error.