diff --git a/models/ai_model_manage.go b/models/ai_model_manage.go index 6db7aaebf..1048e9fec 100644 --- a/models/ai_model_manage.go +++ b/models/ai_model_manage.go @@ -125,10 +125,7 @@ func QueryModelById(id string) (*AiModelManage, error) { err := sess.Find(&aiModelManageList) if err == nil { if len(aiModelManageList) == 1 { - log.Info("return a model.") return aiModelManageList[0], nil - } else { - log.Info("11111") } } else { log.Info("error=" + err.Error()) diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index a948aeb2c..3db263d85 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -783,7 +783,6 @@ func QueryModelFileForPredict(ctx *context.Context) { id := ctx.Query("ID") model, err := models.QueryModelById(id) if err == nil { - log.Info("ddddddddddd") if model.Type == models.TypeCloudBrainTwo { prefix := model.Path[len(setting.Bucket)+1:] fileinfos, _ := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, prefix) diff --git a/templates/repo/modelmanage/convertIndex.tmpl b/templates/repo/modelmanage/convertIndex.tmpl index da7f8b404..007a95e3f 100644 --- a/templates/repo/modelmanage/convertIndex.tmpl +++ b/templates/repo/modelmanage/convertIndex.tmpl @@ -336,6 +336,7 @@ onChange:function(value){ $(".ui.dropdown.selection.search.width70").addClass("loading") $('#choice_version').dropdown('clear') + $('#choice_file').dropdown('clear') $("#model-version").empty() loadModelVersion(value) } @@ -375,17 +376,23 @@ } function loadModelFile(modelId){ console.log("modelId=" + modelId); - $.get(`${repolink}/modelmanage/query_modelfile_for_predict?ID=${modelId}`, (data) => { - const n_length = data.length - let file_html='' - for (let i=0;i${data[i].FileName}` - file_html += '' - } - $("#model-file").append(file_html) - $('#choice_file .default.text').text(data[0].FileName) - $('#choice_file input[name="ModelFile"]').val(data[0].FileName) - }) + if(modelId ==null || modelId ==""){ + $('#choice_file').dropdown('clear') + }else{ + $.get(`${repolink}/modelmanage/query_modelfile_for_predict?ID=${modelId}`, (data) => { + const n_length = data.length + let file_html='' + for (let i=0;i${data[i].FileName}` + file_html += '' + } + $("#model-file").append(file_html) + $('#choice_file .default.text').text(data[0].FileName) + $('#choice_file input[name="ModelFile"]').val(data[0].FileName) + }) + + } + } function loadModelVersion(value){ console.log("value=" + value);