added support for lora base

This commit is contained in:
Concedo 2023-06-10 19:29:45 +08:00
parent 375540837e
commit 66a3f4e421
4 changed files with 30 additions and 8 deletions

View file

@ -31,6 +31,7 @@
//shared
std::string executable_path = "";
std::string lora_filename = "";
std::string lora_base = "";
bool generation_finished;
std::vector<std::string> generated_tokens;
@ -341,9 +342,15 @@ ModelLoadResult gpttype_load_model(const load_model_inputs inputs, FileFormat in
{
printf("\nAttempting to apply LORA adapter: %s\n", lora_filename.c_str());
const char * lora_base_arg = NULL;
if (lora_base != "") {
printf("Using LORA base model: %s\n", lora_base.c_str());
lora_base_arg = lora_base.c_str();
}
int err = llama_v2_apply_lora_from_file(llama_ctx_v2,
lora_filename.c_str(),
NULL,
lora_base_arg,
n_threads);
if (err != 0)
{