diff --git a/internal/logic/inference/getadaptersbymodellogic.go b/internal/logic/inference/getadaptersbymodellogic.go index fe6a3c2b..fed1abde 100644 --- a/internal/logic/inference/getadaptersbymodellogic.go +++ b/internal/logic/inference/getadaptersbymodellogic.go @@ -38,7 +38,19 @@ func (l *GetAdaptersByModelLogic) GetAdaptersByModel(req *types.GetAdaptersByMod } for _, cluster := range clusters.List { - exist := l.svcCtx.Scheduler.AiService.InferenceAdapterMap[adapter.Id][cluster.Id].CheckModelExistence(l.ctx, req.ModelName, req.ModelType) + + cmap, found := l.svcCtx.Scheduler.AiService.InferenceAdapterMap[adapter.Id] + if !found { + continue + } + + iCluster, found := cmap[cluster.Id] + if !found { + continue + } + + exist := iCluster.CheckModelExistence(l.ctx, req.ModelName, req.ModelType) + if exist { c := &types.ClusterAvail{ ClusterId: cluster.Id,