Skip to content

Commit 5bdce1f

Browse files
committed
fix: python cmd relies on correct python path
1 parent a85f03b commit 5bdce1f

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

pkg/inference/backends/sglang/sglang.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,12 @@ func (s *sglang) GetRequiredMemoryForModel(_ context.Context, _ string, _ *infer
189189
return inference.RequiredMemory{}, ErrNotImplemented
190190
}
191191

192-
// pythonCmd creates an exec.Cmd that runs python3 with the given arguments.
192+
// pythonCmd creates an exec.Cmd that runs python with the given arguments.
193+
// It uses the configured pythonPath if available, otherwise falls back to "python3".
193194
func (s *sglang) pythonCmd(args ...string) *exec.Cmd {
194-
cmd := exec.Command("python3", args...)
195-
196-
// Override the actual binary path if we discovered a specific interpreter.
197-
if s.pythonPath != "" && s.pythonPath != "python3" {
198-
cmd.Path = s.pythonPath
195+
pythonBinary := "python3"
196+
if s.pythonPath != "" {
197+
pythonBinary = s.pythonPath
199198
}
200-
201-
return cmd
199+
return exec.Command(pythonBinary, args...)
202200
}

0 commit comments

Comments
 (0)