Skip to content

Commit e78862f

Browse files
committed
Simplify conversion from hf to gguf
1 parent cc88b06 commit e78862f

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

quantize_weights_for_llama.cpp.ps1

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,26 +60,8 @@ ForEach ($repositoryName in $repositoryDirectories) {
6060

6161
Write-Host "Converting ${sourceDirectoryPath} to ${unquantizedModelPath}..." -ForegroundColor "DarkYellow"
6262

63-
$convertCommand = "python ${llamaCppDirectory}\convert.py"
64-
65-
$convertParameters = "--outfile `"${unquantizedModelPath}`" `"${sourceDirectoryPath}`""
66-
67-
# Some models have a Byte Pair Encoding (BPE) vocabulary type.
68-
if (@("Smaug-72B-v0.1").Contains($repositoryName)) {
69-
$convertParameters = "--vocab-type `"bpe`" --pad-vocab $convertParameters"
70-
}
71-
72-
Invoke-Expression "$convertCommand $convertParameters"
73-
74-
# Some model architectures have not yet been backported into
75-
# the official 'convert.py' script. We are assuming, that
76-
# novel model architectures (e.g., Phi-2) are implemented
77-
# in the 'convert-hf-to-gguf.py' script instead.
78-
if (!(Test-Path -Path $unquantizedModelPath)) {
79-
Write-Host "Conversion with 'convert.py' failed, trying 'convert-hf-to-gguf.py' instead..." -ForegroundColor "DarkYellow"
80-
$convertCommand = "python ${llamaCppDirectory}\convert-hf-to-gguf.py"
81-
Invoke-Expression "$convertCommand --outfile `"${unquantizedModelPath}`" `"${sourceDirectoryPath}`""
82-
}
63+
$convertCommand = "python ${llamaCppDirectory}\convert-hf-to-gguf.py"
64+
Invoke-Expression "$convertCommand --outfile `"${unquantizedModelPath}`" `"${sourceDirectoryPath}`""
8365
}
8466

8567
# We need to compute an importance matrix for all i-quants and

0 commit comments

Comments
 (0)