Skip to content

Commit d110242

Browse files
Copilotericcurtin
andcommitted
Fix module import by using shellwords.Parse directly
Co-authored-by: ericcurtin <[email protected]>
1 parent a5df833 commit d110242

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/docker/model-runner/pkg/inference/scheduling"
2222
"github.com/docker/model-runner/pkg/metrics"
2323
"github.com/docker/model-runner/pkg/routing"
24-
"github.com/docker/model-runner/pkg/utils"
24+
"github.com/mattn/go-shellwords"
2525
"github.com/sirupsen/logrus"
2626
)
2727

@@ -255,7 +255,10 @@ func createLlamaCppConfigFromEnv() config.BackendConfig {
255255
}
256256

257257
// Split the string by spaces, respecting quoted arguments
258-
args := utils.SplitArgs(argsStr)
258+
args, err := shellwords.Parse(argsStr)
259+
if err != nil {
260+
log.Fatalf("Failed to parse LLAMA_ARGS: %v", err)
261+
}
259262

260263
// Check for disallowed arguments
261264
disallowedArgs := []string{"--model", "--host", "--embeddings", "--mmproj"}

0 commit comments

Comments
 (0)