Skip to content

Commit b1bdd53

Browse files
committed
Add mmproj generation
1 parent 659b684 commit b1bdd53

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

quantize_weights_for_llama.cpp.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ 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"
5859

5960
if (!(Test-Path -Path $quantizedModelPath) -and !(Test-Path -Path $unquantizedModelPath)) {
6061

@@ -65,6 +66,16 @@ ForEach ($repositoryName in $repositoryDirectories) {
6566
'${sourceDirectoryPath}'"
6667
}
6768

69+
if (!(Test-Path -Path $multimodalProjectionPath)) {
70+
71+
Write-Host "Creating multimodal projection model from ${unquantizedModelPath} to ${multimodalProjectionPath}..." -ForegroundColor "DarkYellow"
72+
73+
Invoke-Expression "python ${llamaCppDirectory}\convert_hf_to_gguf.py ``
74+
--outfile '${multimodalProjectionPath}' ``
75+
'${sourceDirectoryPath}' ``
76+
--mmproj"
77+
}
78+
6879
# We are computing an importance matrix to enhance the quality of the models.
6980
# https://github.com/ggml-org/llama.cpp/tree/master/tools/imatrix
7081
if (!(Test-Path -Path $importanceMatrixPath)) {

0 commit comments

Comments
 (0)