Skip to content

Commit 9ac4b7b

Browse files
committed
Fix importance matrix requirement
1 parent 1f64092 commit 9ac4b7b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

quantize_weights_for_llama.cpp.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ ForEach ($repositoryName in $repositoryDirectories) {
8181
}
8282
}
8383

84-
# We do need to compute an importance matrix for some 2-bit quantized models:
84+
# We need to compute an importance matrix for all i-quants and
85+
# small k-quants to enhance the quality of the quantum models.
8586
# https://github.com/ggerganov/llama.cpp/tree/master/examples/imatrix
86-
$requiresImportanceMatrix = "IQ2_XXS IQ2_XS Q2_K_S".Contains($type)
87+
$requiresImportanceMatrix = $type.Contains("IQ") -or "Q2_K Q2_K_S".Contains($type)
8788

8889
if ($requiresImportanceMatrix -and !(Test-Path -Path $importanceMatrixPath)) {
8990

0 commit comments

Comments
 (0)