Instructions to use simsvml/quant-repair-llama-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use simsvml/quant-repair-llama-3 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="simsvml/quant-repair-llama-3", filename="70b_instruct_iq2xxs/lora-ckpt20-Q8_0.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use simsvml/quant-repair-llama-3 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf simsvml/quant-repair-llama-3:Q8_0 # Run inference directly in the terminal: llama-cli -hf simsvml/quant-repair-llama-3:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf simsvml/quant-repair-llama-3:Q8_0 # Run inference directly in the terminal: llama-cli -hf simsvml/quant-repair-llama-3:Q8_0
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf simsvml/quant-repair-llama-3:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf simsvml/quant-repair-llama-3:Q8_0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf simsvml/quant-repair-llama-3:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf simsvml/quant-repair-llama-3:Q8_0
Use Docker
docker model run hf.co/simsvml/quant-repair-llama-3:Q8_0
- LM Studio
- Jan
- Ollama
How to use simsvml/quant-repair-llama-3 with Ollama:
ollama run hf.co/simsvml/quant-repair-llama-3:Q8_0
- Unsloth Studio new
How to use simsvml/quant-repair-llama-3 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for simsvml/quant-repair-llama-3 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for simsvml/quant-repair-llama-3 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for simsvml/quant-repair-llama-3 to start chatting
- Docker Model Runner
How to use simsvml/quant-repair-llama-3 with Docker Model Runner:
docker model run hf.co/simsvml/quant-repair-llama-3:Q8_0
- Lemonade
How to use simsvml/quant-repair-llama-3 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull simsvml/quant-repair-llama-3:Q8_0
Run and chat with the model
lemonade run user.quant-repair-llama-3-Q8_0
List all available models
lemonade list
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
LoRAs for improving the quality of quantized Llama 3 models.
LoRAs available
| WikiText | |||
|---|---|---|---|
| Model | PPL | KL-Div | Same top p |
| Llama 3 70B Instruct (baseline) | 5.282 | 0 | 100% |
| Llama 3 70B Instruct IQ2_XXS | 7.691 | 3.340 ร 10-1 | 79.3% |
| Llama 3 70B Instruct IQ2_M (without LoRA) | 7.765 | 3.430 ร 10-1 | 81.4% |
| Llama 3 70B Instruct IQ2_XS (without LoRA) | 9.320 | 5.502 ร 10-1 | 77.2% |
| Llama 3 70B Instruct IQ2_XXS (without LoRA) | 10.554 | 6.767 ร 10-1 | 73.8% |
How to use this
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.
- Choose a subdirectory and download its LoRA GGUF and the matching quantized model GGUF.
- Download the quant-repair scripts: https://github.com/simsvml/quant-repair
- Apply the LoRA to the model:
Forcd quant-repair # Install dependencies if needed: pip3 install numpy python3 combine_gguf.py lora.gguf model.gguf -o out.ggufcombine_gguf.py, the LoRA GGUF must be the first input because the script copies metadata entries from the first input. - Build the llama-with-lora branch of llama.cpp: https://github.com/simsvml/llama.cpp/tree/llama-with-lora
- Run llama.cpp as usual using the combined
out.gguffile.
Training from a checkpoint
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_dirshould be a symlink to the directory containing the original model's safetensors file, and the path given forquant_weights_gguf_pathshould 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
- Downloads last month
- 4
8-bit