Views
No views yet
| Quant Level | Perplexity Score | Standard Deviation |
|---|---|---|
| F32 | 7.1853 | 0.04922 |
| BF16 | 7.1853 | 0.04922 |
| Q8_0 | 7.1879 | 0.04924 |
| Q6_K | 7.2182 | 0.04948 |
| Q5_K_M | 7.2333 | 0.04953 |
| Q5_K_S | 7.2204 | 0.04931 |
| Q4_K_M | 7.4192 | 0.05149 |
| Q4_K_S | 7.5403 | 0.05231 |
| Q3_K_L | 7.4623 | 0.05128 |
| Q3_K_M | 7.7375 | 0.05362 |
| Q3_K_S | 8.0426 | 0.05546 |
1#!/bin/bash
2
3# Define MODEL_NAME above the loop
4MODEL_NAME="gemma-2-27b-it"
5
6# Define the output directory
7outputDir="${MODEL_NAME}-GGUF"
8
9# Create the output directory if it doesn't exist
10mkdir -p "${outputDir}"
11
12# Make the F32 quant
13f32file="${outputDir}/${MODEL_NAME}-F32.gguf"
14if [ -f "${f32file}" ]; then
15 echo "Skipping f32 as ${f32file} already exists."
16else
17 python convert_hf_to_gguf.py "~/src/models/${MODEL_NAME}" --outfile "${f32file}" --outtype "f32"
18fi
19
20# Abort out if the F32 didn't work
21if [ ! -f "${f32file}" ]; then
22 echo "No ${f32file} found."
23 exit 1
24fi
25
26# Define the array of quantization strings
27quants=("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")
28
29
30# Loop through the quants array
31for quant in "${quants[@]}"; do
32 outfile="${outputDir}/${MODEL_NAME}-${quant}.gguf"
33
34 # Check if the outfile already exists
35 if [ -f "${outfile}" ]; then
36 echo "Skipping ${quant} as ${outfile} already exists."
37 else
38 # Run the command with the current quant string
39 ./llama-quantize "${f32file}" "${outfile}" "${quant}"
40
41 echo "Processed ${quant} and generated ${outfile}"
42 fi
43done