Skip to content

Commit

Permalink
update llama.cpp to b2757
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Apr 29, 2024
1 parent e610ab9 commit a2fbc7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rllm/llama-cpp-low/llama.cpp
10 changes: 5 additions & 5 deletions rllm/llama-cpp-low/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ impl Default for ModelParams {
}

pub enum SplitMode {
None = llama_split_mode_LLAMA_SPLIT_NONE as isize,
None = llama_split_mode_LLAMA_SPLIT_MODE_NONE as isize,
/// split layers and KV across GPUs
Layer = llama_split_mode_LLAMA_SPLIT_LAYER as isize,
Layer = llama_split_mode_LLAMA_SPLIT_MODE_LAYER as isize,
/// split rows across GPUs
Row = llama_split_mode_LLAMA_SPLIT_ROW as isize,
Row = llama_split_mode_LLAMA_SPLIT_MODE_ROW as isize,
}

impl ModelParams {
Expand Down Expand Up @@ -170,8 +170,7 @@ impl Model {
pub fn from_file(file: &str, mparams: ModelParams) -> Result<Self> {
unsafe {
llama_log_set(Some(llama_log), std::ptr::null_mut());
let numa = false;
llama_backend_init(numa); // TODO: only call this once?
llama_backend_init();
let c = CString::new(file).unwrap();
let model = llama_load_model_from_file(c.as_ptr(), mparams);
if model == std::ptr::null_mut() {
Expand Down Expand Up @@ -242,6 +241,7 @@ impl Model {
token as i32,
res.as_mut_ptr() as *mut c_char,
res.len() as i32,
false,
)
});
if ntok < 0 {
Expand Down

0 comments on commit a2fbc7e

Please sign in to comment.