Skip to main content

to_vec_token_sys

Function to_vec_token_sys 

Source
pub fn to_vec_token_sys(vec_llama: Vec<LlamaToken>) -> Vec<llama_token> 
Expand description

Converts a vector of LlamaToken to a vector of llama_token without memory allocation, and consumes the original vector. This conversion is safe because LlamaToken is repr(transparent), meaning it is just a wrapper around the raw llama_token type.

§Safety

This operation is safe because LlamaToken has a repr(transparent) attribute, ensuring that the memory layout of LlamaToken is the same as that of the underlying llama_token type.