Skip to content

Commit

Permalink
Add pointer cast
Browse files Browse the repository at this point in the history
  • Loading branch information
SilasMarvin committed Apr 6, 2024
1 parent dcbcdd6 commit 6f9fa32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llama-cpp-2/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ impl LlamaModel {
acc + c.role.to_bytes().len() + c.content.to_bytes().len()
});
let mut buff: Vec<i8> = vec![0_i8; message_length * 2];

// Build our llama_cpp_sys_2 chat messages
let chat: Vec<llama_cpp_sys_2::llama_chat_message> = chat
.iter()
Expand All @@ -445,7 +446,7 @@ impl LlamaModel {
chat.as_ptr(),
chat.len(),
add_ass,
buff.as_mut_ptr(),
buff.as_mut_ptr().cast::<std::os::raw::c_char>(),
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
Expand Down

0 comments on commit 6f9fa32

Please sign in to comment.