Skip to content

Commit e491c85

Browse files
authored
Merge pull request #423 from doringeman/nit-vllm-warning
refactor(distribution): change unsupported format warning message
2 parents b6792c2 + dac5149 commit e491c85

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

pkg/distribution/distribution/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,8 @@ func checkCompat(image types.ModelArtifact, log *logrus.Entry, reference string,
509509
utils.SanitizeForLog(reference))
510510
} else if !slices.Contains(GetSupportedFormats(), config.Format) {
511511
// Write warning but continue with pull
512-
log.Warnf("vLLM backend currently only implemented for x86_64 Nvidia platforms")
513-
if err := progress.WriteWarning(progressWriter, ErrUnsupportedFormat.Error()); err != nil {
512+
log.Warnln(warnUnsupportedFormat)
513+
if err := progress.WriteWarning(progressWriter, warnUnsupportedFormat); err != nil {
514514
log.Warnf("Failed to write warning message: %v", err)
515515
}
516516
// Don't return an error - allow the pull to continue

pkg/distribution/distribution/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ func TestClientPullModel(t *testing.T) {
477477
if !strings.Contains(progressOutput, `"type":"warning"`) {
478478
t.Fatalf("Expected warning message on non-Linux platforms, got output: %s", progressOutput)
479479
}
480-
if !strings.Contains(progressOutput, "safetensors") {
480+
if !strings.Contains(progressOutput, warnUnsupportedFormat) {
481481
t.Fatalf("Expected warning about safetensors format, got output: %s", progressOutput)
482482
}
483483
}

pkg/distribution/distribution/errors.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var (
1616
"client supports only models of type %q and older - try upgrading",
1717
types.MediaTypeModelConfigV01,
1818
))
19-
ErrUnsupportedFormat = errors.New("vLLM backend currently only implemented for x86_64 Nvidia platforms")
20-
ErrConflict = errors.New("resource conflict")
19+
ErrConflict = errors.New("resource conflict")
2120
)
21+
22+
const warnUnsupportedFormat = "vLLM backend currently only implemented for x86_64 NVIDIA platforms"

0 commit comments

Comments
 (0)