Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.7.1
zouap 3 years ago
parent
commit
8f0464e69e
3 changed files with 18 additions and 15 deletions
  1. +0
    -3
      models/ai_model_manage.go
  2. +0
    -1
      routers/repo/ai_model_manage.go
  3. +18
    -11
      templates/repo/modelmanage/convertIndex.tmpl

+ 0
- 3
models/ai_model_manage.go View File

@@ -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())


+ 0
- 1
routers/repo/ai_model_manage.go View File

@@ -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)


+ 18
- 11
templates/repo/modelmanage/convertIndex.tmpl View File

@@ -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<n_length;i++){
file_html += `<div class="item" data-value="${data[i].FileName}">${data[i].FileName}</div>`
file_html += '</div>'
}
$("#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<n_length;i++){
file_html += `<div class="item" data-value="${data[i].FileName}">${data[i].FileName}</div>`
file_html += '</div>'
}
$("#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);


Loading…
Cancel
Save