llama_lora_adapter_apply
This commit is contained in:
parent
4e28ad40a0
commit
1b4ffbac47
4 changed files with 115 additions and 135 deletions
|
@ -2063,13 +2063,14 @@ std::tuple<struct llama_model *, struct llama_context *> llama_init_from_gpt_par
|
|||
for (unsigned int i = 0; i < params.lora_adapter.size(); ++i) {
|
||||
const std::string & lora_adapter = std::get<0>(params.lora_adapter[i]);
|
||||
float lora_scale = std::get<1>(params.lora_adapter[i]);
|
||||
auto adapter = llama_lora_adapter_init(lctx, lora_adapter.c_str());
|
||||
auto adapter = llama_lora_adapter_init(lctx, lora_adapter.c_str(), lora_scale);
|
||||
if (adapter == nullptr) {
|
||||
fprintf(stderr, "%s: error: failed to apply lora adapter\n", __func__);
|
||||
llama_free(lctx);
|
||||
llama_free_model(model);
|
||||
return std::make_tuple(nullptr, nullptr);
|
||||
}
|
||||
llama_lora_adapter_apply(lctx, adapter);
|
||||
}
|
||||
|
||||
if (params.ignore_eos) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue