将各个判断模型是否可用的逻辑和接口/api/v1/initialization/ollama/models/check的逻辑统一:对于没有指定版本的模型,默认添加":latest",避免误判导致反复调用pull模型接口

This commit is contained in:
fuyaozong
2025-11-13 10:29:47 +08:00
committed by lyingbug
parent 07c3453e1a
commit ef69e2aed5
2 changed files with 7 additions and 6 deletions
+1 -5
View File
@@ -556,11 +556,7 @@ func (h *InitializationHandler) CheckOllamaModels(c *gin.Context) {
// 检查每个模型是否存在
for _, modelName := range req.Models {
checkModelName := modelName
if !strings.Contains(modelName, ":") {
checkModelName = modelName + ":latest"
}
available, err := h.ollamaService.IsModelAvailable(ctx, checkModelName)
available, err := h.ollamaService.IsModelAvailable(ctx, modelName)
if err != nil {
logger.ErrorWithFields(ctx, err, map[string]interface{}{
"model_name": modelName,