Downloads · 30 days
26
4% of all-time downloads
Omarrran/gemma2_model_9B_q4_km
gemma2_model_9B_q4_km is a machine learning model from Omarrran. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
To know more about how to use llamacpp Inferenece mode see here : Link to llamacpp
Downloads · 30 days
26
4% of all-time downloads
All-time downloads
711
Public
Repo size
42.8 GB
Likes
0
Public
Click a slice to open those files.
.gguf24.3 GB · 57%
From the Hugging Face model README
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="Omarrran/gemma2_model_9B_q4_km",
filename="unsloth.Q4_K_M.gguf",
)
To know more about how to use llama_cpp Inferenece mode see here : Link to llama_cpp
This guide was originally part of the CPU LoRA guide. Check it out if you'd like to train a LoRA using your CPU!
To keep things simple, I recommend creating a single folder somewhere on your system to work out of. For example, C:\working-dir. I'll use this path in the examples below. If you use a different path, just make sure to adjust the commands.
w64devkit-fortran-x.xx.x.zip)C:\working-dir\w64devkit!!! info Once llama.cpp has been compiled, you don't need to repeat any of these steps unless you update to a newer version of llama.cpp. If you are updating, skip the first 2 steps.
cd C:\working-dirgit clone https://github.com/ggerganov/llama.cpp.gitcd llama.cpp.venv directory, delete it: rmdir .venv /s /qpython -m venv .venv.venv\Scripts\activate.bat (use .venv\Scripts\Activate.ps1 if you're using PowerShell)pip install -r requirements.txtpip install torchdeactivatecd ..w64devkit\w64devkit.exe~ $, move to the llama.cpp repo: cd C:/working-dir/llama.cpp (Make sure to use forward slashes!)make cleanmake all -jexitcd C:\working-dir\llama.cppgit pullcd ..This converts models to the GGUF format (FP32 or FP16). For quantized models, see the next section.
cd C:\working-dirgit clone https://huggingface.co/Sao10K/Stheno-L2-13B.git directory to save some hard drive space.llama.cpp\.venv\Scripts\activate.bat (use llama.cpp\.venv\Scripts\Activate.ps1 if you're using PowerShell)python llama.cpp\convert.py Stheno-L2-13B --outtype F32 --outfile Stheno-L2-13B.FP32.ggufdeactivateStep 6 uses FP32 format, you can also use FP16 format by changing --outtype to F16. Remember to update the file name for --outfile too!
!!! info Speed up convert.py by adding --concurrency N to step 5 above. Replace N with the number of physical CPU cores in your system.
This converts models to quantized GGUF formats (Q8_0, Q6_K, Q6_K_M, etc.). For FP32 and FP16 see the previous section.
cd C:\working-dirllama.cpp\quantize.exe Stheno-L2-13B.FP32.gguf Stheno-L2-13B.Q8_0.gguf Q8_0Obviously, step 4 needs to be customized to your conversion slightly. Change the FP32 to FP16 based on your conversion. Then change both of the Q8_0 items to the quantization format of your choice: Q8_0, Q6_K, Q5_K_M, Q5_K_S, Q4_K_M, Q4_K_S, Q3_K_L, Q3_K_M, Q3_K_S, or Q2_K. Make sure to update the model names too.
!!! info Speed up quantize.exe by adding the number of physical CPU cores in your system to the end of step 4's command (after the quantization format).
Ideally, we want to quantize our models with the default QKK setting as it's efficient. However, on rare occasions, you need to change the QKK setting to get it to work with some models. Basically, if you get an error when quantizing a model, try building quantize.exe with the LLAMA_QKK_64 flag set (e.g., make quantize -j LLAMA_QKK_64=1).
In order for LoRAs to work with llama.cpp (and its derivatives like koboldcpp), you need to convert them to GGUF format. If you trained a LoRA using llama.cpp, you don't need to do this as the LoRA is already in GGUF format.
cd C:\working-dirgit clone https://huggingface.co/Undi95/Storytelling-v2-13B-lora.git directory to save some hard drive space.llama.cpp\.venv\Scripts\activate.bat (use llama.cpp\.venv\Scripts\Activate.ps1 if you're using PowerShell)python llama.cpp\convert-lora-to-ggml.py Storytelling-v2-13B-loradeactivateIf you want to offload any layers to your GPU, you're going to want to merge your LoRA with the base model.
cd C:\working-dirllama.cpp\export-lora.exe --model-base Stheno-L2-13B.Q8_0.gguf --model-out Stheno-L2-Storytelling-13B.Q8_0.gguf --lora-scaled Storytelling-v2-13B-lora\ggml-adapter-model.bin 1.0Remember to update the file names to match your models and LoRAs. The 1.0 at the end specifies how strongly the LoRA should be applied, with 0.0 being not at all, 1.0 being 100%, 2.0 being 200%, and so on.
You can apply as many LoRAs as you want at once! Simply add more --lora-scaled path\to\lora.bin 1.0 commands for each LoRA you want to merge. The percentages do not need to add to 100%, they are applied individually.
!!! info Speed up export-lora.exe by adding --threads N to step 4 above. Replace N with the number of physical CPU cores in your system.
Q: How long does it take to convert/quantize/merge a model? A: It's system dependent, but generally less than a minute. Sometimes seconds.
Q: Do I need a GPU for this?/Can I make these faster if I have a GPU? A: No, you don't need a GPU. Some operations might be slightly faster using one, but it's not really worth the extra setup effort.