This commit is contained in:
jon-chuang 2023-04-26 23:33:24 +08:00
parent 7ffbcbdfa3
commit b80bc36ab0

View file

@ -2018,13 +2018,13 @@ int llama_apply_lora_from_file_internal(struct llama_context * ctx, const char *
ggml_tensor * loraB = lora_tensors[base_name + ".loraB"];
if (base_t->ne[0] != loraB->ne[1] || base_t->ne[1] != loraA->ne[1]) {
fprintf(stderr, "%s: incompatible tensor dimensions (outdims: %" PRId64 ", %" PRId64 ", indims: );"
" are you sure that this adapter is for this model?\n", __func__, base_t->ne[0], loraB->ne[1], base_t->ne[1], loraA->ne[1]);
fprintf(stderr, "%s: incompatible tensor dimensions (outdims: %" PRId64 ", %" PRId64 ", indims: %" PRId64 ", %" PRId64 ");"
" are you sure that this adapter is for this model?\n", __func__, base_t->ne[1], loraB->ne[1], base_t->ne[0], loraA->ne[1]);
return 1;
}
// w = w + BA*s
ggml_tensor * BA = ggml_mul_mat(lora_ctx, loraB, loraA);
ggml_tensor * BA = ggml_mul_mat(lora_ctx, loraA, loraB);
if (scaling != 1.0f) {
ggml_tensor * scale_tensor = ggml_new_f32(lora_ctx, scaling);