Skip to content

Commit c0325d2

Browse files
committed
Fix path to gguf_dump.py
2 parents 1c07628 + 44c688d commit c0325d2

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

Diff for: CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.23.0] - 2024-11-26
8+
9+
### Added
10+
- [Server] Add -additionalArguments option
11+
712
## [1.22.0] - 2024-10-14
813

914
### Removed

Diff for: examples/server.ps1

+36-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ Increases the verbosity of the llama.cpp server.
3434
.PARAMETER help
3535
Shows the manual on how to use this script.
3636
37+
.PARAMETER additionalArguments
38+
Adds additional arguments to the llama.cpp server that are not handled by this script.
39+
3740
.EXAMPLE
3841
.\server.ps1 -model "..\vendor\llama.cpp\models\gemma-2-9b-it-IQ4_XS.gguf"
3942
@@ -48,6 +51,9 @@ Shows the manual on how to use this script.
4851
4952
.EXAMPLE
5053
.\server.ps1 -model "..\vendor\llama.cpp\models\gemma-2-9b-it-IQ4_XS.gguf" -verbose
54+
55+
.EXAMPLE
56+
.\server.ps1 -model "..\vendor\llama.cpp\models\gemma-2-9b-it-IQ4_XS.gguf" -additionalArguments "--no-slots"
5157
#>
5258

5359
Param (
@@ -117,7 +123,11 @@ Param (
117123
$kvCacheDataType="f16",
118124

119125
[switch]
120-
$help
126+
$help,
127+
128+
[Parameter()]
129+
[String]
130+
$additionalArguments
121131
)
122132

123133
if ($help) {
@@ -302,7 +312,6 @@ Write-Host "Starting llama.cpp server with custom options at http://127.0.0.1:${
302312
$commandBinary = "${llamaCppPath}\build\bin\Release\llama-server"
303313

304314
$commandArguments = @(
305-
"--n-predict 1024",
306315
"--port '${port}'",
307316
"--model '${model}'",
308317
"--alias '${alias}'",
@@ -326,7 +335,32 @@ if ($verbose) {
326335
$commandArguments += "--verbose"
327336
}
328337

338+
# Include additional arguments if they are provided via the -additionalArguments parameter.
339+
$additionalArgumentParts = $additionalArguments -split '\s+'
340+
$index = 0
341+
while ($index -lt $additionalArgumentParts.Count) {
342+
343+
$argument = $additionalArgumentParts[$index]
344+
345+
$hasNextArgument = $index + 1 -lt $additionalArgumentParts.Count
346+
$nextArgumentIsValue = ($additionalArgumentParts[$index + 1] -notmatch '^-{1,2}')
347+
348+
if ($hasNextArgument -and $nextArgumentIsValue) {
349+
350+
# It's a key-value pair.
351+
$commandArguments += "$argument $($additionalArgumentParts[$index + 1])"
352+
$index += 2
353+
354+
} else {
355+
356+
# It's a standalone flag.
357+
$commandArguments += "$argument"
358+
$index += 1
359+
}
360+
}
361+
329362
$commandArguments = $commandArguments | ForEach-Object {
363+
330364
if ($commandArguments.IndexOf($_) -ne $commandArguments.Count - 1) {
331365
" $_ ```n"
332366
} else {

0 commit comments

Comments
 (0)