Skip to content

Commit 6f9fa32

Browse files
committed
Add pointer cast
1 parent dcbcdd6 commit 6f9fa32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llama-cpp-2/src/model.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ impl LlamaModel {
424424
acc + c.role.to_bytes().len() + c.content.to_bytes().len()
425425
});
426426
let mut buff: Vec<i8> = vec![0_i8; message_length * 2];
427+
427428
// Build our llama_cpp_sys_2 chat messages
428429
let chat: Vec<llama_cpp_sys_2::llama_chat_message> = chat
429430
.iter()
@@ -445,7 +446,7 @@ impl LlamaModel {
445446
chat.as_ptr(),
446447
chat.len(),
447448
add_ass,
448-
buff.as_mut_ptr(),
449+
buff.as_mut_ptr().cast::<std::os::raw::c_char>(),
449450
buff.len() as i32,
450451
);
451452
// 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

0 commit comments

Comments
 (0)