llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

Bug: export-lora does not accept GGUF files

Open suncloudsmoon opened this issue 1 year ago • 5 comments

What happened?

After the process of finetuning, a LoRA GGUF is created using convert_lora_to_gguf.py from transformers. After llama.cpp implemented support for LoRA conversion to GGUF in recent days, the same support hasn't seen extended to export-lora. When I am combining the LoRA GGUF with the base model GGUF, I get a GGML error (see below). This is the command that I used to export lora: !/usr/home/llamacpp/llama-export-lora -m /kaggle/working/base-model-f16.gguf -l /kaggle/working/trained-model/ggml-lora-f16.gguf -o /kaggle/working/full-model-finetune-f16.gguf.

Name and Version

version: 1 (a15ef8f) built with cc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 for x86_64-linux-gnu

What operating system are you seeing the problem on?

Linux

Relevant log output

error: unexpected lora header file magic in '/kaggle/working/trained-model/ggml-lora-f16.gguf

suncloudsmoon avatar Jul 19 '24 04:07 suncloudsmoon

Same error

polodealvarado avatar Jul 19 '24 12:07 polodealvarado

export-lora example is very out-dated and does not support gguf. It will be rewritten soon.

ngxson avatar Jul 20 '24 12:07 ngxson

@ngxson so what should we use for merging then? if I can't do llama-export-lora -l ggml-adapter-model.bin -o merged_model.f16.gguf -m <base model gguf> ?

markat1 avatar Jul 21 '24 19:07 markat1

@markat1 There is an example usage for on the README: https://github.com/ngxson/llama.cpp/blob/xsn/fix_lora_merge/examples/export-lora/README.md

ngxson avatar Jul 21 '24 20:07 ngxson