Skip to content

Commit

Permalink
llama : add llama_model methods
Browse files Browse the repository at this point in the history
ggml-ci
  • Loading branch information
ggerganov committed Jan 6, 2025
1 parent e6e7c75 commit 53e61c6
Show file tree
Hide file tree
Showing 5 changed files with 337 additions and 342 deletions.
4 changes: 2 additions & 2 deletions src/llama-adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static bool llama_control_vector_init(struct llama_control_vector & cvec, const
cvec.tensors.reserve(hparams.n_layer);
cvec.tensors.push_back(nullptr); // there's never a tensor for layer 0
for (size_t il = 1; il < hparams.n_layer; il++) {
ggml_backend_buffer_type_t buft = llama_model_select_buft(model, il);
ggml_backend_buffer_type_t buft = model.select_buft(il);
ggml_context * ctx = ctx_for_buft(buft);
if (!ctx) {
LLAMA_LOG_ERROR("%s: failed to allocate context for control vector\n", __func__);
Expand Down Expand Up @@ -257,7 +257,7 @@ static void llama_lora_adapter_init_impl(struct llama_model & model, const char
}

// device buft and device ctx
auto * model_tensor = llama_model_get_tensor(model, name.c_str());
const auto * model_tensor = model.get_tensor( name.c_str());
if (!model_tensor) {
throw std::runtime_error("LoRA tensor '" + name + "' does not exist in base model");
}
Expand Down
Loading

0 comments on commit 53e61c6

Please sign in to comment.