Skip to content

Commit c771e94

Browse files
committed
fix(vllm): update model path handling to use directory for safetensors
1 parent bf8d9e7 commit c771e94

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pkg/inference/backends/vllm/vllm_config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package vllm
22

33
import (
44
"fmt"
5+
"path/filepath"
56
"strconv"
67

78
"github.com/docker/model-runner/pkg/distribution/types"
@@ -27,7 +28,7 @@ func (c *Config) GetArgs(bundle types.ModelBundle, socket string, mode inference
2728
args := append([]string{}, c.Args...)
2829

2930
// Add the serve command and model path (use directory for safetensors)
30-
modelPath := bundle.SafetensorsPath()
31+
modelPath := filepath.Dir(bundle.SafetensorsPath())
3132
if modelPath != "" {
3233
// vLLM expects the directory containing the safetensors files
3334
args = append(args, "serve", modelPath)

pkg/inference/backends/vllm/vllm_config_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func TestGetArgs(t *testing.T) {
5151
config: nil,
5252
expected: []string{
5353
"serve",
54-
"/path/to/model",
54+
"/path/to",
5555
"--uds",
5656
"/tmp/socket",
5757
},
@@ -66,7 +66,7 @@ func TestGetArgs(t *testing.T) {
6666
},
6767
expected: []string{
6868
"serve",
69-
"/path/to/model",
69+
"/path/to",
7070
"--uds",
7171
"/tmp/socket",
7272
"--max-model-len",
@@ -83,7 +83,7 @@ func TestGetArgs(t *testing.T) {
8383
},
8484
expected: []string{
8585
"serve",
86-
"/path/to/model",
86+
"/path/to",
8787
"--uds",
8888
"/tmp/socket",
8989
"--gpu-memory-utilization",
@@ -103,7 +103,7 @@ func TestGetArgs(t *testing.T) {
103103
},
104104
expected: []string{
105105
"serve",
106-
"/path/to/model",
106+
"/path/to",
107107
"--uds",
108108
"/tmp/socket",
109109
"--max-model-len",

0 commit comments

Comments
 (0)