diff --git a/llama-cpp-2/src/model.rs b/llama-cpp-2/src/model.rs index 7da0136c..a39e70e1 100644 --- a/llama-cpp-2/src/model.rs +++ b/llama-cpp-2/src/model.rs @@ -424,6 +424,7 @@ impl LlamaModel { acc + c.role.to_bytes().len() + c.content.to_bytes().len() }); let mut buff: Vec = vec![0_i8; message_length * 2]; + // Build our llama_cpp_sys_2 chat messages let chat: Vec = chat .iter() @@ -445,7 +446,7 @@ impl LlamaModel { chat.as_ptr(), chat.len(), add_ass, - buff.as_mut_ptr(), + buff.as_mut_ptr().cast::(), buff.len() as i32, ); // A buffer twice the size should be sufficient for all models, if this is not the case for a new model, we can increase it