Skip to content

Commit af1a7ba

Browse files
committed
Avoid shell interpolation when passing LoRA adapter paths
Signed-off-by: Rishi Jat <rishijat098@gmail.com>
1 parent 2577535 commit af1a7ba

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

pkg/lib/harness/llm-harness.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,20 @@ func (harness *LLMHarness) Start(modelPath string, loraPaths []string) (err erro
105105
}
106106
cmd = exec.Command("./llamafile.exe", args...)
107107
} else {
108-
loraArgs := ""
108+
args := []string{
109+
"--server",
110+
"--model", modelPath,
111+
"--host", harness.Host,
112+
"--port", fmt.Sprintf("%d", harness.Port),
113+
"--path", uiHome,
114+
"--gpu", "AUTO",
115+
"--nobrowser",
116+
"--unsecure",
117+
}
109118
for _, loraPath := range loraPaths {
110-
loraArgs += fmt.Sprintf(" --lora %s", loraPath)
119+
args = append(args, "--lora", loraPath)
111120
}
112-
cmd = exec.Command("sh", "-c",
113-
fmt.Sprintf("./llamafile --server --model %s --host %s --port %d --path %s --gpu AUTO --nobrowser --unsecure%s",
114-
modelPath, harness.Host, harness.Port, uiHome, loraArgs),
115-
)
121+
cmd = exec.Command("./llamafile", args...)
116122
}
117123

118124
cmd.Dir = harnessPath

0 commit comments

Comments
 (0)