Skip to content

Commit

Permalink
fix: implicitly use c_char type instead of hardcoding i8
Browse files Browse the repository at this point in the history
  • Loading branch information
babichjacob committed Oct 10, 2024
1 parent 08d7495 commit 92bef3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llama-cpp-2/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ impl LlamaModel {
let message_length = chat.iter().fold(0, |acc, c| {
acc + c.role.to_bytes().len() + c.content.to_bytes().len()
});
let mut buff: Vec<i8> = vec![0_i8; message_length * 4];
let mut buff = vec![0; message_length * 4];

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

Please sign in to comment.