Downloads · 30 days
30
7% of all-time downloads
simsvml/quant-repair-llama-3
quant-repair-llama-3 is a machine learning model from simsvml. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
LoRAs for improving the quality of quantized Llama 3 models.
Downloads · 30 days
30
7% of all-time downloads
All-time downloads
431
Public
Repo size
3.9 GB
Likes
1
Public
Click a slice to open those files.
.pt2.5 GB · 66%
From the Hugging Face model README
LoRAs for improving the quality of quantized Llama 3 models.
Each subdirectory in this repo has a LoRA for a specific model and quant. Each LoRA works only with the exact quantized GGUF file it was trained on. See the README in each directory for details.
cd quant-repair
# Install dependencies if needed:
pip3 install numpy
python3 combine_gguf.py lora.gguf model.gguf -o out.gguf
For combine_gguf.py, the LoRA GGUF must be the first input because the
script copies metadata entries from the first input.out.gguf file.Some subdirectories contain LoRAs that haven't finished training. These have
filenames like lora_ckpt17.gguf and come with a corresponding training
checkpoint lora_ckpt17.pt. If you have 24GB VRAM, you can continue the
training yourself:
Download the training checkpoint and quantized model GGUF.
Download the original model in safetensors format. This is used as a reference during training.
In the quant-repair repo, set up symlinks to the original and quantized
models. Check the config file for the checkpoint to find the correct paths.
The path given for orig_weights_safetensors_dir should be a symlink to the
directory containing the original model's safetensors file, and the path
given for quant_weights_gguf_path should be a symlink to the quantized
GGUF.
Alternatively, reconfigure the checkpoint with paths that are correct for your system. See the quant-repair README for instructions.
Install dependencies for the quant-repair training scripts:
cd quant-repair
pip3 install -r requirements.txt
cd ../llama.cpp/gguf-py
pip3 install .
Train:
cd quant-repair
python3 train_repair_lora2.py train lora.pt