This commit is contained in:
Ignasi 2025-03-06 15:24:31 +01:00 committed by Jacob Howard
parent e64f4a9343
commit 837da6d3a7
No known key found for this signature in database
GPG Key ID: 3E8B8F7FEB46FC66
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/docker/model-distribution/pkg/distribution"
"io"
"net/http"
@ -162,7 +163,7 @@ func (s *Scheduler) handleOpenAIInference(w http.ResponseWriter, r *http.Request
// Check if the shared model manager has the requested model available.
if !backend.UsesExternalModelManagement() {
if _, err := s.modelManager.GetModel(request.Model); err != nil {
if errors.Is(err, models.ErrModelNotFound) {
if errors.Is(err, distribution.ErrModelNotFound) {
http.Error(w, err.Error(), http.StatusNotFound)
} else {
http.Error(w, "model unavailable", http.StatusInternalServerError)