Skip to content

Commit 82c094a

Browse files
committed
fix(p2p): parse correctly ExtraLLamaCPPArgs
Previously we were sensible when args aren't defined and we would clash parsing extra args. Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 47dc433 commit 82c094a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/cli/worker/worker_p2p.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,14 @@ func (r *P2P) Run(ctx *cliContext.Context) error {
7676
"util",
7777
"llama-cpp-rpc-server",
7878
)
79-
extraArgs := strings.Split(r.ExtraLLamaCPPArgs, " ")
79+
var extraArgs []string
80+
81+
if r.ExtraLLamaCPPArgs != "" {
82+
extraArgs = strings.Split(r.ExtraLLamaCPPArgs, " ")
83+
}
8084
args := append([]string{"--host", address, "--port", fmt.Sprint(port)}, extraArgs...)
85+
log.Debug().Msgf("Starting llama-cpp-rpc-server on '%s:%d' with args: %+v (%d)", address, port, args, len(args))
86+
8187
args, grpcProcess = library.LoadLDSO(r.BackendAssetsPath, args, grpcProcess)
8288

8389
cmd := exec.Command(

0 commit comments

Comments
 (0)