From 6f9fa32b4b4f9eea9b6ea1079a03950cd8623d4d Mon Sep 17 00:00:00 2001 From: SilasMarvin <19626586+SilasMarvin@users.noreply.github.com> Date: Sat, 6 Apr 2024 11:42:08 -0700 Subject: [PATCH] Add pointer cast --- llama-cpp-2/src/model.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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