mirror of
https://github.com/wassname/alpaca_convert.git
synced 2026-06-27 18:57:59 +08:00
3be75bb3db8eee8c0b24d47c0b41a44bd7f457e0
Alpaca Lora 4bit
Made some adjust for the code in peft and gptq for llama, and make it possible for lora finetuning with a 4 bits base model. The same adjustment can be made for 2, 3 and 8 bits.
Still numerically unstable. Resolved.
Reconstruct fp16 matrix from 4bit data and call torch.matmul largely increased the inference speed.
Requirements
gptq-for-llama: https://github.com/qwopqwop200/GPTQ-for-LLaMa
peft: https://github.com/huggingface/peft.git
Install
copy files from GPTQ-for-LLaMa into GPTQ-for-LLaMa path and re-compile cuda extension
copy files from peft/tuners/lora.py to peft path, replace it
Finetuning
The same finetune script from https://github.com/tloen/alpaca-lora can be used.
Description
Languages
Python
95.1%
Jupyter Notebook
4.9%