From 82c094a1c0053d960c22fe2bab89299049364031 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Thu, 21 Nov 2024 15:09:55 +0100 Subject: [PATCH] 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 --- core/cli/worker/worker_p2p.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/cli/worker/worker_p2p.go b/core/cli/worker/worker_p2p.go index 6275481b8fac..aa7a8f1abb9e 100644 --- a/core/cli/worker/worker_p2p.go +++ b/core/cli/worker/worker_p2p.go @@ -76,8 +76,14 @@ func (r *P2P) Run(ctx *cliContext.Context) error { "util", "llama-cpp-rpc-server", ) - extraArgs := strings.Split(r.ExtraLLamaCPPArgs, " ") + var extraArgs []string + + if r.ExtraLLamaCPPArgs != "" { + extraArgs = strings.Split(r.ExtraLLamaCPPArgs, " ") + } args := append([]string{"--host", address, "--port", fmt.Sprint(port)}, extraArgs...) + log.Debug().Msgf("Starting llama-cpp-rpc-server on '%s:%d' with args: %+v (%d)", address, port, args, len(args)) + args, grpcProcess = library.LoadLDSO(r.BackendAssetsPath, args, grpcProcess) cmd := exec.Command(