Browse Source

Merge branch 'multi-dataset' of https://git.openi.org.cn/OpenI/aiforge into multi-dataset

tags/v1.22.6.2^2
zhoupzh 3 years ago
parent
commit
98b10977a8
5 changed files with 8 additions and 11 deletions
  1. +1
    -1
      models/attachment.go
  2. +5
    -2
      models/dataset.go
  3. +1
    -1
      routers/repo/cloudbrain.go
  4. +0
    -6
      routers/repo/dataset.go
  5. +1
    -1
      templates/repo/cloudbrain/trainjob/new.tmpl

+ 1
- 1
models/attachment.go View File

@@ -583,7 +583,7 @@ func AttachmentsByDatasetOption(datasets []int64, opts *SearchDatasetOptions) ([
}
if opts.UploadAttachmentByMe {
cond = cond.And(
builder.Eq{"attachment.uploader_id": opts.OwnerID},
builder.Eq{"attachment.uploader_id": opts.User.ID},
)
}



+ 5
- 2
models/dataset.go View File

@@ -249,6 +249,10 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond {
subCon = generateFilterCond(opts, subCon)
cond = cond.Or(subCon)
}
} else {
if opts.StarByMe {
cond = cond.And(builder.Eq{"dataset.id": -1})
}
}

return cond
@@ -282,7 +286,7 @@ func generateFilterCond(opts *SearchDatasetOptions, cond builder.Cond) builder.C
cond = cond.And(builder.Eq{"attachment.type": opts.CloudBrainType})
}
if opts.UploadAttachmentByMe {
cond = cond.And(builder.Eq{"attachment.uploader_id": opts.OwnerID})
cond = cond.And(builder.Eq{"attachment.uploader_id": opts.User.ID})
}

return cond
@@ -311,7 +315,6 @@ func SearchDatasetByCondition(opts *SearchDatasetOptions, cond builder.Cond) (Da
sess.Select(selectColumnsSql).Join("INNER", "repository", "repository.id = dataset.repo_id").
Join("INNER", "attachment", "attachment.dataset_id=dataset.id").
Where(cond).OrderBy(opts.SearchOrderBy.String())

if opts.PageSize > 0 {
sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize)
}


+ 1
- 1
routers/repo/cloudbrain.go View File

@@ -2270,7 +2270,7 @@ func getTrainJobCommand(form auth.CreateCloudBrainForm, fileNames string) (strin
}
}

param += " --dataset_list=" + fileNames
param += " --dataset_list='" + fileNames + "'"

command += "python /code/" + bootFile + param + " > " + cloudbrain.ModelMountPath + "/" + form.DisplayJobName + "-" + cloudbrain.LogFile



+ 0
- 6
routers/repo/dataset.go View File

@@ -415,14 +415,8 @@ func datasetMultiple(ctx *context.Context, opts *models.SearchDatasetOptions) {
cloudbrainType := ctx.QueryInt("type")
keyword := strings.Trim(ctx.Query("q"), " ")
orderBy := models.SearchOrderByRecentUpdated
var ownerID int64
if ctx.User != nil {
ownerID = ctx.User.ID
}

opts.Keyword = keyword
opts.SearchOrderBy = orderBy
opts.OwnerID = ownerID
opts.RecommendOnly = ctx.QueryBool("recommend")
opts.CloudBrainType = cloudbrainType
opts.ListOptions = models.ListOptions{


+ 1
- 1
templates/repo/cloudbrain/trainjob/new.tmpl View File

@@ -97,7 +97,7 @@
<svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg>
{{.i18n.Tr "cloudbrain.resource_cluster_openi"}}
</a>
<a class="item" href="{{.RepoLink}}/grampus/train-job/{{if.NPUEnabled}}npu{{else}}gpu{{end}}/create">
<a class="item" href="{{.RepoLink}}/grampus/train-job/npu/create">
<svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg>
{{.i18n.Tr "cloudbrain.resource_cluster_c2net"}}(Beta)
</a>


Loading…
Cancel
Save