Skip to content

Commit 4aef449

Browse files
committed
Optimizing mmproj generation
1 parent b1bdd53 commit 4aef449

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

quantize_weights_for_llama.cpp.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ ForEach ($repositoryName in $repositoryDirectories) {
5555
ForEach ($type in $quantizationTypes) {
5656

5757
$quantizedModelPath = Join-Path -Path $targetDirectoryPath -ChildPath "${repositoryName}.${type}.gguf"
58-
$multimodalProjectionPath = Join-Path -Path $targetDirectoryPath -ChildPath "${repositoryName}.mmproj.gguf"
5958

6059
if (!(Test-Path -Path $quantizedModelPath) -and !(Test-Path -Path $unquantizedModelPath)) {
6160

@@ -66,12 +65,17 @@ ForEach ($repositoryName in $repositoryDirectories) {
6665
'${sourceDirectoryPath}'"
6766
}
6867

69-
if (!(Test-Path -Path $multimodalProjectionPath)) {
68+
$multimodalProjectorPath = Join-Path -Path $targetDirectoryPath -ChildPath "${repositoryName}.mmproj.F16.gguf"
7069

71-
Write-Host "Creating multimodal projection model from ${unquantizedModelPath} to ${multimodalProjectionPath}..." -ForegroundColor "DarkYellow"
70+
# We are computing a multimodal projector model in F16
71+
# format for each model to enable vision capabilities.
72+
if (!(Test-Path -Path $multimodalProjectorPath)) {
73+
74+
Write-Host "Creating multimodal projector model from ${unquantizedModelPath} to ${multimodalProjectorPath}..." -ForegroundColor "DarkYellow"
7275

7376
Invoke-Expression "python ${llamaCppDirectory}\convert_hf_to_gguf.py ``
74-
--outfile '${multimodalProjectionPath}' ``
77+
--outfile '${multimodalProjectorPath}' ``
78+
--outtype 'f16' ``
7579
'${sourceDirectoryPath}' ``
7680
--mmproj"
7781
}

0 commit comments

Comments
 (0)