Browse Source

merge

tags/v1.22.8.2^2
liuzx 3 years ago
parent
commit
dc219754e2
50 changed files with 1815 additions and 353 deletions
  1. +3
    -2
      models/cloudbrain.go
  2. +11
    -6
      models/dataset.go
  3. +88
    -0
      models/dataset_reference.go
  4. +1
    -0
      models/models.go
  5. +8
    -0
      modules/auth/dataset.go
  6. +1
    -1
      modules/cloudbrain/cloudbrain.go
  7. +8
    -1
      modules/cloudbrain/resty.go
  8. +43
    -0
      modules/context/permission_json.go
  9. +18
    -0
      modules/dataset/dataset.go
  10. +5
    -2
      modules/setting/repository.go
  11. +27
    -24
      modules/templates/helper.go
  12. +64
    -8
      options/locale/locale_en-US.ini
  13. +61
    -2
      options/locale/locale_zh-CN.ini
  14. +5
    -14
      routers/home.go
  15. +1
    -1
      routers/repo/cloudbrain.go
  16. +115
    -11
      routers/repo/dataset.go
  17. +23
    -8
      routers/repo/modelarts.go
  18. +10
    -1
      routers/routes/routes.go
  19. +19
    -0
      services/repository/dataset.go
  20. +10
    -10
      templates/custom/select_dataset_train.tmpl
  21. +2
    -1
      templates/repo/attachment/upload.tmpl
  22. +5
    -9
      templates/repo/cloudbrain/benchmark/new.tmpl
  23. +11
    -5
      templates/repo/cloudbrain/inference/new.tmpl
  24. +8
    -6
      templates/repo/cloudbrain/trainjob/new.tmpl
  25. +9
    -9
      templates/repo/cloudbrain/trainjob/show.tmpl
  26. +83
    -61
      templates/repo/datasets/index.tmpl
  27. +8
    -0
      templates/repo/datasets/reference.tmpl
  28. +5
    -3
      templates/repo/grampus/trainjob/gpu/new.tmpl
  29. +4
    -2
      templates/repo/grampus/trainjob/npu/new.tmpl
  30. +11
    -11
      templates/repo/grampus/trainjob/show.tmpl
  31. +1
    -1
      templates/repo/header.tmpl
  32. +5
    -4
      templates/repo/modelarts/inferencejob/new.tmpl
  33. +1
    -1
      templates/repo/modelarts/inferencejob/show.tmpl
  34. +1
    -1
      templates/repo/modelarts/notebook/show.tmpl
  35. +6
    -4
      templates/repo/modelarts/trainjob/edit_para.tmpl
  36. +4
    -2
      templates/repo/modelarts/trainjob/new.tmpl
  37. +12
    -12
      templates/repo/modelarts/trainjob/show.tmpl
  38. +4
    -2
      templates/repo/modelarts/trainjob/version_new.tmpl
  39. +28
    -29
      templates/repo/modelmanage/convertIndex.tmpl
  40. +11
    -11
      templates/repo/modelmanage/convertshowinfo.tmpl
  41. +18
    -19
      templates/repo/modelmanage/index.tmpl
  42. +2
    -2
      templates/repo/modelmanage/showinfo.tmpl
  43. +3
    -1
      web_src/js/components/MinioUploader.vue
  44. +20
    -14
      web_src/js/components/Model.vue
  45. +738
    -0
      web_src/js/components/dataset/referenceDataset.vue
  46. +38
    -24
      web_src/js/components/dataset/selectDataset.vue
  47. +17
    -10
      web_src/js/components/images/selectGrampusImages.vue
  48. +24
    -18
      web_src/js/components/images/selectImages.vue
  49. +200
    -0
      web_src/js/features/i18nVue.js
  50. +15
    -0
      web_src/js/index.js

+ 3
- 2
models/cloudbrain.go View File

@@ -8,13 +8,14 @@ import (
"strings" "strings"
"time" "time"


"code.gitea.io/gitea/modules/util"

"xorm.io/builder" "xorm.io/builder"
"xorm.io/xorm" "xorm.io/xorm"


"code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
) )


type CloudbrainStatus string type CloudbrainStatus string
@@ -142,7 +143,7 @@ type Cloudbrain struct {
VersionID int64 //版本id VersionID int64 //版本id
VersionName string `xorm:"INDEX"` //当前版本 VersionName string `xorm:"INDEX"` //当前版本
Uuid string //数据集id Uuid string //数据集id
DatasetName string
DatasetName string `xorm:"varchar(2000)"`
VersionCount int //任务的当前版本数量,不包括删除的 VersionCount int //任务的当前版本数量,不包括删除的
IsLatestVersion string //是否是最新版本,1是,0否 IsLatestVersion string //是否是最新版本,1是,0否
CommitID string //提交的仓库代码id CommitID string //提交的仓库代码id


+ 11
- 6
models/dataset.go View File

@@ -6,6 +6,8 @@ import (
"sort" "sort"
"strings" "strings"


"code.gitea.io/gitea/modules/setting"

"code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/log"


"code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/modules/timeutil"
@@ -178,7 +180,7 @@ type SearchDatasetOptions struct {
Category string Category string
Task string Task string
License string License string
DatasetIDs []int64 // 目前只在StarByMe为true时起作用
DatasetIDs []int64
ListOptions ListOptions
SearchOrderBy SearchOrderBy
IsOwner bool IsOwner bool
@@ -188,6 +190,7 @@ type SearchDatasetOptions struct {
JustNeedZipFile bool JustNeedZipFile bool
NeedAttachment bool NeedAttachment bool
UploadAttachmentByMe bool UploadAttachmentByMe bool
QueryReference bool
} }


func CreateDataset(dataset *Dataset) (err error) { func CreateDataset(dataset *Dataset) (err error) {
@@ -258,7 +261,7 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond {
} }
} }
if len(opts.DatasetIDs) > 0 { if len(opts.DatasetIDs) > 0 {
if opts.StarByMe {
if opts.StarByMe || (opts.RepoID == 0 && opts.QueryReference) {
cond = cond.And(builder.In("dataset.id", opts.DatasetIDs)) cond = cond.And(builder.In("dataset.id", opts.DatasetIDs))
} else { } else {
subCon := builder.NewCond() subCon := builder.NewCond()
@@ -329,13 +332,15 @@ func SearchDatasetByCondition(opts *SearchDatasetOptions, cond builder.Cond) (Da
return nil, 0, fmt.Errorf("Count: %v", err) return nil, 0, fmt.Errorf("Count: %v", err)
} }


sess.Select(selectColumnsSql).Join("INNER", "repository", "repository.id = dataset.repo_id").
builderQuery := builder.Dialect(setting.Database.Type).Select("id", "title", "status", "category", "description", "download_times", "license", "task", "release_id", "user_id", "repo_id", "created_unix", "updated_unix", "num_stars", "recommend", "use_count").From(builder.Dialect(setting.Database.Type).Select(selectColumnsSql).From("dataset").Join("INNER", "repository", "repository.id = dataset.repo_id").
Join("INNER", "attachment", "attachment.dataset_id=dataset.id"). Join("INNER", "attachment", "attachment.dataset_id=dataset.id").
Where(cond).OrderBy(opts.SearchOrderBy.String())
Where(cond), "d").OrderBy(opts.SearchOrderBy.String())

if opts.PageSize > 0 { if opts.PageSize > 0 {
sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize)
builderQuery.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize)
} }
if err = sess.Find(&datasets); err != nil {

if err = sess.SQL(builderQuery).Find(&datasets); err != nil {
return nil, 0, fmt.Errorf("Dataset: %v", err) return nil, 0, fmt.Errorf("Dataset: %v", err)
} }




+ 88
- 0
models/dataset_reference.go View File

@@ -0,0 +1,88 @@
package models

import (
"strconv"
"strings"

"code.gitea.io/gitea/modules/timeutil"
)

type DatasetReference struct {
ID int64 `xorm:"pk autoincr"`
RepoID int64 `xorm:"INDEX unique"`
DatasetID string `xorm:"TEXT"`
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
}

func GetDatasetIdsByRepoID(repoID int64) []int64 {
var datasets []int64
var datasetIds []string
_ = x.Table("dataset_reference").Where("repo_id=?", repoID).
Cols("dataset_reference.dataset_id").Find(&datasetIds)
if len(datasetIds) > 0 {
for _, datasetIdStr := range strings.Split(datasetIds[0], ",") {
datasetId, err := strconv.ParseInt(datasetIdStr, 10, 64)
if err != nil {
continue
}
datasets = append(datasets, datasetId)
}
}

return datasets
}

func HasReferenceDataset(repoID int64) bool {

var datasetIds []string
_ = x.Table("dataset_reference").Where("repo_id=?", repoID).
Cols("dataset_reference.dataset_id").Find(&datasetIds)
return len(datasetIds) > 0
}

func getReferenceDatasetStr(repoID int64) string {

var datasetIds []string
_ = x.Table("dataset_reference").Where("repo_id=?", repoID).
Cols("dataset_reference.dataset_id").Find(&datasetIds)
if len(datasetIds) > 0 {
return datasetIds[0]
}
return ""
}

func DeleteReferenceDatasetIdsByRepoID(repoID int64) error {

_, err := x.Exec("delete from dataset_reference where repo_id=?", repoID)
return err
}

func NewDatasetIdsByRepoID(repoID int64, datasetIds []int64) error {
if len(datasetIds) == 0 { //关联数据集数组为空
DeleteReferenceDatasetIdsByRepoID(repoID)
}
var datasetsStrArray []string
for _, datasetId := range datasetIds {
datasetsStrArray = append(datasetsStrArray, strconv.FormatInt(datasetId, 10))
}

newDatasetStr := strings.Join(datasetsStrArray, ",")
oldDatasetStr := getReferenceDatasetStr(repoID)
if newDatasetStr == oldDatasetStr { //关联数据集无变化,不需要处理
return nil
}
if oldDatasetStr != "" { //已经存在关联数据集
_, err := x.Exec("update dataset_reference set dataset_id=? where repo_id=?", newDatasetStr, repoID)

return err
} else {
datasetReference := DatasetReference{
DatasetID: newDatasetStr,
RepoID: repoID,
}

_, err := x.Insert(datasetReference)
return err
}

}

+ 1
- 0
models/models.go View File

@@ -146,6 +146,7 @@ func init() {
new(SearchRecord), new(SearchRecord),
new(AiModelConvert), new(AiModelConvert),
new(CloudbrainTemp), new(CloudbrainTemp),
new(DatasetReference),
) )


tablesStatistic = append(tablesStatistic, tablesStatistic = append(tablesStatistic,


+ 8
- 0
modules/auth/dataset.go View File

@@ -44,3 +44,11 @@ type EditAttachmentForm struct {
func (f *EditAttachmentForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { func (f *EditAttachmentForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale) return validate(errs, ctx.Data, f, ctx.Locale)
} }

type ReferenceDatasetForm struct {
DatasetID []int64 `binding:"Required"`
}

func (f *ReferenceDatasetForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}

+ 1
- 1
modules/cloudbrain/cloudbrain.go View File

@@ -82,7 +82,7 @@ type GenerateCloudBrainTaskReq struct {
} }


func GetCloudbrainDebugCommand() string { func GetCloudbrainDebugCommand() string {
var command = `pip3 install jupyterlab==3 -i https://pypi.tuna.tsinghua.edu.cn/simple;service ssh stop;jupyter lab --ServerApp.shutdown_no_activity_timeout=` + setting.CullIdleTimeout + ` --TerminalManager.cull_inactive_timeout=` + setting.CullIdleTimeout + ` --TerminalManager.cull_interval=` + setting.CullInterval + ` --MappingKernelManager.cull_idle_timeout=` + setting.CullIdleTimeout + ` --MappingKernelManager.cull_interval=` + setting.CullInterval + ` --MappingKernelManager.cull_connected=True --MappingKernelManager.cull_busy=True --no-browser --ip=0.0.0.0 --allow-root --notebook-dir="/code" --port=80 --ServerApp.token="" --ServerApp.allow_origin="self https://cloudbrain.pcl.ac.cn" `
var command = `pip3 install jupyterlab==3 -i https://pypi.tuna.tsinghua.edu.cn/simple;pip3 install -U "nbclassic>=0.2.8" -i https://pypi.tuna.tsinghua.edu.cn/simple;service ssh stop;jupyter lab --ServerApp.shutdown_no_activity_timeout=` + setting.CullIdleTimeout + ` --TerminalManager.cull_inactive_timeout=` + setting.CullIdleTimeout + ` --TerminalManager.cull_interval=` + setting.CullInterval + ` --MappingKernelManager.cull_idle_timeout=` + setting.CullIdleTimeout + ` --MappingKernelManager.cull_interval=` + setting.CullInterval + ` --MappingKernelManager.cull_connected=True --MappingKernelManager.cull_busy=True --no-browser --ip=0.0.0.0 --allow-root --notebook-dir="/code" --port=80 --ServerApp.token="" --LabApp.token="" --ServerApp.allow_origin="self https://cloudbrain.pcl.ac.cn" `
return command return command
} }




+ 8
- 1
modules/cloudbrain/resty.go View File

@@ -81,7 +81,8 @@ func GetQueuesDetail() (*map[string]int, error) {
var jobResult models.QueueDetailResult var jobResult models.QueueDetailResult


var result = make(map[string]int, 0) var result = make(map[string]int, 0)

retry := 0
sendjob:
res, err := client.R(). res, err := client.R().
SetHeader("Content-Type", "application/json"). SetHeader("Content-Type", "application/json").
SetAuthToken(TOKEN). SetAuthToken(TOKEN).
@@ -92,6 +93,12 @@ func GetQueuesDetail() (*map[string]int, error) {
return nil, fmt.Errorf("resty get queues detail failed: %s", err) return nil, fmt.Errorf("resty get queues detail failed: %s", err)
} }


if jobResult.Code == errInvalidToken && retry < 1 {
retry++
_ = loginCloudbrain()
goto sendjob
}

if jobResult.Code != Success { if jobResult.Code != Success {
return nil, fmt.Errorf("jobResult err: %s", res.String()) return nil, fmt.Errorf("jobResult err: %s", res.String())
} }


+ 43
- 0
modules/context/permission_json.go View File

@@ -0,0 +1,43 @@
package context

import (
"net/http"

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/log"
"gitea.com/macaron/macaron"
)

func RequireRepoReaderJson(unitType models.UnitType) macaron.Handler {
return func(ctx *Context) {
if !ctx.Repo.CanRead(unitType) {
if log.IsTrace() {
if ctx.IsSigned {
log.Trace("Permission Denied: User %-v cannot read %-v in Repo %-v\n"+
"User in Repo has Permissions: %-+v",
ctx.User,
unitType,
ctx.Repo.Repository,
ctx.Repo.Permission)
} else {
log.Trace("Permission Denied: Anonymous user cannot read %-v in Repo %-v\n"+
"Anonymous user in Repo has Permissions: %-+v",
unitType,
ctx.Repo.Repository,
ctx.Repo.Permission)
}
}
ctx.JSON(http.StatusOK, models.BaseErrorMessage(ctx.Tr("error.no_right")))
return
}
}
}

func RequireRepoWriterJson(unitType models.UnitType) macaron.Handler {
return func(ctx *Context) {
if !ctx.Repo.CanWrite(unitType) {
ctx.JSON(http.StatusOK, models.BaseErrorMessage(ctx.Tr("error.no_right")))
return
}
}
}

+ 18
- 0
modules/dataset/dataset.go View File

@@ -1,5 +1,7 @@
package dataset package dataset


import "code.gitea.io/gitea/models"

func GetResourceType(cloudbrainType int) string { func GetResourceType(cloudbrainType int) string {
if cloudbrainType == 0 { if cloudbrainType == 0 {
return "CPU/GPU" return "CPU/GPU"
@@ -15,3 +17,19 @@ func GetStatusText(isPrivate bool) string {
return "dataset.public" return "dataset.public"
} }
} }

func IsShowDataSetOfCurrentRepo(repoID int64) bool {
repo := models.Repository{
ID: repoID,
}

dataset, _ := models.GetDatasetByRepo(&repo)
if dataset != nil {
return true
}
if models.HasReferenceDataset(repoID) {
return false
}
return true

}

+ 5
- 2
modules/setting/repository.go View File

@@ -193,8 +193,9 @@ var (
Wiki: []string{"never"}, Wiki: []string{"never"},
}, },
} }
RepoRootPath string
ScriptType = "bash"
RepoRootPath string
RepoMaxReferenceDatasetNum int
ScriptType = "bash"
) )


func newRepository() { func newRepository() {
@@ -210,6 +211,8 @@ func newRepository() {
Repository.UseCompatSSHURI = sec.Key("USE_COMPAT_SSH_URI").MustBool() Repository.UseCompatSSHURI = sec.Key("USE_COMPAT_SSH_URI").MustBool()
Repository.MaxCreationLimit = sec.Key("MAX_CREATION_LIMIT").MustInt(-1) Repository.MaxCreationLimit = sec.Key("MAX_CREATION_LIMIT").MustInt(-1)
RepoRootPath = sec.Key("ROOT").MustString(path.Join(homeDir, "gitea-repositories")) RepoRootPath = sec.Key("ROOT").MustString(path.Join(homeDir, "gitea-repositories"))
RepoMaxReferenceDatasetNum = sec.Key("MAX_REF_DATASET_NUM").MustInt(20)

forcePathSeparator(RepoRootPath) forcePathSeparator(RepoRootPath)
if !filepath.IsAbs(RepoRootPath) { if !filepath.IsAbs(RepoRootPath) {
RepoRootPath = filepath.Join(AppWorkPath, RepoRootPath) RepoRootPath = filepath.Join(AppWorkPath, RepoRootPath)


+ 27
- 24
modules/templates/helper.go View File

@@ -97,23 +97,24 @@ func NewFuncMap() []template.FuncMap {
"AllowedReactions": func() []string { "AllowedReactions": func() []string {
return setting.UI.Reactions return setting.UI.Reactions
}, },
"AvatarLink": models.AvatarLink,
"Safe": Safe,
"SafeJS": SafeJS,
"Str2html": Str2html,
"subOne": subOne,
"TimeSince": timeutil.TimeSince,
"TimeSinceUnix": timeutil.TimeSinceUnix,
"TimeSinceUnix1": timeutil.TimeSinceUnix1,
"AttachmentResourceType": dataset.GetResourceType,
"AttachmentStatus": dataset.GetStatusText,
"TimeSinceUnixShort": timeutil.TimeSinceUnixShort,
"RawTimeSince": timeutil.RawTimeSince,
"FileSize": base.FileSize,
"PrettyNumber": base.PrettyNumber,
"Subtract": base.Subtract,
"EntryIcon": base.EntryIcon,
"MigrationIcon": MigrationIcon,
"AvatarLink": models.AvatarLink,
"Safe": Safe,
"SafeJS": SafeJS,
"Str2html": Str2html,
"subOne": subOne,
"TimeSince": timeutil.TimeSince,
"TimeSinceUnix": timeutil.TimeSinceUnix,
"TimeSinceUnix1": timeutil.TimeSinceUnix1,
"AttachmentResourceType": dataset.GetResourceType,
"AttachmentStatus": dataset.GetStatusText,
"IsShowDataSetOfCurrentRepo": dataset.IsShowDataSetOfCurrentRepo,
"TimeSinceUnixShort": timeutil.TimeSinceUnixShort,
"RawTimeSince": timeutil.RawTimeSince,
"FileSize": base.FileSize,
"PrettyNumber": base.PrettyNumber,
"Subtract": base.Subtract,
"EntryIcon": base.EntryIcon,
"MigrationIcon": MigrationIcon,
"Add": func(a, b int) int { "Add": func(a, b int) int {
return a + b return a + b
}, },
@@ -357,13 +358,15 @@ func NewTextFuncMap() []texttmpl.FuncMap {
"AppDomain": func() string { "AppDomain": func() string {
return setting.Domain return setting.Domain
}, },
"TimeSince": timeutil.TimeSince,
"TimeSinceUnix": timeutil.TimeSinceUnix,
"TimeSinceUnix1": timeutil.TimeSinceUnix1,
"TimeSinceUnixShort": timeutil.TimeSinceUnixShort,
"RawTimeSince": timeutil.RawTimeSince,
"AttachmentResourceType": dataset.GetResourceType,
"AttachmentStatus": dataset.GetStatusText,
"TimeSince": timeutil.TimeSince,
"TimeSinceUnix": timeutil.TimeSinceUnix,
"TimeSinceUnix1": timeutil.TimeSinceUnix1,
"TimeSinceUnixShort": timeutil.TimeSinceUnixShort,
"RawTimeSince": timeutil.RawTimeSince,
"AttachmentResourceType": dataset.GetResourceType,
"AttachmentStatus": dataset.GetStatusText,
"IsShowDataSetOfCurrentRepo": dataset.IsShowDataSetOfCurrentRepo,

"DateFmtLong": func(t time.Time) string { "DateFmtLong": func(t time.Time) string {
return t.Format(time.RFC1123Z) return t.Format(time.RFC1123Z)
}, },


+ 64
- 8
options/locale/locale_en-US.ini View File

@@ -98,6 +98,7 @@ error500= Sorry, the site has encountered some problems, we are trying to <stron
[error] [error]
occurred = An error has occurred occurred = An error has occurred
report_message = An error has occurred report_message = An error has occurred
no_right=You have no right to do the operation.


[install] [install]
install = Installation install = Installation
@@ -826,6 +827,7 @@ description_format_err=Description's length can be up to %s characters long.
create_dataset = Create Dataset create_dataset = Create Dataset
download_url=Download Url download_url=Download Url
download_oper=Operation download_oper=Operation
download_copy=Copy URL
create_dataset_fail=Failed to create dataset. create_dataset_fail=Failed to create dataset.
query_dataset_fail=Failed to query dataset. query_dataset_fail=Failed to query dataset.
edit_attachment_fail=Failed to update description. edit_attachment_fail=Failed to update description.
@@ -836,6 +838,8 @@ category = Category
no_category = No Category no_category = No Category
task = Task task = Task
no_task = No Task no_task = No Task
reference_dataset_fail=Failed to reference dataset, please try again later.
cancel_reference_dataset_fail=Failed to cancel reference dataset, please try again later.
license = License license = License
no_license = No License no_license = No License
file = Dataset File file = Dataset File
@@ -919,9 +923,10 @@ select_task = Select Research Direction/Application Area
dataset_name_tooltips = Please enter letters, numbers, _ and - up to 100 characters. dataset_name_tooltips = Please enter letters, numbers, _ and - up to 100 characters.
dataset_no_create = No dataset has been created yet dataset_no_create = No dataset has been created yet
dataset_explain = Dataset: CloudBrain I provides CPU/GPU resources, Cloudbrain II provides Ascend NPU resources, and the data set used for debugging also needs to be uploaded to the corresponding environment; dataset_explain = Dataset: CloudBrain I provides CPU/GPU resources, Cloudbrain II provides Ascend NPU resources, and the data set used for debugging also needs to be uploaded to the corresponding environment;
dataset_instructions_for_use = Instructions for use: You can refer to Qizhi AI Collaboration Platform
dataset_camp_course = Newcomer Training Camp Course;
dataset_instructions_for_use = Instructions for use: You can refer to Openi AI Collaboration Platform
dataset_camp_course = Newcomer Training Camp Course;
dataset_upload = Upload dataset_upload = Upload
dataset_upload_status= Upload Status
dataset_file_name = File Name dataset_file_name = File Name
dataset_available_clusters = Available Clusters dataset_available_clusters = Available Clusters
dataset_upload_time = Upload Time dataset_upload_time = Upload Time
@@ -948,6 +953,13 @@ unzip_failed=Unzip Failed
unzip_stared=Unzipping unzip_stared=Unzipping
unzip_status=Unzip Status unzip_status=Unzip Status
collection_num=Collection Nums collection_num=Collection Nums
current_dataset=Current Dataset
linked_dataset=Linked Dataset
unfavorite=Unlike
favorite=Like
disassociate=Disassociate
benchmark_dataset_tip=Note: first use the dataset function to upload the model, and then select the model from the dataset list.

[repo] [repo]
owner = Owner owner = Owner
repo_name = Repository Name repo_name = Repository Name
@@ -1197,7 +1209,7 @@ modelarts.infer_job_model_file = Model File
modelarts.infer_job = Inference Job modelarts.infer_job = Inference Job
modelarts.infer_job.model_version = Model/Version modelarts.infer_job.model_version = Model/Version
modelarts.infer_job.select_model = Select Model modelarts.infer_job.select_model = Select Model
modelarts.infer_job.boot_file_helper=The startup file is the entry file for your program execution and must end in.py.Such as inference.py, main.py, example/inference. Py, case/main.py.
modelarts.infer_job.boot_file_helper=The startup file is the entry file for your program execution and must end in.py.Such as inference.py, main.py, example/inference.py, case/main.py.
modelarts.infer_job.tooltip = The model has been deleted and cannot be viewed. modelarts.infer_job.tooltip = The model has been deleted and cannot be viewed.
modelarts.download_log=Download log file modelarts.download_log=Download log file


@@ -1209,7 +1221,7 @@ model_Evaluation_not_created = Model evaluation has not been created
repo_not_initialized = Code version: You have not initialized the code repository, please <a href="%s"> initialized </a> first ; repo_not_initialized = Code version: You have not initialized the code repository, please <a href="%s"> initialized </a> first ;
debug_task_running_limit =Running time: no more than 4 hours, it will automatically stop if it exceeds 4 hours; debug_task_running_limit =Running time: no more than 4 hours, it will automatically stop if it exceeds 4 hours;
dataset_desc = Dataset: Cloud Brain 1 provides CPU/GPU,Cloud Brain 2 provides Ascend NPU.And dataset also needs to be uploaded to the corresponding environment; dataset_desc = Dataset: Cloud Brain 1 provides CPU/GPU,Cloud Brain 2 provides Ascend NPU.And dataset also needs to be uploaded to the corresponding environment;
platform_instructions = Instructions for use: You can refer to the <a href="https://git.openi.org.cn/zeizei/OpenI_Learning">Xiaobai training camp </a> course of Qizhi AI collaboration platform.
platform_instructions = Instructions for use: You can refer to the <a href="https://git.openi.org.cn/zeizei/OpenI_Learning">Xiaobai training camp </a> course of Openi AI collaboration platform.
model_not_exist = Model file: You do not have a model file yet, please generate and <a href="%s/modelmanage/show_model">export the model</a> through the <a href="%s/modelarts/train-job">training task</a> first ; model_not_exist = Model file: You do not have a model file yet, please generate and <a href="%s/modelmanage/show_model">export the model</a> through the <a href="%s/modelarts/train-job">training task</a> first ;
benchmark_leaderboards = Benchmark leaderboards benchmark_leaderboards = Benchmark leaderboards


@@ -1220,7 +1232,7 @@ model.manage.version = Version
model.manage.label = Label model.manage.label = Label
model.manage.size = Size model.manage.size = Size
model.manage.create_time = Create Time model.manage.create_time = Create Time
model.manage.Description = Description
model.manage.description = Description
model.manage.Accuracy = Accuracy model.manage.Accuracy = Accuracy
model.manage.F1 = F1 model.manage.F1 = F1
model.manage.Precision = Precision model.manage.Precision = Precision
@@ -1232,6 +1244,49 @@ model.convert=Model Transformation
model.list=Model List model.list=Model List
model.manage.create_new_convert_task=Create Model Transformation Task model.manage.create_new_convert_task=Create Model Transformation Task


model.manage.notcreatemodel=No model has been created.
model.manage.init1=Code version: You have not initialized the code repository, please
model.manage.init2=initialized first ;
model.manage.createtrainjob_tip=Training task: you haven't created a training task, please create it first
model.manage.createtrainjob=Training task
model.manage.delete=Delete Model
model.manage.delete_confirm=Are you sure to delete this model? Once this model is deleted, it cannot be restored.
model.manage.select.trainjob=Select train task
model.manage.select.version=Select version
model.manage.engine=Model engine
model.manage.select.engine=Select model engine
model.manage.modelfile=Model file
model.manage.modellabel=Model label
model.manage.modeldesc=Model description
model.manage.baseinfo=Base Information
modelconvert.notcreate=No model conversion task has been created.
modelconvert.importfirst1=Please import first
modelconvert.importfirst2=download model
modelconvert.importfirst3=, then converts it.
modelconvert.download=Download
modelconvert.taskname=Task name
modelconvert.modelname=Model name
modelconvert.selectmodel=Select model
modelconvert.modelversion=Model version
modelconvert.selectversion=Select version
modelconvert.selectmodelfile=Select model file
modelconvert.taskstatus=Status
modelconvert.srcengine=Source model engine
modelconvert.outputformat=Output format
modelconvert.createtime=Created time
modelconvert.inputdataformat=Input data format
modelconvert.inputshape=Input tensor shape
modelconvert.inputshapetip=For example: 1,1,32,32, corresponding to the input data format.
modelconvert.netoutputdata=Network output data type
modelconvert.taskdesc=Task description
modelconvert.newtask=New
modelconvert.createtask=Create model transformation task
modelconvert.taskurlname=Model transformation task
log_scroll_start=Scroll to top
log_scroll_end=Scroll to bottom
modelconvert.tasknameempty=Please enter a task name.
modelconvert.inputshapeerror=Format input error, please input such as: 1,1,32,32, corresponding to the input data format.

modelconvert.manage.create_error1=A model transformation task with the same name already exists. modelconvert.manage.create_error1=A model transformation task with the same name already exists.
modelconvert.manage.create_error2=Only one running model transformation task can be created. modelconvert.manage.create_error2=Only one running model transformation task can be created.
modelconvert.manage.model_not_exist=The model does not exist. modelconvert.manage.model_not_exist=The model does not exist.
@@ -2328,7 +2383,7 @@ topic.count_prompt = You can not select more than 25 topics
topic.format_prompt = Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long. topic.format_prompt = Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
imagetopic.format_prompt = Topics can be up to 35 characters long. imagetopic.format_prompt = Topics can be up to 35 characters long.
use_repo_agreement=I promise that the content of this warehouse does not violate any national laws and regulations. During the use of the warehouse, I will abide by the OpenI community management regulations and platform usage rules, and will not conduct malicious attacks, mining, or any other illegal or disruptive platform order. Information release and related behaviors. For more information please refer to use_repo_agreement=I promise that the content of this warehouse does not violate any national laws and regulations. During the use of the warehouse, I will abide by the OpenI community management regulations and platform usage rules, and will not conduct malicious attacks, mining, or any other illegal or disruptive platform order. Information release and related behaviors. For more information please refer to
openi_use_agreement=OpenI Qizhi Community Platform Use Agreement.
openi_use_agreement=OpenI Openi Community Platform Use Agreement.
[org] [org]
org_name_holder = Organization Name org_name_holder = Organization Name
org_full_name_holder = Organization Full Name org_full_name_holder = Organization Full Name
@@ -3120,11 +3175,11 @@ specification = specification
select_specification = select specification select_specification = select specification
description = description description = description
wrong_specification=You cannot use this specification, please choose another item. wrong_specification=You cannot use this specification, please choose another item.
resource_use=Resource Occupancy


job_name_rule = Please enter letters, numbers, _ and - up to 64 characters and cannot end with a dash (-). job_name_rule = Please enter letters, numbers, _ and - up to 64 characters and cannot end with a dash (-).
train_dataset_path_rule = The dataset location is stored in the environment variable <strong style="color:#010101">data_url</strong>, and the output path is stored in the environment variable <strong style="color:#010101">train_url</strong>. train_dataset_path_rule = The dataset location is stored in the environment variable <strong style="color:#010101">data_url</strong>, and the output path is stored in the environment variable <strong style="color:#010101">train_url</strong>.
infer_dataset_path_rule = The dataset location is stored in the environment variable <strong style="color:#010101">data_url</strong>, and the output path is stored in the environment variable <strong style="color:#010101">train_url</strong>.
infer_dataset_path_rule = The dataset location is stored in the environment variable <strong style="color:#010101">data_url</strong>, and the output path is stored in the environment variable <strong style="color:#010101">result_url</strong>.
view_sample = View sample view_sample = View sample
inference_output_path_rule = The inference output path is stored in the environment variable result_url. inference_output_path_rule = The inference output path is stored in the environment variable result_url.
model_file_path_rule=The model file location is stored in the environment variable ckpt_url model_file_path_rule=The model file location is stored in the environment variable ckpt_url
@@ -3158,3 +3213,4 @@ load_code_failed=Fail to load code, please check if the right branch is selected


error.dataset_select = dataset select error:the count exceed the limit or has same name error.dataset_select = dataset select error:the count exceed the limit or has same name
new_train_gpu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the dataset is storaged in <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online new_train_gpu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the dataset is storaged in <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online
new_infer_gpu_tooltips = The dataset is stored in <strong style="color:#010101">%s</strong>, the model file is stored in <strong style="color:#010101">%s</strong>, please store the inference output in <strong style="color:#010101">%s</strong> for subsequent downloads.

+ 61
- 2
options/locale/locale_zh-CN.ini View File

@@ -99,6 +99,7 @@ error500=抱歉,站点遇到一些问题,我们正尝试<strong>修复网页
[error] [error]
occurred=发生错误 occurred=发生错误
report_message=发生错误 report_message=发生错误
no_right=您没有权限执行本操作。


[install] [install]
install=安装页面 install=安装页面
@@ -832,7 +833,12 @@ create_dataset=创建数据集
create_dataset_fail=创建数据集失败。 create_dataset_fail=创建数据集失败。
query_dataset_fail=查询数据集失败。 query_dataset_fail=查询数据集失败。
edit_attachment_fail=修改描述失败。 edit_attachment_fail=修改描述失败。

reference_dataset_fail=关联数据集失败,请稍后再试。
cancel_reference_dataset_fail=取消关联数据集失败,请稍后再试。

download_url=数据集下载地址 download_url=数据集下载地址
download_copy=复制链接
download_oper=操作 download_oper=操作
show_dataset=数据集 show_dataset=数据集
edit_dataset=编辑数据集 edit_dataset=编辑数据集
@@ -926,6 +932,7 @@ dataset_explain = 数据集:云脑1提供 CPU / GPU 资源,云脑2提供 Asc
dataset_instructions_for_use = 使用说明:可以参考启智AI协作平台 dataset_instructions_for_use = 使用说明:可以参考启智AI协作平台
dataset_camp_course = 小白训练营课程 dataset_camp_course = 小白训练营课程
dataset_upload = 上传 dataset_upload = 上传
dataset_upload_status = 上传状态
dataset_file_name = 文件名称 dataset_file_name = 文件名称
dataset_available_clusters = 可用集群 dataset_available_clusters = 可用集群
dataset_upload_time = 上传时间 dataset_upload_time = 上传时间
@@ -952,6 +959,13 @@ unzip_failed=解压失败
unzip_stared=解压中 unzip_stared=解压中
unzip_status=解压状态 unzip_status=解压状态
collection_num=收藏数量 collection_num=收藏数量
current_dataset=当前数据集
linked_dataset=关联数据集
unfavorite=取消收藏
favorite=收藏
disassociate=取消关联
benchmark_dataset_tip=说明:先使用数据集功能上传模型,然后从数据集列表选模型。

[repo] [repo]
owner=拥有者 owner=拥有者
repo_name=项目名称 repo_name=项目名称
@@ -1243,6 +1257,50 @@ model.convert=模型转换任务
model.list=模型列表 model.list=模型列表
model.manage.create_new_convert_task=创建模型转换任务 model.manage.create_new_convert_task=创建模型转换任务


model.manage.notcreatemodel=未创建过模型
model.manage.init1=代码版本:您还没有初始化代码仓库,请先
model.manage.init2=创建代码版本;
model.manage.createtrainjob_tip=训练任务:您还没创建过训练任务,请先创建
model.manage.createtrainjob=训练任务
model.manage.delete=删除模型
model.manage.delete_confirm=你确认删除该模型么?此模型一旦删除不可恢复。
model.manage.select.trainjob=选择训练任务
model.manage.select.version=选择版本
model.manage.engine=模型框架
model.manage.select.engine=选择模型框架
model.manage.modelfile=模型文件
model.manage.modellabel=模型标签
model.manage.modeldesc=模型描述
model.manage.baseinfo=基本信息
modelconvert.notcreate=未创建过模型转换任务
modelconvert.importfirst1=请您先导入
modelconvert.importfirst2=模型下载
modelconvert.importfirst3=,然后再对其进行转换。
modelconvert.download=下载
modelconvert.taskname=任务名称
modelconvert.modelname=模型名称
modelconvert.selectmodel=选择模型
modelconvert.modelversion=模型版本
modelconvert.selectversion=选择版本
modelconvert.selectmodelfile=选择模型文件
modelconvert.taskstatus=状态
modelconvert.srcengine=原模型框架
modelconvert.outputformat=转换后格式
modelconvert.createtime=创建时间
modelconvert.inputdataformat=输入数据格式
modelconvert.inputshape=输入张量形状
modelconvert.inputshapetip=如:1,1,32,32,与输入数据格式对应。
modelconvert.netoutputdata=网络输出数据类型
modelconvert.taskdesc=任务描述
modelconvert.newtask=新建任务
modelconvert.createtask=创建模型转换任务

modelconvert.taskurlname=模型转换任务
log_scroll_start=滚动到顶部
log_scroll_end=滚动到底部
modelconvert.tasknameempty=请输入任务名称。
modelconvert.inputshapeerror=格式输入错误,请输入如:1,1,32,32,与输入数据格式对应。

modelconvert.manage.create_error1=相同的名称模型转换任务已经存在。 modelconvert.manage.create_error1=相同的名称模型转换任务已经存在。
modelconvert.manage.create_error2=只能创建一个正在运行的模型转换任务。 modelconvert.manage.create_error2=只能创建一个正在运行的模型转换任务。
modelconvert.manage.model_not_exist=选择的模型不存在。 modelconvert.manage.model_not_exist=选择的模型不存在。
@@ -3138,7 +3196,7 @@ wrong_specification=您目前不能使用这个资源规格,请选择其他资


job_name_rule = 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。 job_name_rule = 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。
train_dataset_path_rule = 数据集位置存储在环境变量<strong style="color:#010101">data_url</strong>中,训练输出路径存储在环境变量<strong style="color:#010101">train_url</strong>中。 train_dataset_path_rule = 数据集位置存储在环境变量<strong style="color:#010101">data_url</strong>中,训练输出路径存储在环境变量<strong style="color:#010101">train_url</strong>中。
infer_dataset_path_rule = 数据集位置存储在环境变量<strong style="color:#010101">data_url</strong>中,推理输出路径存储在环境变量<strong style="color:#010101">train_url</strong>中。
infer_dataset_path_rule = 数据集位置存储在环境变量<strong style="color:#010101">data_url</strong>中,推理输出路径存储在环境变量<strong style="color:#010101">result_url</strong>中。
view_sample = 查看样例 view_sample = 查看样例
inference_output_path_rule = 推理输出路径存储在环境变量result_url中。 inference_output_path_rule = 推理输出路径存储在环境变量result_url中。
model_file_path_rule = 模型文件位置存储在环境变量ckpt_url中。 model_file_path_rule = 模型文件位置存储在环境变量ckpt_url中。
@@ -3148,7 +3206,7 @@ delete_task = 删除任务
task_delete_confirm = 你确认删除该任务么?此任务一旦删除不可恢复。 task_delete_confirm = 你确认删除该任务么?此任务一旦删除不可恢复。
operate_confirm = 确定操作 operate_confirm = 确定操作
operate_cancel = 取消操作 operate_cancel = 取消操作
resource_use=资源占用情况


gpu_num = GPU数 gpu_num = GPU数
cpu_num = CPU数 cpu_num = CPU数
@@ -3173,3 +3231,4 @@ load_code_failed=代码加载失败,请确认选择了正确的分支。


error.dataset_select = 数据集选择错误:数量超过限制或者有同名数据集 error.dataset_select = 数据集选择错误:数量超过限制或者有同名数据集
new_train_gpu_tooltips =训练脚本存储在<strong style="color:#010101">%s</strong>中,数据集存储在<strong style="color:#010101">%s</strong>中,训练输出请存储在<strong style="color:#010101">%s</strong>中以供后续下载。 new_train_gpu_tooltips =训练脚本存储在<strong style="color:#010101">%s</strong>中,数据集存储在<strong style="color:#010101">%s</strong>中,训练输出请存储在<strong style="color:#010101">%s</strong>中以供后续下载。
new_infer_gpu_tooltips = 数据集存储在<strong style="color:#010101">%s</strong>中,模型文件存储在<strong style="color:#010101">%s</strong>中,推理输出请存储在<strong style="color:#010101">%s</strong>中以供后续下载。

+ 5
- 14
routers/home.go View File

@@ -296,11 +296,10 @@ func ExploreDatasets(ctx *context.Context) {
// ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled // ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled


var ( var (
datasets []*models.Dataset
datasetsWithStar []*models.DatasetWithStar
count int64
err error
orderBy models.SearchOrderBy
datasets []*models.Dataset
count int64
err error
orderBy models.SearchOrderBy
) )
page := ctx.QueryInt("page") page := ctx.QueryInt("page")
if page <= 0 { if page <= 0 {
@@ -379,14 +378,6 @@ func ExploreDatasets(ctx *context.Context) {
ctx.ServerError("SearchDatasets", err) ctx.ServerError("SearchDatasets", err)
return return
} }
for _, dataset := range datasets {
if !ctx.IsSigned {
datasetsWithStar = append(datasetsWithStar, &models.DatasetWithStar{Dataset: *dataset, IsStaring: false})
} else {
datasetsWithStar = append(datasetsWithStar, &models.DatasetWithStar{Dataset: *dataset, IsStaring: models.IsDatasetStaring(ctx.User.ID, dataset.ID)})
}

}


pager := context.NewPagination(int(count), opts.PageSize, page, 5) pager := context.NewPagination(int(count), opts.PageSize, page, 5)
ctx.Data["Keyword"] = opts.Keyword ctx.Data["Keyword"] = opts.Keyword
@@ -397,7 +388,7 @@ func ExploreDatasets(ctx *context.Context) {
pager.SetDefaultParams(ctx) pager.SetDefaultParams(ctx)
ctx.Data["Page"] = pager ctx.Data["Page"] = pager


ctx.Data["Datasets"] = datasetsWithStar
ctx.Data["Datasets"] = repository.ConvertToDatasetWithStar(ctx, datasets)
ctx.Data["Total"] = count ctx.Data["Total"] = count
ctx.Data["PageIsDatasets"] = true ctx.Data["PageIsDatasets"] = true
ctx.HTML(200, tplExploreDataset) ctx.HTML(200, tplExploreDataset)


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

@@ -2718,7 +2718,7 @@ func getTrainJobCommand(form auth.CreateCloudBrainForm) (string, error) {
} }
} }


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


return command, nil return command, nil
} }


+ 115
- 11
routers/repo/dataset.go View File

@@ -9,6 +9,8 @@ import (
"strings" "strings"
"unicode/utf8" "unicode/utf8"


"code.gitea.io/gitea/services/repository"

"code.gitea.io/gitea/models" "code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/auth" "code.gitea.io/gitea/modules/auth"
"code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/base"
@@ -22,6 +24,7 @@ const (
tplDatasetCreate base.TplName = "repo/datasets/create" tplDatasetCreate base.TplName = "repo/datasets/create"
tplDatasetEdit base.TplName = "repo/datasets/edit" tplDatasetEdit base.TplName = "repo/datasets/edit"
taskstplIndex base.TplName = "repo/datasets/tasks/index" taskstplIndex base.TplName = "repo/datasets/tasks/index"
tplReference base.TplName = "repo/datasets/reference"
) )


// MustEnableDataset check if repository enable internal dataset // MustEnableDataset check if repository enable internal dataset
@@ -266,6 +269,37 @@ func CreateDatasetPost(ctx *context.Context, form auth.CreateDatasetForm) {
ctx.JSON(http.StatusOK, models.BaseOKMessage) ctx.JSON(http.StatusOK, models.BaseOKMessage)
} }


}
func ReferenceDatasetDelete(ctx *context.Context) {
repoID := ctx.Repo.Repository.ID
datasetId, _ := strconv.ParseInt(ctx.Params(":id"), 10, 64)

oldDatasetIds := models.GetDatasetIdsByRepoID(repoID)

var newDatasetIds []int64

for _, tempDatasetId := range oldDatasetIds {
if datasetId != tempDatasetId {
newDatasetIds = append(newDatasetIds, tempDatasetId)
}
}
err := models.NewDatasetIdsByRepoID(repoID, newDatasetIds)
if err != nil {
ctx.JSON(http.StatusOK, models.BaseErrorMessage("dataset.cancel_reference_dataset_fail"))
}
ctx.JSON(http.StatusOK, models.BaseOKMessage)

}

func ReferenceDatasetPost(ctx *context.Context, form auth.ReferenceDatasetForm) {
repoID := ctx.Repo.Repository.ID
err := models.NewDatasetIdsByRepoID(repoID, form.DatasetID)
if err != nil {
ctx.JSON(http.StatusOK, models.BaseErrorMessage("dataset.reference_dataset_fail"))
}

ctx.JSON(http.StatusOK, models.BaseOKMessage)

} }


func EditDatasetPost(ctx *context.Context, form auth.EditDatasetForm) { func EditDatasetPost(ctx *context.Context, form auth.EditDatasetForm) {
@@ -412,18 +446,17 @@ func MyDatasets(ctx *context.Context) {


func datasetMultiple(ctx *context.Context, opts *models.SearchDatasetOptions) { func datasetMultiple(ctx *context.Context, opts *models.SearchDatasetOptions) {
page := ctx.QueryInt("page") page := ctx.QueryInt("page")
cloudbrainType := ctx.QueryInt("type")
keyword := strings.Trim(ctx.Query("q"), " ") keyword := strings.Trim(ctx.Query("q"), " ")
orderBy := models.SearchOrderByRecentUpdated
opts.Keyword = keyword opts.Keyword = keyword
opts.SearchOrderBy = orderBy
if opts.SearchOrderBy.String() == "" {
opts.SearchOrderBy = models.SearchOrderByRecentUpdated
}

opts.RecommendOnly = ctx.QueryBool("recommend") opts.RecommendOnly = ctx.QueryBool("recommend")
opts.CloudBrainType = cloudbrainType
opts.ListOptions = models.ListOptions{ opts.ListOptions = models.ListOptions{
Page: page, Page: page,
PageSize: setting.UI.DatasetPagingNum, PageSize: setting.UI.DatasetPagingNum,
} }
opts.NeedAttachment = true
opts.JustNeedZipFile = true opts.JustNeedZipFile = true
opts.User = ctx.User opts.User = ctx.User


@@ -449,22 +482,52 @@ func datasetMultiple(ctx *context.Context, opts *models.SearchDatasetOptions) {
"data": string(data), "data": string(data),
"count": strconv.FormatInt(count, 10), "count": strconv.FormatInt(count, 10),
}) })

} }


func CurrentRepoDatasetMultiple(ctx *context.Context) { func CurrentRepoDatasetMultiple(ctx *context.Context) {

datasetIds := models.GetDatasetIdsByRepoID(ctx.Repo.Repository.ID)
searchOrderBy := getSearchOrderByInValues(datasetIds)
opts := &models.SearchDatasetOptions{ opts := &models.SearchDatasetOptions{
RepoID: ctx.Repo.Repository.ID,
RepoID: ctx.Repo.Repository.ID,
NeedAttachment: true,
CloudBrainType: ctx.QueryInt("type"),
DatasetIDs: datasetIds,
SearchOrderBy: searchOrderBy,
} }

datasetMultiple(ctx, opts) datasetMultiple(ctx, opts)


} }


func getSearchOrderByInValues(datasetIds []int64) models.SearchOrderBy {
if len(datasetIds) == 0 {
return ""
}
searchOrderBy := "CASE id "
for i, id := range datasetIds {
searchOrderBy += fmt.Sprintf(" WHEN %d THEN %d", id, i+1)
}
searchOrderBy += " ELSE 0 END"
return models.SearchOrderBy(searchOrderBy)
}

func MyDatasetsMultiple(ctx *context.Context) { func MyDatasetsMultiple(ctx *context.Context) {


opts := &models.SearchDatasetOptions{ opts := &models.SearchDatasetOptions{
UploadAttachmentByMe: true, UploadAttachmentByMe: true,
NeedAttachment: true,
CloudBrainType: ctx.QueryInt("type"),
}
datasetMultiple(ctx, opts)

}

func ReferenceDatasetAvailable(ctx *context.Context) {

opts := &models.SearchDatasetOptions{
PublicOnly: true,
NeedAttachment: false,
CloudBrainType: models.TypeCloudBrainAll,
} }
datasetMultiple(ctx, opts) datasetMultiple(ctx, opts)


@@ -473,7 +536,9 @@ func MyDatasetsMultiple(ctx *context.Context) {
func PublicDatasetMultiple(ctx *context.Context) { func PublicDatasetMultiple(ctx *context.Context) {


opts := &models.SearchDatasetOptions{ opts := &models.SearchDatasetOptions{
PublicOnly: true,
PublicOnly: true,
NeedAttachment: true,
CloudBrainType: ctx.QueryInt("type"),
} }
datasetMultiple(ctx, opts) datasetMultiple(ctx, opts)


@@ -482,11 +547,50 @@ func PublicDatasetMultiple(ctx *context.Context) {
func MyFavoriteDatasetMultiple(ctx *context.Context) { func MyFavoriteDatasetMultiple(ctx *context.Context) {


opts := &models.SearchDatasetOptions{ opts := &models.SearchDatasetOptions{
StarByMe: true,
DatasetIDs: models.GetDatasetIdsStarByUser(ctx.User.ID),
StarByMe: true,
DatasetIDs: models.GetDatasetIdsStarByUser(ctx.User.ID),
NeedAttachment: true,
CloudBrainType: ctx.QueryInt("type"),
} }
datasetMultiple(ctx, opts) datasetMultiple(ctx, opts)
} }
func ReferenceDataset(ctx *context.Context) {
MustEnableDataset(ctx)
ctx.Data["PageIsDataset"] = true
ctx.Data["MaxReferenceDatasetNum"] = setting.RepoMaxReferenceDatasetNum
ctx.Data["CanWrite"] = ctx.Repo.CanWrite(models.UnitTypeDatasets)
ctx.HTML(200, tplReference)

}

func ReferenceDatasetData(ctx *context.Context) {
MustEnableDataset(ctx)
datasetIds := models.GetDatasetIdsByRepoID(ctx.Repo.Repository.ID)
var datasets models.DatasetList
var err error
if len(datasetIds) > 0 {

opts := &models.SearchDatasetOptions{
DatasetIDs: datasetIds,
NeedAttachment: false,
CloudBrainType: models.TypeCloudBrainAll,
ListOptions: models.ListOptions{
Page: 1,
PageSize: setting.RepoMaxReferenceDatasetNum,
},
SearchOrderBy: getSearchOrderByInValues(datasetIds),
QueryReference: true,
}
datasets, _, err = models.SearchDataset(opts)
if err != nil {
ctx.ServerError("SearchDatasets", err)
return
}
}

ctx.JSON(http.StatusOK, repository.ConvertToDatasetWithStar(ctx, datasets))

}


func PublicDataset(ctx *context.Context) { func PublicDataset(ctx *context.Context) {
page := ctx.QueryInt("page") page := ctx.QueryInt("page")


+ 23
- 8
routers/repo/modelarts.go View File

@@ -2066,13 +2066,6 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference
gitRepo, _ := git.OpenRepository(repo.RepoPath()) gitRepo, _ := git.OpenRepository(repo.RepoPath())
commitID, _ := gitRepo.GetBranchCommitID(branchName) commitID, _ := gitRepo.GetBranchCommitID(branchName)


_, dataUrl, datasetNames, _, err := getDatasUrlListByUUIDS(uuid)
if err != nil {
inferenceJobErrorNewDataPrepare(ctx, form)
ctx.RenderWithErr(ctx.Tr(errStr), tplModelArtsInferenceJobNew, &form)
return
}

if err := downloadCode(repo, codeLocalPath, branchName); err != nil { if err := downloadCode(repo, codeLocalPath, branchName); err != nil {
log.Error("Create task failed, server timed out: %s (%v)", repo.FullName(), err) log.Error("Create task failed, server timed out: %s (%v)", repo.FullName(), err)
inferenceJobErrorNewDataPrepare(ctx, form) inferenceJobErrorNewDataPrepare(ctx, form)
@@ -2111,6 +2104,28 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference
Label: modelarts.CkptUrl, Label: modelarts.CkptUrl,
Value: "s3:/" + ckptUrl, Value: "s3:/" + ckptUrl,
}) })

datasUrlList, dataUrl, datasetNames, isMultiDataset, err := getDatasUrlListByUUIDS(uuid)
if err != nil {
inferenceJobErrorNewDataPrepare(ctx, form)
ctx.RenderWithErr(ctx.Tr(errStr), tplModelArtsInferenceJobNew, &form)
return
}
dataPath := dataUrl
jsondatas, err := json.Marshal(datasUrlList)
if err != nil {
log.Error("Failed to Marshal: %v", err)
inferenceJobErrorNewDataPrepare(ctx, form)
ctx.RenderWithErr("json error:"+err.Error(), tplModelArtsInferenceJobNew, &form)
return
}
if isMultiDataset {
param = append(param, models.Parameter{
Label: modelarts.MultiDataUrl,
Value: string(jsondatas),
})
}

existDeviceTarget := false existDeviceTarget := false
if len(params) != 0 { if len(params) != 0 {
err := json.Unmarshal([]byte(params), &parameters) err := json.Unmarshal([]byte(params), &parameters)
@@ -2143,7 +2158,7 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference
req := &modelarts.GenerateInferenceJobReq{ req := &modelarts.GenerateInferenceJobReq{
JobName: jobName, JobName: jobName,
DisplayJobName: displayJobName, DisplayJobName: displayJobName,
DataUrl: dataUrl,
DataUrl: dataPath,
Description: description, Description: description,
CodeObsPath: codeObsPath, CodeObsPath: codeObsPath,
BootFileUrl: codeObsPath + bootFile, BootFileUrl: codeObsPath + bootFile,


+ 10
- 1
routers/routes/routes.go View File

@@ -676,6 +676,9 @@ func RegisterRoutes(m *macaron.Macaron) {
reqRepoIssuesOrPullsReader := context.RequireRepoReaderOr(models.UnitTypeIssues, models.UnitTypePullRequests) reqRepoIssuesOrPullsReader := context.RequireRepoReaderOr(models.UnitTypeIssues, models.UnitTypePullRequests)
reqRepoDatasetReader := context.RequireRepoReader(models.UnitTypeDatasets) reqRepoDatasetReader := context.RequireRepoReader(models.UnitTypeDatasets)
reqRepoDatasetWriter := context.RequireRepoWriter(models.UnitTypeDatasets) reqRepoDatasetWriter := context.RequireRepoWriter(models.UnitTypeDatasets)
reqRepoDatasetReaderJson := context.RequireRepoReaderJson(models.UnitTypeDatasets)
reqRepoDatasetWriterJson := context.RequireRepoWriterJson(models.UnitTypeDatasets)

reqRepoCloudBrainReader := context.RequireRepoReader(models.UnitTypeCloudBrain) reqRepoCloudBrainReader := context.RequireRepoReader(models.UnitTypeCloudBrain)
reqRepoCloudBrainWriter := context.RequireRepoWriter(models.UnitTypeCloudBrain) reqRepoCloudBrainWriter := context.RequireRepoWriter(models.UnitTypeCloudBrain)
reqRepoModelManageReader := context.RequireRepoReader(models.UnitTypeModelManage) reqRepoModelManageReader := context.RequireRepoReader(models.UnitTypeModelManage)
@@ -1032,10 +1035,14 @@ func RegisterRoutes(m *macaron.Macaron) {


m.Group("/datasets", func() { m.Group("/datasets", func() {
m.Get("", reqRepoDatasetReader, repo.DatasetIndex) m.Get("", reqRepoDatasetReader, repo.DatasetIndex)
m.Get("/reference_datasets", reqRepoDatasetReader, repo.ReferenceDataset)
m.Get("/reference_datasets_data", reqRepoDatasetReaderJson, repo.ReferenceDatasetData)
m.Delete("/reference_datasets/:id", reqRepoDatasetWriterJson, repo.ReferenceDatasetDelete)
m.Put("/:id/:action", reqRepoDatasetReader, repo.DatasetAction) m.Put("/:id/:action", reqRepoDatasetReader, repo.DatasetAction)
m.Get("/create", reqRepoDatasetWriter, repo.CreateDataset) m.Get("/create", reqRepoDatasetWriter, repo.CreateDataset)
m.Post("/create", reqRepoDatasetWriter, bindIgnErr(auth.CreateDatasetForm{}), repo.CreateDatasetPost) m.Post("/create", reqRepoDatasetWriter, bindIgnErr(auth.CreateDatasetForm{}), repo.CreateDatasetPost)
m.Get("/edit/:id", reqRepoDatasetWriter, repo.EditDataset) m.Get("/edit/:id", reqRepoDatasetWriter, repo.EditDataset)
m.Post("/reference_datasets", reqRepoDatasetWriterJson, bindIgnErr(auth.ReferenceDatasetForm{}), repo.ReferenceDatasetPost)
m.Post("/edit", reqRepoDatasetWriter, bindIgnErr(auth.EditDatasetForm{}), repo.EditDatasetPost) m.Post("/edit", reqRepoDatasetWriter, bindIgnErr(auth.EditDatasetForm{}), repo.EditDatasetPost)
m.Get("/current_repo", repo.CurrentRepoDataset) m.Get("/current_repo", repo.CurrentRepoDataset)
m.Get("/my_datasets", repo.MyDatasets) m.Get("/my_datasets", repo.MyDatasets)
@@ -1045,6 +1052,8 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/current_repo_m", repo.CurrentRepoDatasetMultiple) m.Get("/current_repo_m", repo.CurrentRepoDatasetMultiple)
m.Get("/my_datasets_m", repo.MyDatasetsMultiple) m.Get("/my_datasets_m", repo.MyDatasetsMultiple)
m.Get("/public_datasets_m", repo.PublicDatasetMultiple) m.Get("/public_datasets_m", repo.PublicDatasetMultiple)

m.Get("/reference_datasets_available", repo.ReferenceDatasetAvailable)
m.Get("/my_favorite_m", repo.MyFavoriteDatasetMultiple) m.Get("/my_favorite_m", repo.MyFavoriteDatasetMultiple)


m.Group("/status", func() { m.Group("/status", func() {
@@ -1184,7 +1193,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("", reqRepoCloudBrainReader, repo.NotebookShow) m.Get("", reqRepoCloudBrainReader, repo.NotebookShow)
m.Get("/debug", cloudbrain.AdminOrJobCreaterRight, repo.NotebookDebug2) m.Get("/debug", cloudbrain.AdminOrJobCreaterRight, repo.NotebookDebug2)
m.Post("/restart", cloudbrain.AdminOrJobCreaterRight, repo.NotebookRestart) m.Post("/restart", cloudbrain.AdminOrJobCreaterRight, repo.NotebookRestart)
m.Post("/stop", cloudbrain.AdminOrJobCreaterRight, repo.NotebookStop)
m.Post("/stop", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.NotebookStop)
m.Post("/del", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.NotebookDel) m.Post("/del", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.NotebookDel)
}) })
m.Get("/create", reqWechatBind, reqRepoCloudBrainWriter, repo.NotebookNew) m.Get("/create", reqWechatBind, reqRepoCloudBrainWriter, repo.NotebookNew)


+ 19
- 0
services/repository/dataset.go View File

@@ -0,0 +1,19 @@
package repository

import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
)

func ConvertToDatasetWithStar(ctx *context.Context, datasets []*models.Dataset) []*models.DatasetWithStar {
var datasetsWithStar []*models.DatasetWithStar
for _, dataset := range datasets {
if !ctx.IsSigned {
datasetsWithStar = append(datasetsWithStar, &models.DatasetWithStar{Dataset: *dataset, IsStaring: false})
} else {
datasetsWithStar = append(datasetsWithStar, &models.DatasetWithStar{Dataset: *dataset, IsStaring: models.IsDatasetStaring(ctx.User.ID, dataset.ID)})
}

}
return datasetsWithStar
}

+ 10
- 10
templates/custom/select_dataset_train.tmpl View File

@@ -15,7 +15,7 @@
{{if .benchmarkMode}}{{.i18n.Tr "repo.modelarts.infer_job.select_model"}}{{else}}{{.i18n.Tr "dataset.select_dataset"}}{{end}} {{if .benchmarkMode}}{{.i18n.Tr "repo.modelarts.infer_job.select_model"}}{{else}}{{.i18n.Tr "dataset.select_dataset"}}{{end}}
</el-button> </el-button>
{{if .benchmarkMode}} {{if .benchmarkMode}}
<span class="tooltips" style="display: block;margin-left:11.5rem;">说明:先使用数据集功能上传模型,然后从数据集列表选模型。</span>
<span class="tooltips" style="display: block;margin-left:11.5rem;">{{.i18n.Tr "dataset.benchmark_dataset_tip"}}</span>
{{end}} {{end}}
<el-dialog title="{{.i18n.Tr "dataset.select_dataset"}}" :visible.sync="dialogVisible" width="50%"> <el-dialog title="{{.i18n.Tr "dataset.select_dataset"}}" :visible.sync="dialogVisible" width="50%">
<div v-loading="loadingDataIndex" style="position: relative;"> <div v-loading="loadingDataIndex" style="position: relative;">
@@ -49,13 +49,13 @@
<i class="CREATING"></i> <i class="CREATING"></i>
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;"
data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted=""
data-variation="mini" data-position="left center">解压中</span>
data-variation="mini" data-position="left center">{{$.i18n.Tr "dataset.unzip_stared"}}</span>
</span> </span>
<span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;">
<i class="FAILED"></i> <i class="FAILED"></i>
<span style="margin-left: 0.4em;font-size: 12px;color:red;" <span style="margin-left: 0.4em;font-size: 12px;color:red;"
data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted=""
data-variation="mini" data-position="left center">解压失败</span>
data-tooltip="{{$.i18n.Tr "dataset.unzip_failed"}}" data-inverted=""
data-variation="mini" data-position="left center">{{$.i18n.Tr "dataset.unzip_failed"}}</span>
</span> </span>
</div> </div>
</div> </div>
@@ -85,13 +85,13 @@
<i class="CREATING"></i> <i class="CREATING"></i>
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;"
data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted=""
data-variation="mini" data-position="left center">解压中</span>
data-variation="mini" data-position="left center">{{$.i18n.Tr "dataset.unzip_stared"}}</span>
</span> </span>
<span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;">
<i class="FAILED"></i> <i class="FAILED"></i>
<span style="margin-left: 0.4em;font-size: 12px;color:red;" <span style="margin-left: 0.4em;font-size: 12px;color:red;"
data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted=""
data-variation="mini" data-position="left center">解压失败</span>
data-variation="mini" data-position="left center">{{$.i18n.Tr "dataset.unzip_failed"}}</span>
</span> </span>
</div> </div>
</div> </div>
@@ -120,13 +120,13 @@
<i class="CREATING"></i> <i class="CREATING"></i>
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;"
data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted=""
data-variation="mini" data-position="left center">解压中</span>
data-variation="mini" data-position="left center">{{$.i18n.Tr "dataset.unzip_stared"}}</span>
</span> </span>
<span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;">
<i class="FAILED"></i> <i class="FAILED"></i>
<span style="margin-left: 0.4em;font-size: 12px;color:red;" <span style="margin-left: 0.4em;font-size: 12px;color:red;"
data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted=""
data-variation="mini" data-position="left center">解压失败</span>
data-variation="mini" data-position="left center">{{$.i18n.Tr "dataset.unzip_failed"}}</span>
</span> </span>
</div> </div>
</div> </div>
@@ -155,13 +155,13 @@
<i class="CREATING"></i> <i class="CREATING"></i>
<span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;"
data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted=""
data-variation="mini" data-position="left center">解压中</span>
data-variation="mini" data-position="left center">{{$.i18n.Tr "dataset.unzip_stared"}}</span>
</span> </span>
<span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;">
<i class="FAILED"></i> <i class="FAILED"></i>
<span style="margin-left: 0.4em;font-size: 12px;color:red;" <span style="margin-left: 0.4em;font-size: 12px;color:red;"
data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted=""
data-variation="mini" data-position="left center">解压失败</span>
data-variation="mini" data-position="left center">{{$.i18n.Tr "dataset.unzip_failed"}}</span>
</span> </span>
</div> </div>
</div> </div>


+ 2
- 1
templates/repo/attachment/upload.tmpl View File

@@ -47,7 +47,8 @@
data-uploading='{{.i18n.Tr "dropzone.uploading"}}' data-uploading='{{.i18n.Tr "dropzone.uploading"}}'
data-failed='{{.i18n.Tr "dropzone.failed"}}' data-failed='{{.i18n.Tr "dropzone.failed"}}'
data-repopath='{{AppSubUrl}}{{$.RepoLink}}/datasets' data-cancel='{{.i18n.Tr "cancel"}}' data-repopath='{{AppSubUrl}}{{$.RepoLink}}/datasets' data-cancel='{{.i18n.Tr "cancel"}}'
data-upload='{{.i18n.Tr "dataset.dataset_upload"}}'>
data-upload='{{.i18n.Tr "dataset.dataset_upload"}}'
data-upload-status='{{.i18n.Tr "dataset.dataset_upload_status"}}'>
</div> </div>
<div id="datasetId" datasetId="{{.datasetId}}"></div> <div id="datasetId" datasetId="{{.datasetId}}"></div>
</el-form> </el-form>


+ 5
- 9
templates/repo/cloudbrain/benchmark/new.tmpl View File

@@ -134,7 +134,7 @@
</div> </div>
</form> </form>
{{else}} {{else}}
<form class="ui form alogrithm_form" action="{{.Link}}?benchmarkMode=alogrithm" method="post">
<form id="form_id" class="ui form alogrithm_form" action="{{.Link}}?benchmarkMode=alogrithm" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" name="job_type" value="BENCHMARK"> <input type="hidden" name="job_type" value="BENCHMARK">
@@ -178,8 +178,7 @@
</div> </div>
<div class="required unite inline min_title fields" style="width: 90%;margin-left: 5.7rem;">&nbsp; <div class="required unite inline min_title fields" style="width: 90%;margin-left: 5.7rem;">&nbsp;
<div class="required eight wide field"> <div class="required eight wide field">
<label
style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_type"}}</label>
<label style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_type"}}</label>
<select class="ui fluid selection search dropdown" id="benchmark_types_id" <select class="ui fluid selection search dropdown" id="benchmark_types_id"
name="benchmark_types_id"> name="benchmark_types_id">
@@ -193,12 +192,9 @@
</select> </select>
</div> </div>
<div class="eight wide field" id="engine_name"> <div class="eight wide field" id="engine_name">
<input type="hidden" id="benchmark_child_types_id_hidden"
name="benchmark_child_types_id_hidden" value="{{.benchmark_child_types_id_hidden}}">
<label
style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_child_type"}}</label>
<select class="ui fluid selection dropdown nowrapx" id="benchmark_child_types_id"
style='width: 100%;' name="benchmark_child_types_id">
<input type="hidden" id="benchmark_child_types_id_hidden" name="benchmark_child_types_id_hidden" value="{{.benchmark_child_types_id_hidden}}">
<label style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_child_type"}}</label>
<select class="ui fluid selection dropdown nowrapx" id="benchmark_child_types_id" style='width: 100%;' name="benchmark_child_types_id">
</select> </select>
</div> </div>
</div> </div>


+ 11
- 5
templates/repo/cloudbrain/inference/new.tmpl View File

@@ -83,6 +83,10 @@
Ascend NPU</a> Ascend NPU</a>
</div> </div>
{{template "custom/wait_count_train" Dict "ctx" $ "type" .inference_gpu_types}} {{template "custom/wait_count_train" Dict "ctx" $ "type" .inference_gpu_types}}
<div style="display: flex;align-items: center;margin-left: 155px;margin-top: 0.5rem;">
<i class="ri-error-warning-line" style="color: #f2711c;margin-right: 0.5rem;"></i>
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.new_infer_gpu_tooltips" "/dataset" "/model" "/result" | Safe}}</span>
</div>
</div> </div>
<div class="required min_title inline field"> <div class="required min_title inline field">
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>
@@ -229,18 +233,18 @@
{{if .resource_spec_id}} {{if .resource_spec_id}}
{{range .inference_resource_specs}} {{range .inference_resource_specs}}
{{if eq $.resource_spec_id .Id}} {{if eq $.resource_spec_id .Id}}
<option value="{{.Id}}">GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
<option value="{{.Id}}">{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}</option>
{{end}} {{end}}
{{end}} {{end}}
{{range .inference_resource_specs}} {{range .inference_resource_specs}}
{{if ne $.resource_spec_id .Id}} {{if ne $.resource_spec_id .Id}}
<option value="{{.Id}}">GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
<option value="{{.Id}}">{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}</option>
{{end}} {{end}}
{{end}} {{end}}
{{else}} {{else}}
{{range .inference_resource_specs}} {{range .inference_resource_specs}}
<option name="resource_spec_id" value="{{.Id}}"> <option name="resource_spec_id" value="{{.Id}}">
GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}</option>
{{end}} {{end}}
{{end}} {{end}}
</select> </select>
@@ -384,17 +388,19 @@
let value = '' let value = ''
value += `<div class="two fields width85" id= "para${i}">` value += `<div class="two fields width85" id= "para${i}">`
value += '<div class="field">' value += '<div class="field">'
let placeholder_value='{{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}'
let placeholder_name='{{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}'
if(flag){ if(flag){
value +=`<input type="text" class="shipping_first-name" value="${paramsObject.label}">` value +=`<input type="text" class="shipping_first-name" value="${paramsObject.label}">`
}else{ }else{
value +='<input type="text" class="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}>'
value +='<input type="text" class="shipping_first-name" required placeholder="' + placeholder_name+ '">'
} }
value += '</div>' value += '</div>'
value += '<div class="field">' value += '<div class="field">'
if(flag){ if(flag){
value +=`<input type="text" class="shipping_last-name" value="${paramsObject.value}">` value +=`<input type="text" class="shipping_last-name" value="${paramsObject.value}">`
}else{ }else{
value +='<input type="text" class="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>'
value +='<input type="text" class="shipping_last-name" required placeholder="' + placeholder_value+ '">'
} }
value += '</div>' value += '</div>'
value += '<span><i class="trash icon"></i></span>' value += '<span><i class="trash icon"></i></span>'


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

@@ -211,7 +211,7 @@
data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}}
data-position="right center" data-variation="mini"></i> data-position="right center" data-variation="mini"></i>
</span> </span>
<a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU" target="_blank">查看样例</a>
<a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
</div> </div>
<div id="select-multi-dataset"> <div id="select-multi-dataset">


@@ -234,18 +234,18 @@
{{if .resource_spec_id}} {{if .resource_spec_id}}
{{range .train_resource_specs}} {{range .train_resource_specs}}
{{if eq $.resource_spec_id .Id}} {{if eq $.resource_spec_id .Id}}
<option value="{{.Id}}">GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
<option value="{{.Id}}">{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}</option>
{{end}} {{end}}
{{end}} {{end}}
{{range .train_resource_specs}} {{range .train_resource_specs}}
{{if ne $.resource_spec_id .Id}} {{if ne $.resource_spec_id .Id}}
<option value="{{.Id}}">GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
<option value="{{.Id}}">{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}</option>
{{end}} {{end}}
{{end}} {{end}}
{{else}} {{else}}
{{range .train_resource_specs}} {{range .train_resource_specs}}
<option name="resource_spec_id" value="{{.Id}}"> <option name="resource_spec_id" value="{{.Id}}">
GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option>
{{$.i18n.Tr "cloudbrain.gpu_num"}}:{{.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{.ShareMemMiB}}</option>
{{end}} {{end}}
{{end}} {{end}}
</select> </select>
@@ -297,17 +297,19 @@
let value = '' let value = ''
value += `<div class="two fields width85" id= "para${i}">` value += `<div class="two fields width85" id= "para${i}">`
value += '<div class="field">' value += '<div class="field">'
let placeholder_value='{{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}'
let placeholder_name='{{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}'
if(flag){ if(flag){
value +=`<input type="text" class="shipping_first-name" value="${paramsObject.label}">` value +=`<input type="text" class="shipping_first-name" value="${paramsObject.label}">`
}else{ }else{
value +='<input type="text" class="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}>'
value +='<input type="text" class="shipping_first-name" required placeholder="' + placeholder_name+ '">'
} }
value += '</div>' value += '</div>'
value += '<div class="field">' value += '<div class="field">'
if(flag){ if(flag){
value +=`<input type="text" class="shipping_last-name" value="${paramsObject.value}">` value +=`<input type="text" class="shipping_last-name" value="${paramsObject.value}">`
}else{ }else{
value +='<input type="text" class="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>'
value +='<input type="text" class="shipping_last-name" required placeholder="' + placeholder_value + '">'
} }
value += '</div>' value += '</div>'
value += '<span><i class="trash icon"></i></span>' value += '<span><i class="trash icon"></i></span>'


+ 9
- 9
templates/repo/cloudbrain/trainjob/show.tmpl View File

@@ -584,7 +584,7 @@
<div id="newmodel"> <div id="newmodel">
<div class="ui modal second"> <div class="ui modal second">
<div class="header" style="padding: 1rem;background-color: rgba(240, 240, 240, 100);"> <div class="header" style="padding: 1rem;background-color: rgba(240, 240, 240, 100);">
<h4 id="model_header">导入新模型</h4>
<h4 id="model_header">{{.i18n.Tr "repo.model.manage.import_new_model"}}</h4>
</div> </div>
<div class="content content-padding"> <div class="content content-padding">
<form id="formId" method="POST" class="ui form"> <form id="formId" method="POST" class="ui form">
@@ -594,26 +594,26 @@
<input type="hidden" name="trainTaskCreate" value="true"> <input type="hidden" name="trainTaskCreate" value="true">


<div class="required inline field"> <div class="required inline field">
<label>训练任务</label>
<label>{{.i18n.Tr "repo.model.manage.createtrainjob"}}</label>
<input type="hidden" class="width83" id="JobId" name="JobId" readonly required> <input type="hidden" class="width83" id="JobId" name="JobId" readonly required>
<input type="hidden" id="VersionName" name="VersionName" value="V0001"> <input type="hidden" id="VersionName" name="VersionName" value="V0001">
<input style="width: 45%;" id="JobName" readonly required> <input style="width: 45%;" id="JobName" readonly required>
</div> </div>


<div class="required inline field" id="modelname"> <div class="required inline field" id="modelname">
<label>模型名称</label>
<label>{{.i18n.Tr "repo.model.manage.model_name"}}</label>
<input style="width: 45%;" id="name" name="Name" required maxlength="25" <input style="width: 45%;" id="name" name="Name" required maxlength="25"
onkeyup="this.value=this.value.replace(/[, ]/g,'')"> onkeyup="this.value=this.value.replace(/[, ]/g,'')">
</div> </div>
<div class="required inline field" id="verionname"> <div class="required inline field" id="verionname">
<label>模型版本</label>
<label>{{.i18n.Tr "repo.modelconvert.modelversion"}}</label>
<input style="width: 45%;" id="version" name="Version" value="" readonly required maxlength="255"> <input style="width: 45%;" id="version" name="Version" value="" readonly required maxlength="255">
</div> </div>
<div class="unite min_title inline field required"> <div class="unite min_title inline field required">
<label>模型框架</label>
<label>{{.i18n.Tr "repo.model.manage.engine"}}</label>
<div class="ui dropdown selection search width70" id="choice_Engine"> <div class="ui dropdown selection search width70" id="choice_Engine">
<input type="hidden" id="Engine" name="Engine" required> <input type="hidden" id="Engine" name="Engine" required>
<div class="default text">选择模型框架</div>
<div class="default text">{{.i18n.Tr "repo.model.manage.select.engine"}}</div>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
<div class="menu" id="job-Engine"> <div class="menu" id="job-Engine">
<option class="active item" data-value="0">PyTorch</option> <option class="active item" data-value="0">PyTorch</option>
@@ -628,7 +628,7 @@
</div> </div>
<div class="unite min_title inline fields required"> <div class="unite min_title inline fields required">
<div class="field required"> <div class="field required">
<label for="modelSelectedFile">模型文件</label>
<label for="modelSelectedFile">{{.i18n.Tr "repo.model.manage.modelfile"}}</label>
</div> </div>
<div class="thirteen wide field" style="position:relative"> <div class="thirteen wide field" style="position:relative">
<input id="modelSelectedFile" type="text" readonly required onclick="showMenu();" name="modelSelectedFile" > <input id="modelSelectedFile" type="text" readonly required onclick="showMenu();" name="modelSelectedFile" >
@@ -638,12 +638,12 @@
</div> </div>
</div> </div>
<div class="inline field"> <div class="inline field">
<label>模型标签</label>
<label>{{.i18n.Tr "repo.model.manage.modellabel"}}</label>
<input style="width: 83%;margin-left: 7px;" id="label" name="Label" maxlength="255" <input style="width: 83%;margin-left: 7px;" id="label" name="Label" maxlength="255"
placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'> placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'>
</div> </div>
<div class="inline field"> <div class="inline field">
<label for="description">模型描述</label>
<label for="description">{{.i18n.Tr "repo.model.manage.modeldesc"}}</label>
<textarea style="width: 83%;margin-left: 7px;" id="Description" name="Description" rows="3" <textarea style="width: 83%;margin-left: 7px;" id="Description" name="Description" rows="3"
maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}' maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}'
onchange="this.value=this.value.substring(0, 255)" onchange="this.value=this.value.substring(0, 255)"


+ 83
- 61
templates/repo/datasets/index.tmpl View File

@@ -20,7 +20,6 @@
.wrapper { .wrapper {
display: flex; display: flex;
overflow: hidden; overflow: hidden;
padding: 0 1rem;
} }


.exp { .exp {
@@ -40,7 +39,8 @@
} }


.exp:checked+.text .btn::after { .exp:checked+.text .btn::after {
content:'{{$.i18n.Tr "org.fold"}}'
content:'{{$.i18n.Tr "org.fold"}}';
color: #3291f8;
} }


.wrapper>.text { .wrapper>.text {
@@ -80,7 +80,7 @@
margin-left: 20px; margin-left: 20px;
font-size: 14px; font-size: 14px;
padding: 0 8px; padding: 0 8px;
background: #3F51B5;
background-color: transparent;
line-height: 20px; line-height: 20px;
border-radius: 4px; border-radius: 4px;
color: #fff; color: #fff;
@@ -89,7 +89,8 @@
} }


.btn::after { .btn::after {
content:'{{$.i18n.Tr "org.unfold"}}'
content:'{{$.i18n.Tr "org.unfold"}}';
color: #3291f8;
} }


.btn::before { .btn::before {
@@ -132,6 +133,15 @@
border: 5px solid transparent; border: 5px solid transparent;
border-top-color: #c0c4cc; border-top-color: #c0c4cc;
} }
.dataset-flavor-button{
display: flex;
align-items: center;
padding: 0.5rem;
border: 1px solid rgba(34,36,38,0.15);
border-top-right-radius: 0;
border-bottom-right-radius: 0;
box-shadow: none
}
</style> </style>
<div class="repository"> <div class="repository">
{{template "repo/header" .}} {{template "repo/header" .}}
@@ -142,44 +152,59 @@
<div class="item" data-private="{{.IsPrivate}}" data-decompress-state="{{.DecompressState}}"></div> <div class="item" data-private="{{.IsPrivate}}" data-decompress-state="{{.DecompressState}}"></div>
{{end}} {{end}}
</div> </div>

<div id="dataset-base"> <div id="dataset-base">
<div class="ui container"> <div class="ui container">
<div class="ui mobile reversed stackable grid"> <div class="ui mobile reversed stackable grid">
<div class="row"> <div class="row">
<div class="column thirteen wide">
<h2 class="nowrap">{{.dataset.Title}}</h2>
<div class="ui blue small menu compact selectcloudbrain">
<a class="active item" href="{{.RepoLink}}/datasets">{{$.i18n.Tr "dataset.current_dataset"}}</a>
<a class="item" href="{{.RepoLink}}/datasets/reference_datasets">{{$.i18n.Tr "dataset.linked_dataset"}}</a>
</div> </div>
<div class="column three wide right aligned">
<span style="display: flex;align-items: center;justify-content: flex-end;height: 36px;">
{{if $.IsSigned}}
<div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;padding: 0 10px;"
@click="postStar({{.dataset.ID}},'{{.Link}}')">
<svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke"
:class='{stars_active:star_active}'>
<path
d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z">
</path>
</svg>
</div>
<span style="line-height: 1;">${num_stars}</span>
{{else}}
<div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;padding: 0 10px;">
<svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke"
:class='{stars_active:star_active}'>
<path
d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z">
</path>
</svg>
</div>
<span style="line-height: 1;">${num_stars}</span>
{{end}}
<a style="margin-left:30px;" href="{{.RepoLink}}/datasets/edit/{{.dataset.ID}}"
class="ui primary basic mini {{if not $.CanWrite}} disabled {{end}} button">{{.i18n.Tr "repo.modelarts.modify"}}</a>
</span>
</div>
<div class="row" style="align-items: center;">
<h2 class="nowrap" style="margin: 0;">{{.dataset.Title}}</h2>
<!-- border-top-right-radius: 0;
border-bottom-right-radius: 0; -->
<div style="margin-left: 1.5rem;">
{{if $.IsSigned}}
<button v-if="star_active" class="ui mini basic button" style="display: flex;align-items: center;padding: 0.5rem;border: #888888;border-top-right-radius: 0;border-bottom-right-radius: 0;margin-right: -1px;" @click="postStar({{.dataset.ID}},'{{.Link}}')">
<i class="ri-heart-fill" style="color: #FA8C16;"></i>
<span style="margin-left: 0.3rem;font-size: 0.7rem;">{{$.i18n.Tr "dataset.unfavorite"}}</span>
</button>
<button v-else class="ui mini basic button" style="display: flex;align-items: center;padding:0.5rem;border: #888888;border-top-right-radius: 0;border-bottom-right-radius: 0;margin-right: -1px;" @click="postStar({{.dataset.ID}},'{{.Link}}')">
<i class="ri-heart-line" ></i>
<span style="margin-left: 0.3rem;font-size: 0.7rem;">{{$.i18n.Tr "dataset.favorite"}}</span>
</button>
{{else}}
<button v-if="star_active" class="ui mini basic button" style="display: flex;align-items: center;padding: 0.5rem;border: #888888;border-top-right-radius: 0;border-bottom-right-radius: 0;margin-right: -1px;">
<i class="ri-heart-fill" ></i>
<span style="margin-left: 0.3rem;font-size: 0.7rem;">{{$.i18n.Tr "dataset.unfavorite"}}</span>
</button>
<button v-else class="ui mini basic button" style="display: flex;align-items: center;padding:0.5rem;border: #888888;border-top-right-radius: 0;border-bottom-right-radius: 0;margin-right: -1px;">
<i class="ri-heart-line" style="color: #FA8C16;"></i>
<span style="margin-left: 0.3rem;font-size: 0.7rem;">{{$.i18n.Tr "dataset.favorite"}}</span>
</button>
{{end}}
</div> </div>
<a class="ui mini basic button" style="display: flex;align-items: center;padding: 0.5rem;border: #888888;border-top-left-radius: 0;border-bottom-left-radius: 0;">
${num_stars}
</a>
<a style="margin-left:15px;padding: 0.5rem 1.5rem;" href="{{.RepoLink}}/datasets/edit/{{.dataset.ID}}" class="ui primary basic mini {{if not $.CanWrite}} disabled {{end}} button">{{.i18n.Tr "repo.modelarts.modify"}}</a>
</div>
{{if .dataset.Description}}
<div class="row" style="padding: 0;">
<div class="wrapper">
<input id="exp1" class="exp" type="checkbox">
<div class="text">
<label class="btn" for="exp1"></label>
{{.dataset.Description}}
</div>
</div>
</div>
{{end}}
<div class="row" style="align-items: center;">
{{if or (.dataset.Category) (.dataset.Task) (.dataset.License)}} {{if or (.dataset.Category) (.dataset.Task) (.dataset.License)}}
<div class="column thirteen wide">
<div class="column ten wide" style="padding:0">
{{if .dataset.Category}} {{if .dataset.Category}}
{{$category := .dataset.Category}} {{$category := .dataset.Category}}
<a class="ui repo-topic label topic" <a class="ui repo-topic label topic"
@@ -196,21 +221,7 @@
{{end}} {{end}}
</div> </div>
{{end}} {{end}}
</div>
{{if .dataset.Description}}
<div class="row" style="padding-top: 0;">
<div class=" wrapper">
<input id="exp1" class="exp" type="checkbox">
<div class="text">
<label class="btn" for="exp1"></label>
{{.dataset.Description}}
</div>
</div>
</div>
{{end}}
<div class="row">
<div class="column ten wide"></div>
<div class="column six wide right aligned">
<div class="column six wide right aligned" style="padding:0">
<el-select v-model="datasetType" style="width: 40%;" size="small" @change="changeDatasetType"> <el-select v-model="datasetType" style="width: 40%;" size="small" @change="changeDatasetType">
<i slot="prefix" style="display: inline-block;color: #101010;" <i slot="prefix" style="display: inline-block;color: #101010;"
class="el-input__icon ri-archive-drawer-line"></i> class="el-input__icon ri-archive-drawer-line"></i>
@@ -222,7 +233,7 @@
@click="gotoUpload('{{.RepoLink}}',{{.dataset.ID}})">{{$.i18n.Tr "dataset.dataset_upload"}}</el-button> @click="gotoUpload('{{.RepoLink}}',{{.dataset.ID}})">{{$.i18n.Tr "dataset.dataset_upload"}}</el-button>
</div> </div>
</div> </div>
<div class="row">
<div class="row" style="padding-top: 0;">
<div class="ui sixteen wide column dataset"> <div class="ui sixteen wide column dataset">
<div class="ui grid stackable" style="background: #f0f0f0;;"> <div class="ui grid stackable" style="background: #f0f0f0;;">
<div class="row"> <div class="row">
@@ -387,16 +398,27 @@
</div> </div>
</div> </div>
{{else}} {{else}}
<div class="ui placeholder segment bgtask-none">
<div class="ui icon header bgtask-header-pic"></div>
<div class="bgtask-content-header">{{.i18n.Tr "dataset.dataset_no_create"}}</div>
{{if $.CanWrite}}
<a class="ui green button" href="{{.RepoLink}}/datasets/create">{{.i18n.Tr "dataset.create_new_dataset"}}</a>
{{end}}
<div class="bgtask-content">
<div class="bgtask-content-txt">{{.i18n.Tr "dataset.dataset_explain"}}</div>
<div class="bgtask-content-txt">{{.i18n.Tr "dataset.dataset_instructions_for_use"}}<a
href="https://git.openi.org.cn/zeizei/OpenI_Learning">{{.i18n.Tr "dataset.dataset_camp_course"}}</a></div>
<div class="ui container">
<div class="ui stackable grid">
<div class="row" style="justify-content: space-between">
<div class="ui blue small menu compact selectcloudbrain">
<a class="active item" href="{{.RepoLink}}/datasets">{{$.i18n.Tr "dataset.current_dataset"}}</a>
<a class="item" href="{{.RepoLink}}/datasets/reference_datasets">{{$.i18n.Tr "dataset.linked_dataset"}}</a>
</div>
{{if $.CanWrite}}
<a class="ui green button" href="{{.RepoLink}}/datasets/create">{{$.i18n.Tr "new_dataset"}}</a>
{{end}}
</div>
</div>
<div class="ui placeholder segment bgtask-none">
<div class="ui icon header bgtask-header-pic"></div>
<div class="bgtask-content-header">{{.i18n.Tr "dataset.dataset_no_create"}}</div>
<div class="bgtask-content">
<div class="bgtask-content-txt">{{.i18n.Tr "dataset.dataset_explain"}}</div>
<div class="bgtask-content-txt">{{.i18n.Tr "dataset.dataset_instructions_for_use"}}<a
href="https://git.openi.org.cn/zeizei/OpenI_Learning">{{.i18n.Tr "dataset.dataset_camp_course"}}</a></div>
</div>
</div> </div>
</div> </div>
{{end}} {{end}}


+ 8
- 0
templates/repo/datasets/reference.tmpl View File

@@ -0,0 +1,8 @@
{{template "base/head" .}}

<div class="repository">
{{template "repo/header" .}}
<div class="reference-dataset" data-repolink="{{.RepoLink}}" data-canwrite="{{.CanWrite}}" data-is-sign="{{$.IsSigned}}" data-max-reference-num="{{.MaxReferenceDatasetNum}}" data-address="{{IsShowDataSetOfCurrentRepo $.Repository.ID}}"></div>
<div id="reference-dataset"></div>
</div>
{{template "base/footer" .}}

+ 5
- 3
templates/repo/grampus/trainjob/gpu/new.tmpl View File

@@ -164,7 +164,7 @@
<span> <span>
<i class="question circle icon link" data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} data-position="right center" data-variation="mini"></i> <i class="question circle icon link" data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} data-position="right center" data-variation="mini"></i>
</span> </span>
<a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU/src/branch/master/train_for_c2net.py" target="_blank">查看样例</a>
<a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU/src/branch/master/train_for_c2net.py" target="_blank">{{.i18n.Tr "cloudbrain.view_sample"}}</a>
</div> </div>


@@ -243,17 +243,19 @@
let value = '' let value = ''
value += `<div class="two fields width85" id= "para${i}">` value += `<div class="two fields width85" id= "para${i}">`
value += '<div class="field">' value += '<div class="field">'
let placeholder_value='{{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}'
let placeholder_name='{{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}'
if(flag){ if(flag){
value +=`<input type="text" class="shipping_first-name" value="${paramsObject.label}">` value +=`<input type="text" class="shipping_first-name" value="${paramsObject.label}">`
}else{ }else{
value +='<input type="text" class="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}>'
value +='<input type="text" class="shipping_first-name" required placeholder="' + placeholder_name+ '">'
} }
value += '</div>' value += '</div>'
value += '<div class="field">' value += '<div class="field">'
if(flag){ if(flag){
value +=`<input type="text" class="shipping_last-name" value="${paramsObject.value}">` value +=`<input type="text" class="shipping_last-name" value="${paramsObject.value}">`
}else{ }else{
value +='<input type="text" class="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>'
value +='<input type="text" class="shipping_last-name" required placeholder="' + placeholder_value+ '">'
} }
value += '</div>' value += '</div>'
value += '<span><i class="trash icon"></i></span>' value += '<span><i class="trash icon"></i></span>'


+ 4
- 2
templates/repo/grampus/trainjob/npu/new.tmpl View File

@@ -269,17 +269,19 @@
let value = '' let value = ''
value += `<div class="two fields width85" id= "para${i}">` value += `<div class="two fields width85" id= "para${i}">`
value += '<div class="field">' value += '<div class="field">'
let placeholder_value='{{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}'
let placeholder_name='{{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}'
if(flag){ if(flag){
value +=`<input type="text" class="shipping_first-name" value="${paramsObject.label}">` value +=`<input type="text" class="shipping_first-name" value="${paramsObject.label}">`
}else{ }else{
value +='<input type="text" class="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}>'
value +='<input type="text" class="shipping_first-name" required placeholder="' + placeholder_name+ '">'
} }
value += '</div>' value += '</div>'
value += '<div class="field">' value += '<div class="field">'
if(flag){ if(flag){
value +=`<input type="text" class="shipping_last-name" value="${paramsObject.value}">` value +=`<input type="text" class="shipping_last-name" value="${paramsObject.value}">`
}else{ }else{
value +='<input type="text" class="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>'
value +='<input type="text" class="shipping_last-name" required placeholder="' + placeholder_value+ '">'
} }
value += '</div>' value += '</div>'
value += '<span><i class="trash icon"></i></span>' value += '<span><i class="trash icon"></i></span>'


+ 11
- 11
templates/repo/grampus/trainjob/show.tmpl View File

@@ -470,11 +470,11 @@
<div class="ui tab" data-tab="second{{$k}}"> <div class="ui tab" data-tab="second{{$k}}">
<div style="position: relative;"> <div style="position: relative;">
<span> <span>
<a title="滚动到顶部" style="position: absolute; right: -32px;cursor: pointer;"
<a title="{{$.i18n.Tr "repo.log_scroll_start"}}" style="position: absolute; right: -32px;cursor: pointer;"
class="log_top" data-version="{{.VersionName}}"><i class="icon-to-top"></i></a> class="log_top" data-version="{{.VersionName}}"><i class="icon-to-top"></i></a>
</span> </span>
<span class="log-info-{{.VersionName}}"> <span class="log-info-{{.VersionName}}">
<a title="滚动到底部" style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;"
<a title="{{$.i18n.Tr "repo.log_scroll_end"}}" style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;"
class="log_bottom" data-version="{{.VersionName}}"><i class="log_bottom" data-version="{{.VersionName}}"><i
class="icon-to-bottom"></i></a> class="icon-to-bottom"></i></a>
</span> </span>
@@ -541,7 +541,7 @@
<div id="newmodel"> <div id="newmodel">
<div class="ui modal second"> <div class="ui modal second">
<div class="header" style="padding: 1rem;background-color: rgba(240, 240, 240, 100);"> <div class="header" style="padding: 1rem;background-color: rgba(240, 240, 240, 100);">
<h4 id="model_header">导入新模型</h4>
<h4 id="model_header">{{.i18n.Tr "repo.model.manage.import_new_model"}}</h4>
</div> </div>
<div class="content content-padding"> <div class="content content-padding">
<form id="formId" method="POST" class="ui form"> <form id="formId" method="POST" class="ui form">
@@ -551,26 +551,26 @@
<input type="hidden" name="trainTaskCreate" value="true"> <input type="hidden" name="trainTaskCreate" value="true">


<div class="required inline field"> <div class="required inline field">
<label>训练任务</label>
<label>{{.i18n.Tr "repo.model.manage.createtrainjob"}}</label>
<input type="hidden" class="width83" id="JobId" name="JobId" readonly required> <input type="hidden" class="width83" id="JobId" name="JobId" readonly required>
<input type="hidden" id="VersionName" name="VersionName" value="V0001"> <input type="hidden" id="VersionName" name="VersionName" value="V0001">
<input style="width: 45%;" id="JobName" readonly required> <input style="width: 45%;" id="JobName" readonly required>
</div> </div>


<div class="required inline field" id="modelname"> <div class="required inline field" id="modelname">
<label>模型名称</label>
<label>{{.i18n.Tr "repo.model.manage.model_name"}}</label>
<input style="width: 45%;" id="name" name="Name" required maxlength="25" <input style="width: 45%;" id="name" name="Name" required maxlength="25"
onkeyup="this.value=this.value.replace(/[, ]/g,'')"> onkeyup="this.value=this.value.replace(/[, ]/g,'')">
</div> </div>
<div class="required inline field" id="verionname"> <div class="required inline field" id="verionname">
<label>模型版本</label>
<label>{{.i18n.Tr "repo.modelconvert.modelversion"}}</label>
<input style="width: 45%;" id="version" name="Version" value="" readonly required maxlength="255"> <input style="width: 45%;" id="version" name="Version" value="" readonly required maxlength="255">
</div> </div>
<div class="unite min_title inline field required"> <div class="unite min_title inline field required">
<label>模型框架</label>
<label>{{.i18n.Tr "repo.model.manage.engine"}}</label>
<div class="ui dropdown selection search width70" id="choice_Engine"> <div class="ui dropdown selection search width70" id="choice_Engine">
<input type="hidden" id="Engine" name="Engine" required> <input type="hidden" id="Engine" name="Engine" required>
<div class="default text">选择模型框架</div>
<div class="default text">{{.i18n.Tr "repo.model.manage.select.engine"}}</div>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
<div class="menu" id="job-Engine"> <div class="menu" id="job-Engine">
<option class="active item" data-value="0">PyTorch</option> <option class="active item" data-value="0">PyTorch</option>
@@ -586,7 +586,7 @@
</div> </div>
<div class="unite min_title inline fields required"> <div class="unite min_title inline fields required">
<div class="field required"> <div class="field required">
<label for="modelSelectedFile">模型文件</label>
<label for="modelSelectedFile">{{.i18n.Tr "repo.model.manage.modelfile"}}</label>
</div> </div>
<div class="thirteen wide field" style="position:relative"> <div class="thirteen wide field" style="position:relative">
<input id="modelSelectedFile" type="text" readonly required onclick="showMenu();" name="modelSelectedFile" > <input id="modelSelectedFile" type="text" readonly required onclick="showMenu();" name="modelSelectedFile" >
@@ -596,12 +596,12 @@
</div> </div>
</div> </div>
<div class="inline field"> <div class="inline field">
<label>模型标签</label>
<label>{{.i18n.Tr "repo.model.manage.modellabel"}}</label>
<input style="width: 83%;margin-left: 7px;" id="label" name="Label" maxlength="255" <input style="width: 83%;margin-left: 7px;" id="label" name="Label" maxlength="255"
placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'> placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'>
</div> </div>
<div class="inline field"> <div class="inline field">
<label for="description">模型描述</label>
<label for="description">{{.i18n.Tr "repo.model.manage.modeldesc"}}</label>
<textarea style="width: 83%;margin-left: 7px;" id="Description" name="Description" rows="3" <textarea style="width: 83%;margin-left: 7px;" id="Description" name="Description" rows="3"
maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}' maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}'
onchange="this.value=this.value.substring(0, 255)" onchange="this.value=this.value.substring(0, 255)"


+ 1
- 1
templates/repo/header.tmpl View File

@@ -138,7 +138,7 @@
{{end}} {{end}}


{{if .Permission.CanRead $.UnitTypeDatasets}} {{if .Permission.CanRead $.UnitTypeDatasets}}
<a class="{{if .PageIsDataset}}active{{end}} item" href="{{.RepoLink}}/datasets">
<a class="{{if .PageIsDataset}}active{{end}} item" id="header-dataset" href="{{.RepoLink}}{{if IsShowDataSetOfCurrentRepo $.Repository.ID}}/datasets{{else}}/datasets/reference_datasets{{end}}">
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"/><path d="M20.083 15.2l1.202.721a.5.5 0 0 1 0 .858l-8.77 5.262a1 1 0 0 1-1.03 0l-8.77-5.262a.5.5 0 0 1 0-.858l1.202-.721L12 20.05l8.083-4.85zm0-4.7l1.202.721a.5.5 0 0 1 0 .858L12 17.65l-9.285-5.571a.5.5 0 0 1 0-.858l1.202-.721L12 15.35l8.083-4.85zm-7.569-9.191l8.771 5.262a.5.5 0 0 1 0 .858L12 13 2.715 7.429a.5.5 0 0 1 0-.858l8.77-5.262a1 1 0 0 1 1.03 0zM12 3.332L5.887 7 12 10.668 18.113 7 12 3.332z"/></svg> <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"/><path d="M20.083 15.2l1.202.721a.5.5 0 0 1 0 .858l-8.77 5.262a1 1 0 0 1-1.03 0l-8.77-5.262a.5.5 0 0 1 0-.858l1.202-.721L12 20.05l8.083-4.85zm0-4.7l1.202.721a.5.5 0 0 1 0 .858L12 17.65l-9.285-5.571a.5.5 0 0 1 0-.858l1.202-.721L12 15.35l8.083-4.85zm-7.569-9.191l8.771 5.262a.5.5 0 0 1 0 .858L12 13 2.715 7.429a.5.5 0 0 1 0-.858l8.77-5.262a1 1 0 0 1 1.03 0zM12 3.332L5.887 7 12 10.668 18.113 7 12 3.332z"/></svg>
{{.i18n.Tr "datasets"}} {{.i18n.Tr "datasets"}}
</a> </a>


+ 5
- 4
templates/repo/modelarts/inferencejob/new.tmpl View File

@@ -196,7 +196,7 @@
{{end}} {{end}}
</select> </select>
</div> </div>
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 1rem;"></span>
<!-- 数据集 --> <!-- 数据集 -->
<div id="select-multi-dataset"> <div id="select-multi-dataset">


@@ -277,7 +277,6 @@
<div class="ui labeled input" style="width: 5%;"> <div class="ui labeled input" style="width: 5%;">
<input style="border-radius: 0;text-align: center;" name="work_server_number" id="trainjob_work_server_num" tabindex="3" autofocus required maxlength="255" value="1" readonly> <input style="border-radius: 0;text-align: center;" name="work_server_number" id="trainjob_work_server_num" tabindex="3" autofocus required maxlength="255" value="1" readonly>
</div> </div>
<span class="tooltips" style="margin-left: 11.5rem;display: block;">{{.i18n.Tr "cloudbrain.inference_output_path_rule"}}</span>
</div> </div>
<!-- 表单操作 --> <!-- 表单操作 -->
<div class="inline min_title field"> <div class="inline min_title field">
@@ -410,12 +409,14 @@


// 参数增加、删除、修改、保存 // 参数增加、删除、修改、保存
function Add_parameter(i){ function Add_parameter(i){
let placeholder_value='{{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}'
let placeholder_name='{{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}'
value = '<div class="two fields width85" id= "para'+ i +'">' + value = '<div class="two fields width85" id= "para'+ i +'">' +
'<div class="field">' + '<div class="field">' +
'<input type="text" name="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}> ' +
'<input type="text" name="shipping_first-name" required placeholder="' + placeholder_name+ '">' +
'</div> ' + '</div> ' +
'<div class="field"> ' + '<div class="field"> ' +
'<input type="text" name="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>' +
'<input type="text" name="shipping_last-name" required placeholder="' + placeholder_value + '">' +
'</div>'+ '</div>'+
'<span>' + '<span>' +
'<i class="trash icon">' + '<i class="trash icon">' +


+ 1
- 1
templates/repo/modelarts/inferencejob/show.tmpl View File

@@ -314,7 +314,7 @@ td, th {
</tr> </tr>
<tr class="ti-no-ng-animate"> <tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80"> <td class="ti-no-ng-animate ti-text-form-label text-width80">
创建人
{{$.i18n.Tr "repo.cloudbrain_creator"}}
</td> </td>


<td class="ti-text-form-content"> <td class="ti-text-form-content">


+ 1
- 1
templates/repo/modelarts/notebook/show.tmpl View File

@@ -441,7 +441,7 @@
<tr> <tr>
<td style="word-wrap: break-word;word-break: break-all;"><a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a></td> <td style="word-wrap: break-word;word-break: break-all;"><a href="{{.RepositoryLink}}" target="_blank">{{.DatasetName}}</a></td>
<td style="word-wrap: break-word;word-break: break-all;">{{.DatasetDownloadLink}}</td> <td style="word-wrap: break-word;word-break: break-all;">{{.DatasetDownloadLink}}</td>
<td class="center aligned"><a class="ui poping up clipboard" id="clipboard-btn1" data-original="{{$.i18n.Tr "repo.copy_link"}}" data-success="{{$.i18n.Tr "repo.copy_link_success"}}" data-error="{{$.i18n.Tr "repo.copy_link_error"}}" data-content="{{$.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-text="{{.DatasetDownloadLink}}">复制链接</a></td>
<td class="center aligned"><a class="ui poping up clipboard" id="clipboard-btn" data-original="{{$.i18n.Tr "repo.copy_link"}}" data-success="{{$.i18n.Tr "repo.copy_link_success"}}" data-error="{{$.i18n.Tr "repo.copy_link_error"}}" data-content="{{$.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-text="{{.DatasetDownloadLink}}">{{$.i18n.Tr "dataset.download_copy"}}</a></td>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>


+ 6
- 4
templates/repo/modelarts/trainjob/edit_para.tmpl View File

@@ -76,10 +76,10 @@
{{range .para}} {{range .para}}
<div class="two fields"> <div class="two fields">
<div class="field"> <div class="field">
<input type="text" name="shipping_first-name" placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}>
<input type="text" name="shipping_first-name" placeholder="{{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}">
</div> </div>
<div class="field"> <div class="field">
<input type="text" name="shipping_last-name" placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>
<input type="text" name="shipping_last-name" placeholder="{{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}">
</div> </div>
<span> <span>
<i class="trash icon"> <i class="trash icon">
@@ -151,12 +151,14 @@


// 参数增加、删除、修改、保存 // 参数增加、删除、修改、保存
function Add_parameter(){ function Add_parameter(){
let placeholder_value='{{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}'
let placeholder_name='{{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}'
value = '<div class="two fields">' + value = '<div class="two fields">' +
'<div class="field">' + '<div class="field">' +
'<input type="text" name="shipping_first-name" placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}> ' +
'<input type="text" name="shipping_first-name" placeholder="' + placeholder_name+ '">' +
'</div> ' + '</div> ' +
'<div class="field"> ' + '<div class="field"> ' +
'<input type="text" name="shipping_last-name" placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>' +
'<input type="text" name="shipping_last-name" placeholder="' + placeholder_value+ '">' +
'</div>'+ '</div>'+
'<span>' + '<span>' +
'<i class="trash icon">' + '<i class="trash icon">' +


+ 4
- 2
templates/repo/modelarts/trainjob/new.tmpl View File

@@ -332,12 +332,14 @@
}); });
// 参数增加、删除、修改、保存 // 参数增加、删除、修改、保存
function Add_parameter(i) { function Add_parameter(i) {
let placeholder_value='{{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}'
let placeholder_name='{{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}'
value = '<div class="two fields width85" id= "para' + i + '">' + value = '<div class="two fields width85" id= "para' + i + '">' +
'<div class="field">' + '<div class="field">' +
'<input type="text" name="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}> ' +
'<input type="text" name="shipping_first-name" required placeholder="' + placeholder_name+ '">' +
'</div> ' + '</div> ' +
'<div class="field"> ' + '<div class="field"> ' +
'<input type="text" name="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>' +
'<input type="text" name="shipping_last-name" required placeholder="' + placeholder_value+ '">' +
'</div>' + '</div>' +
'<span>' + '<span>' +
'<i class="trash icon">' + '<i class="trash icon">' +


+ 12
- 12
templates/repo/modelarts/trainjob/show.tmpl View File

@@ -320,7 +320,7 @@
data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a> data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a>
<a class="item log_bottom" data-tab="second{{$k}}" <a class="item log_bottom" data-tab="second{{$k}}"
data-version="{{.VersionName}}">{{$.i18n.Tr "repo.modelarts.log"}}</a> data-version="{{.VersionName}}">{{$.i18n.Tr "repo.modelarts.log"}}</a>
<a class="item metric_chart" data-tab="four{{$k}}" data-version="{{.VersionName}}">资源占用情况</a>
<a class="item metric_chart" data-tab="four{{$k}}" data-version="{{.VersionName}}">{{$.i18n.Tr "cloudbrain.resource_use"}}</a>
<a class="item load-model-file" data-tab="third{{$k}}" data-download-flag="{{$.canDownload}}" data-path="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/model_list" data-version="{{.VersionName}}" data-parents="" data-filename="" data-init="init" >{{$.i18n.Tr "repo.model_download"}}</a> <a class="item load-model-file" data-tab="third{{$k}}" data-download-flag="{{$.canDownload}}" data-path="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/model_list" data-version="{{.VersionName}}" data-parents="" data-filename="" data-init="init" >{{$.i18n.Tr "repo.model_download"}}</a>
</div> </div>
<div class="ui tab active" data-tab="first{{$k}}"> <div class="ui tab active" data-tab="first{{$k}}">
@@ -514,11 +514,11 @@
<div <div
style="position: relative;border: 1px solid rgba(0,0,0,.2);padding: 0 10px;margin-top: 10px;"> style="position: relative;border: 1px solid rgba(0,0,0,.2);padding: 0 10px;margin-top: 10px;">
<span> <span>
<a title="滚动到顶部" style="position: absolute; right: -32px;cursor: pointer;"
<a title="{{$.i18n.Tr "repo.log_scroll_start"}}" style="position: absolute; right: -32px;cursor: pointer;"
class="log_top" data-version="{{.VersionName}}"><i class="icon-to-top"></i></a> class="log_top" data-version="{{.VersionName}}"><i class="icon-to-top"></i></a>
</span> </span>
<span class="log-info-{{.VersionName}}"> <span class="log-info-{{.VersionName}}">
<a title="滚动到底部" style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;"
<a title="{{$.i18n.Tr "repo.log_scroll_end"}}" style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;"
class="log_bottom" data-version="{{.VersionName}}"><i class="log_bottom" data-version="{{.VersionName}}"><i
class="icon-to-bottom"></i></a> class="icon-to-bottom"></i></a>
</span> </span>
@@ -593,7 +593,7 @@
<div id="newmodel"> <div id="newmodel">
<div class="ui modal second"> <div class="ui modal second">
<div class="header" style="padding: 1rem;background-color: rgba(240, 240, 240, 100);"> <div class="header" style="padding: 1rem;background-color: rgba(240, 240, 240, 100);">
<h4 id="model_header">导入新模型</h4>
<h4 id="model_header">{{.i18n.Tr "repo.model.manage.import_new_model"}}</h4>
</div> </div>
<div class="content content-padding"> <div class="content content-padding">
<form id="formId" method="POST" class="ui form"> <form id="formId" method="POST" class="ui form">
@@ -604,34 +604,34 @@


<div class="two inline fields "> <div class="two inline fields ">
<div class="required ten wide field"> <div class="required ten wide field">
<label style="margin-left: -23px;">选择训练任务</label>
<label style="margin-left: -23px;">{{.i18n.Tr "repo.model.manage.createtrainjob"}}</label>
<input type="hidden" class="width83" id="JobId" name="JobId" readonly required> <input type="hidden" class="width83" id="JobId" name="JobId" readonly required>
<input class="width83" id="JobName" readonly required> <input class="width83" id="JobName" readonly required>


</div> </div>
<div class="required six widde field"> <div class="required six widde field">
<label>版本</label>
<label>{{.i18n.Tr "repo.model.manage.version"}}</label>
<input class="width70" id="VersionName" name="VersionName" readonly required> <input class="width70" id="VersionName" name="VersionName" readonly required>
</div> </div>
</div> </div>


<div class="required inline field" id="modelname"> <div class="required inline field" id="modelname">
<label>模型名称</label>
<label>{{.i18n.Tr "repo.model.manage.model_name"}}</label>
<input style="width: 45%;" id="name" name="Name" required maxlength="25" <input style="width: 45%;" id="name" name="Name" required maxlength="25"
onkeyup="this.value=this.value.replace(/[, ]/g,'')"> onkeyup="this.value=this.value.replace(/[, ]/g,'')">
</div> </div>
<div class="required inline field" id="verionname"> <div class="required inline field" id="verionname">
<label>模型版本</label>
<label>{{.i18n.Tr "repo.modelconvert.modelversion"}}</label>
<input style="width: 45%;" id="version" name="Version" value="" readonly required maxlength="255"> <input style="width: 45%;" id="version" name="Version" value="" readonly required maxlength="255">
</div> </div>
<div class="unite min_title inline field required"> <div class="unite min_title inline field required">
<label>模型框架</label>
<label>{{.i18n.Tr "repo.model.manage.engine"}}</label>
<input type="hidden" id="Engine" name="Engine" required> <input type="hidden" id="Engine" name="Engine" required>
<input style="width: 45%;" id="Engine_name" name="Engine_name" readonly required maxlength="255"> <input style="width: 45%;" id="Engine_name" name="Engine_name" readonly required maxlength="255">
</div> </div>
<div class="unite min_title inline fields required"> <div class="unite min_title inline fields required">
<div class="field required"> <div class="field required">
<label for="modelSelectedFile">模型文件</label>
<label for="modelSelectedFile">{{.i18n.Tr "repo.model.manage.modelfile"}}</label>
</div> </div>
<div class="thirteen wide field" style="position:relative"> <div class="thirteen wide field" style="position:relative">
<input id="modelSelectedFile" type="text" readonly required onclick="showMenu();" name="modelSelectedFile" > <input id="modelSelectedFile" type="text" readonly required onclick="showMenu();" name="modelSelectedFile" >
@@ -641,12 +641,12 @@
</div> </div>
</div> </div>
<div class="inline field"> <div class="inline field">
<label>模型标签</label>
<label>{{.i18n.Tr "repo.model.manage.modellabel"}}</label>
<input style="width: 83%;margin-left: 7px;" id="label" name="Label" maxlength="255" <input style="width: 83%;margin-left: 7px;" id="label" name="Label" maxlength="255"
placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'> placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'>
</div> </div>
<div class="inline field"> <div class="inline field">
<label for="description">模型描述</label>
<label for="description">{{.i18n.Tr "repo.model.manage.modeldesc"}}</label>
<textarea style="width: 83%;margin-left: 7px;" id="Description" name="Description" rows="3" <textarea style="width: 83%;margin-left: 7px;" id="Description" name="Description" rows="3"
maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}' maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}'
onchange="this.value=this.value.substring(0, 255)" onchange="this.value=this.value.substring(0, 255)"


+ 4
- 2
templates/repo/modelarts/trainjob/version_new.tmpl View File

@@ -280,12 +280,14 @@


// 参数增加、删除、修改、保存 // 参数增加、删除、修改、保存
function Add_parameter(i){ function Add_parameter(i){
let placeholder_value='{{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}'
let placeholder_name='{{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}'
value = '<div class="two fields width85" id= "para'+ i +'">' + value = '<div class="two fields width85" id= "para'+ i +'">' +
'<div class="field">' + '<div class="field">' +
'<input type="text" name="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}> ' +
'<input type="text" name="shipping_first-name" required placeholder="' + placeholder_name+ '">' +
'</div> ' + '</div> ' +
'<div class="field"> ' + '<div class="field"> ' +
'<input type="text" name="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>' +
'<input type="text" name="shipping_last-name" required placeholder="' + placeholder_value+ '">' +
'</div>'+ '</div>'+
'<span>' + '<span>' +
'<i class="trash icon">' + '<i class="trash icon">' +


+ 28
- 29
templates/repo/modelmanage/convertIndex.tmpl View File

@@ -47,13 +47,12 @@
{{if eq .MODEL_CONVERT_COUNT 0}} {{if eq .MODEL_CONVERT_COUNT 0}}
<div class="ui placeholder segment bgtask-none"> <div class="ui placeholder segment bgtask-none">
<div class="ui icon header bgtask-header-pic"></div> <div class="ui icon header bgtask-header-pic"></div>
<div class="bgtask-content-header">未创建过模型转换任务</div>
<div class="bgtask-content-header">{{$.i18n.Tr "repo.modelconvert.notcreate"}}</div>
<div class="bgtask-content"> <div class="bgtask-content">
{{if eq .MODEL_COUNT 0}} {{if eq .MODEL_COUNT 0}}
<div class="bgtask-content-txt">请您先导入<a href="{{.RepoLink}}/modelmanage/show_model">模型</a>,然后再对其进行转换。</div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.modelconvert.importfirst1"}}<a href="{{.RepoLink}}/modelmanage/show_model">{{$.i18n.Tr "repo.modelconvert.importfirst2"}}</a>{{$.i18n.Tr "repo.modelconvert.importfirst3"}}</div>
{{end}} {{end}}
<div class="bgtask-content-txt">使用说明:可以参考启智AI协作平台<a
href="https://git.openi.org.cn/zeizei/OpenI_Learning">小白训练营课程。</a></div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions"}}</div>


</div> </div>
</div> </div>
@@ -68,19 +67,19 @@
<div class="ui grid stackable" style="background: #f0f0f0;;"> <div class="ui grid stackable" style="background: #f0f0f0;;">
<div class="row"> <div class="row">
<div class="three wide column padding0"> <div class="three wide column padding0">
<span style="margin:0 6px">任务名称</span>
<span style="margin:0 6px">{{$.i18n.Tr "repo.modelconvert.taskname"}}</span>
</div> </div>
<div class="two wide column text center padding0"> <div class="two wide column text center padding0">
<span>状态</span>
<span>{{$.i18n.Tr "repo.modelconvert.taskstatus"}}</span>
</div> </div>
<div class="two wide column text center padding0"> <div class="two wide column text center padding0">
<span>原模型框架</span>
<span>{{$.i18n.Tr "repo.modelconvert.srcengine"}}</span>
</div> </div>
<div class="two wide column text center padding0"> <div class="two wide column text center padding0">
<span>转换后格式</span>
<span>{{$.i18n.Tr "repo.modelconvert.outputformat"}}</span>
</div> </div>
<div class="two wide column text center padding0"> <div class="two wide column text center padding0">
<span>创建时间</span>
<span>{{$.i18n.Tr "repo.modelconvert.createtime"}}</span>
</div> </div>
<div class="one wide column text center padding0"> <div class="one wide column text center padding0">
<span>{{$.i18n.Tr "repo.cloudbrain_creator"}}</span> <span>{{$.i18n.Tr "repo.cloudbrain_creator"}}</span>
@@ -143,10 +142,10 @@


{{if .IsCanOper}} {{if .IsCanOper}}
<a id="ai-download-{{.ID}}" href="{{$.Repository.HTMLURL}}/modelmanage/download_model_convert/{{.ID}}?AllDownload=true&a=1" class='ui basic {{if eq .Status "SUCCEEDED" "COMPLETED"}}blue {{else}}disabled {{end}}button' style="border-radius: .28571429rem;"> <a id="ai-download-{{.ID}}" href="{{$.Repository.HTMLURL}}/modelmanage/download_model_convert/{{.ID}}?AllDownload=true&a=1" class='ui basic {{if eq .Status "SUCCEEDED" "COMPLETED"}}blue {{else}}disabled {{end}}button' style="border-radius: .28571429rem;">
下载
{{$.i18n.Tr "repo.modelconvert.download"}}
</a> </a>
{{else}} {{else}}
<a class="ui basic disabled button">下载</a>
<a class="ui basic disabled button">{{$.i18n.Tr "repo.modelconvert.download"}}</a>
{{end}} {{end}}
</div> </div>
</div> </div>
@@ -211,7 +210,7 @@
<input type="hidden" name="_csrf" value=""> <input type="hidden" name="_csrf" value="">
<div class="unite min_title required inline fields" id="task_name"> <div class="unite min_title required inline fields" id="task_name">
<div class="three wide field right aligned"> <div class="three wide field right aligned">
<label for="model_convert_name">任务名称</label>
<label for="model_convert_name">{{$.i18n.Tr "repo.modelconvert.taskname"}}</label>
</div> </div>
<div class="twelve wide field"> <div class="twelve wide field">
<input id="model_convert_name" name="model_convert_name" required maxlength="25" onkeyup="this.value=this.value.replace(/[, ]/g,'')"> <input id="model_convert_name" name="model_convert_name" required maxlength="25" onkeyup="this.value=this.value.replace(/[, ]/g,'')">
@@ -219,10 +218,10 @@
</div> </div>
<div class="unite min_title inline fields required"> <div class="unite min_title inline fields required">
<div class="three wide field right aligned"> <div class="three wide field right aligned">
<label for="choice_model">模型名称</label>
<label for="choice_model">{{$.i18n.Tr "repo.modelconvert.modelname"}}</label>
</div> </div>
<div class="ui dropdown selection search eight wide field loading" id="choice_model" name="choice_model"> <div class="ui dropdown selection search eight wide field loading" id="choice_model" name="choice_model">
<div class="default text">选择模型</div>
<div class="default text">{{$.i18n.Tr "repo.modelconvert.selectmodel"}}</div>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
<div class="menu" id="model-name"> <div class="menu" id="model-name">
</div> </div>
@@ -230,12 +229,12 @@
</div> </div>
<div class="unite min_title inline fields required"> <div class="unite min_title inline fields required">
<div class="three wide field right aligned"> <div class="three wide field right aligned">
<label for="choice_version">模型版本</label>
<label for="choice_version">{{$.i18n.Tr "repo.modelconvert.modelversion"}}</label>
</div> </div>
<div class="ui dropdown selection search eight wide field" id="choice_version"> <div class="ui dropdown selection search eight wide field" id="choice_version">
<input type="hidden" id="ModelVersion" name="ModelVersion" required> <input type="hidden" id="ModelVersion" name="ModelVersion" required>
<div class="default text">选择版本</div>
<div class="default text">{{$.i18n.Tr "repo.modelconvert.selectversion"}}</div>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
<div class="menu" id="model-version"> <div class="menu" id="model-version">


@@ -244,11 +243,11 @@
</div> </div>
<div class="unite min_title inline fields required"> <div class="unite min_title inline fields required">
<div class="three wide field right aligned"> <div class="three wide field right aligned">
<label for="choice_file">模型文件</label>
<label for="choice_file">{{$.i18n.Tr "repo.model.manage.modelfile"}}</label>
</div> </div>
<div class="ui dropdown selection search eight wide field" id="choice_file"> <div class="ui dropdown selection search eight wide field" id="choice_file">
<input type="hidden" id="ModelFile" name="ModelFile" required> <input type="hidden" id="ModelFile" name="ModelFile" required>
<div class="default text">选择模型文件</div>
<div class="default text">{{$.i18n.Tr "repo.modelconvert.selectmodelfile"}}</div>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
<div class="menu" id="model-file"> <div class="menu" id="model-file">


@@ -261,7 +260,7 @@
</div> </div>
<div class="unite min_title inline fields required"> <div class="unite min_title inline fields required">
<div class="three wide field right aligned"> <div class="three wide field right aligned">
<label for="SrcEngine">原模型框架</label>
<label for="SrcEngine">{{$.i18n.Tr "repo.modelconvert.srcengine"}}</label>
</div> </div>
<select id="SrcEngine" class="ui search dropdown eight wide field" placeholder="" style='color:#000000;' name="SrcEngine" onchange="javascript:srcEngineChanged()"> <select id="SrcEngine" class="ui search dropdown eight wide field" placeholder="" style='color:#000000;' name="SrcEngine" onchange="javascript:srcEngineChanged()">
@@ -270,7 +269,7 @@
</div> </div>
<div class="unite min_title required inline fields" id="inputdataformat_div"> <div class="unite min_title required inline fields" id="inputdataformat_div">
<div class="three wide field right aligned"> <div class="three wide field right aligned">
<label for="inputdataformat">输入数据格式</label>
<label for="inputdataformat">{{$.i18n.Tr "repo.modelconvert.inputdataformat"}}</label>
</div> </div>
<select id="inputdataformat" class="ui search dropdown eight wide field" placeholder="" style='width:50%' name="inputdataformat"> <select id="inputdataformat" class="ui search dropdown eight wide field" placeholder="" style='width:50%' name="inputdataformat">
@@ -281,16 +280,16 @@
</div> </div>
<div class="unite min_title required inline fields" id="inputshape_div"> <div class="unite min_title required inline fields" id="inputshape_div">
<div class="three wide field right aligned"> <div class="three wide field right aligned">
<label for="inputshape">输入张量形状</label>
<label for="inputshape">{{$.i18n.Tr "repo.modelconvert.inputshape"}}</label>
</div> </div>
<div class="eight wide field"> <div class="eight wide field">
<input id="inputshape" name="inputshape" placeholder="如:1,1,32,32,与输入数据格式对应。" required maxlength="25">
<input id="inputshape" name="inputshape" placeholder="{{$.i18n.Tr "repo.modelconvert.inputshapetip"}}" required maxlength="25">
</div> </div>
</div> </div>
<div class="unite min_title inline fields required"> <div class="unite min_title inline fields required">
<div class="three wide field right aligned"> <div class="three wide field right aligned">
<label for="DestFormat">转换后格式</label>
<label for="DestFormat">{{$.i18n.Tr "repo.modelconvert.outputformat"}}</label>
</div> </div>
<select id="DestFormat" class="ui search dropdown eight wide field" placeholder="" style='width:50%' name="DestFormat"> <select id="DestFormat" class="ui search dropdown eight wide field" placeholder="" style='width:50%' name="DestFormat">
@@ -300,7 +299,7 @@
</div> </div>
<div class="unite min_title inline fields"> <div class="unite min_title inline fields">
<div class="three wide field right aligned"> <div class="three wide field right aligned">
<label for="NetOutputFormat">网络输出数据类型&nbsp;&nbsp;</label>
<label for="NetOutputFormat">{{$.i18n.Tr "repo.modelconvert.netoutputdata"}}&nbsp;&nbsp;</label>
</div> </div>
<select id="NetOutputFormat" class="ui search dropdown eight wide field" placeholder="" style='width:50%' name="NetOutputFormat"> <select id="NetOutputFormat" class="ui search dropdown eight wide field" placeholder="" style='width:50%' name="NetOutputFormat">
@@ -310,7 +309,7 @@
</div> </div>
<div class="unite min_title inline fields"> <div class="unite min_title inline fields">
<div class="three wide field right aligned"> <div class="three wide field right aligned">
<label for="Description">任务描述&nbsp;&nbsp;</label>
<label for="Description">{{$.i18n.Tr "repo.modelconvert.taskdesc"}}&nbsp;&nbsp;</label>
</div> </div>
<div class="twelve wide field"> <div class="twelve wide field">
<textarea id="Description" name="Description" rows="1" maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}' onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 256)"></textarea> <textarea id="Description" name="Description" rows="1" maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}' onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 256)"></textarea>
@@ -318,7 +317,7 @@
</div> </div>
<div class="unite min_title inline field"> <div class="unite min_title inline field">
<button id="submitId" name="submitId" type="button" class="ui create_train_job green button" style="position: absolute;margin-left: 150px;"> <button id="submitId" name="submitId" type="button" class="ui create_train_job green button" style="position: absolute;margin-left: 150px;">
新建任务
{{$.i18n.Tr "repo.modelconvert.newtask"}}
</button> </button>
</div> </div>
</div> </div>
@@ -357,7 +356,7 @@
data['name']= $('#model_convert_name').val() data['name']= $('#model_convert_name').val()


if(data['name']==""){ if(data['name']==""){
$('.ui.error.message').text("请输入任务名称。")
$('.ui.error.message').text("{{.i18n.Tr "repo.modelconvert.tasknameempty"}}")
$('.ui.error.message').css('display','block') $('.ui.error.message').css('display','block')
$("#task_name").addClass("error") $("#task_name").addClass("error")
return false return false
@@ -371,7 +370,7 @@
data['inputshape']= $('#inputshape').val(); data['inputshape']= $('#inputshape').val();


if(inputshapeNotValid(data['inputshape'])){ if(inputshapeNotValid(data['inputshape'])){
$('.ui.error.message').text("格式输入错误,请输入如:1,1,32,32,与输入数据格式对应。")
$('.ui.error.message').text("{{.i18n.Tr "repo.modelconvert.inputshapeerror"}}")
$('.ui.error.message').css('display','block') $('.ui.error.message').css('display','block')
$("#inputshape_div").addClass("error") $("#inputshape_div").addClass("error")
return false return false
@@ -411,7 +410,7 @@
.modal({ .modal({
centered: false, centered: false,
onShow:function(){ onShow:function(){
$('#model_header').text("创建模型转换任务")
$('#model_header').text("{{.i18n.Tr "repo.modelconvert.createtask"}}")
$('.ui.dimmer').css({"background-color":"rgb(136, 136, 136,0.7)"}) $('.ui.dimmer').css({"background-color":"rgb(136, 136, 136,0.7)"})
createModelName() createModelName()
loadModelList() loadModelList()


+ 11
- 11
templates/repo/modelmanage/convertshowinfo.tmpl View File

@@ -173,7 +173,7 @@ td, th {
<h4 class="ui header" id="vertical-segment"> <h4 class="ui header" id="vertical-segment">
<div class="ui breadcrumb"> <div class="ui breadcrumb">
<a class="section" href="{{$.RepoLink}}/modelmanage/convert_model"> <a class="section" href="{{$.RepoLink}}/modelmanage/convert_model">
模型转换任务
{{.i18n.Tr "repo.modelconvert.taskurlname"}}
</a> </a>
<div class="divider"> / </div> <div class="divider"> / </div>
<div class="active section">{{.Name}}</div> <div class="active section">{{.Name}}</div>
@@ -243,7 +243,7 @@ td, th {


<tr class="ti-no-ng-animate"> <tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80"> <td class="ti-no-ng-animate ti-text-form-label text-width80">
输入张量形状
{{$.i18n.Tr "repo.modelconvert.inputshape"}}
</td> </td>


<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -255,7 +255,7 @@ td, th {
<tr class="ti-no-ng-animate"> <tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80"> <td class="ti-no-ng-animate ti-text-form-label text-width80">
输入数据格式
{{$.i18n.Tr "repo.modelconvert.inputdataformat"}}
</td> </td>


<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -291,7 +291,7 @@ td, th {


<tr class="ti-no-ng-animate"> <tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80"> <td class="ti-no-ng-animate ti-text-form-label text-width80">
网络输出数据类型
{{$.i18n.Tr "repo.modelconvert.netoutputdata"}}
</td> </td>
<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -311,7 +311,7 @@ td, th {
<tr class="ti-no-ng-animate"> <tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80"> <td class="ti-no-ng-animate ti-text-form-label text-width80">
模型名称
{{$.i18n.Tr "repo.modelconvert.modelname"}}
</td> </td>


<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -324,7 +324,7 @@ td, th {


<tr class="ti-no-ng-animate"> <tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80"> <td class="ti-no-ng-animate ti-text-form-label text-width80">
模型版本
{{$.i18n.Tr "repo.modelconvert.modelversion"}}
</td> </td>


<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -337,7 +337,7 @@ td, th {


<tr class="ti-no-ng-animate"> <tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80"> <td class="ti-no-ng-animate ti-text-form-label text-width80">
模型文件
{{$.i18n.Tr "repo.model.manage.modelfile"}}
</td> </td>


<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -350,7 +350,7 @@ td, th {


<tr class="ti-no-ng-animate"> <tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80"> <td class="ti-no-ng-animate ti-text-form-label text-width80">
原模型框架
{{$.i18n.Tr "repo.modelconvert.srcengine"}}
</td> </td>


<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -362,7 +362,7 @@ td, th {


<tr class="ti-no-ng-animate"> <tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80"> <td class="ti-no-ng-animate ti-text-form-label text-width80">
转换后格式
{{$.i18n.Tr "repo.modelconvert.outputformat"}}
</td> </td>


<td class="ti-text-form-content"> <td class="ti-text-form-content">
@@ -439,10 +439,10 @@ td, th {
<div class="ui tab" data-tab="five"> <div class="ui tab" data-tab="five">
<div style="position: relative;"> <div style="position: relative;">
<span> <span>
<a title="滚动到顶部" style="position: absolute; right: -32px;cursor: pointer;" class="log_top" data-version="V0001"><i class="icon-to-top"></i></a>
<a title="{{$.i18n.Tr "repo.log_scroll_start"}}" style="position: absolute; right: -32px;cursor: pointer;" class="log_top" data-version="V0001"><i class="icon-to-top"></i></a>
</span> </span>
<span> <span>
<a title="滚动到底部" style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;" class="log_bottom" data-version="V0001"><i class="icon-to-bottom"></i></a>
<a title="{{$.i18n.Tr "repo.log_scroll_end"}}" style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;" class="log_bottom" data-version="V0001"><i class="icon-to-bottom"></i></a>
</span> </span>
<div id="log_npu_message" class="ui message message" style="display: none;"> <div id="log_npu_message" class="ui message message" style="display: none;">
<div id="log_npu_header"></div> <div id="log_npu_header"></div>


+ 18
- 19
templates/repo/modelmanage/index.tmpl View File

@@ -64,17 +64,16 @@
{{if eq $.MODEL_COUNT 0}} {{if eq $.MODEL_COUNT 0}}
<div class="ui placeholder segment bgtask-none"> <div class="ui placeholder segment bgtask-none">
<div class="ui icon header bgtask-header-pic"></div> <div class="ui icon header bgtask-header-pic"></div>
<div class="bgtask-content-header">未创建过模型</div>
<div class="bgtask-content-header">{{$.i18n.Tr "repo.model.manage.notcreatemodel"}}</div>
<div class="bgtask-content"> <div class="bgtask-content">
{{if $.RepoIsEmpty}} {{if $.RepoIsEmpty}}
<div class="bgtask-content-txt">代码版本:您还没有初始化代码仓库,请先<a href="{{.RepoLink}}">创建代码版本;</a></div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.model.manage.init1"}}<a href="{{.RepoLink}}">{{$.i18n.Tr "repo.model.manage.init2"}}</a></div>
{{end}} {{end}}
{{if eq $.TRAIN_COUNT 0}} {{if eq $.TRAIN_COUNT 0}}
<div class="bgtask-content-txt">训练任务:您还没创建过训练任务,请先创建<a
href="{{.RepoLink}}/modelarts/train-job">训练任务</a>。</div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.model.manage.createtrainjob_tip"}}<a
href="{{.RepoLink}}/modelarts/train-job">{{$.i18n.Tr "repo.model.manage.createtrainjob"}}</a>。</div>
{{end}} {{end}}
<div class="bgtask-content-txt">使用说明:可以参考启智AI协作平台<a
href="https://git.openi.org.cn/zeizei/OpenI_Learning">小白训练营课程。</a></div>
<div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions"}}</a></div>


</div> </div>
<div style="display: none;"> <div style="display: none;">
@@ -108,11 +107,11 @@
<div id="deletemodel"> <div id="deletemodel">
<div class="ui basic modal first"> <div class="ui basic modal first">
<div class="ui icon header"> <div class="ui icon header">
<i class="trash icon"></i> 删除模型
<i class="trash icon"></i> {{.i18n.Tr "repo.model.manage.delete"}}
</div> </div>


<div class="content"> <div class="content">
<p>你确认删除该模型么?此模型一旦删除不可恢复。</p>
<p>{{.i18n.Tr "repo.model.manage.delete_confirm"}}</p>
</div> </div>
<div class="actions"> <div class="actions">
<div class="ui red basic inverted cancel button"> <div class="ui red basic inverted cancel button">
@@ -139,21 +138,21 @@
<input type="hidden" name="_csrf" value=""> <input type="hidden" name="_csrf" value="">
<div class="inline fields"> <div class="inline fields">
<div class="required two wide field right aligned"> <div class="required two wide field right aligned">
<label for="JobId">选择训练任务</label>
<label for="JobId">{{.i18n.Tr "repo.model.manage.select.trainjob"}}</label>
</div> </div>
<div class="required thirteen wide inline field"> <div class="required thirteen wide inline field">
<div class="ui dropdown selection search loading" id="choice_model"> <div class="ui dropdown selection search loading" id="choice_model">
<input type="hidden" id="JobId" name="JobId" required> <input type="hidden" id="JobId" name="JobId" required>
<div class="default text">选择训练任务</div>
<div class="default text">{{.i18n.Tr "repo.model.manage.select.trainjob"}}</div>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
<div class="menu" id="job-name"> <div class="menu" id="job-name">
</div> </div>
</div> </div>
<label for="VersionName">版本</label>
<label for="VersionName">{{.i18n.Tr "repo.model.manage.version"}}</label>
<span>&nbsp;</span> <span>&nbsp;</span>
<div class="ui dropdown selection search" id="choice_version"> <div class="ui dropdown selection search" id="choice_version">
<input type="hidden" id="VersionName" name="VersionName" required> <input type="hidden" id="VersionName" name="VersionName" required>
<div class="default text">选择版本</div>
<div class="default text">{{.i18n.Tr "repo.model.manage.select.version"}}</div>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
<div class="menu" id="job-version"> <div class="menu" id="job-version">


@@ -163,7 +162,7 @@
</div> </div>
<div class="required inline fields" id="modelname"> <div class="required inline fields" id="modelname">
<div class="two wide field right aligned"> <div class="two wide field right aligned">
<label for="Name">模型名称</label>
<label for="Name">{{.i18n.Tr "repo.model.manage.model_name"}}</label>
</div> </div>
<div class="eight wide field"> <div class="eight wide field">
<input id="name" name="Name" required maxlength="25" onkeyup="this.value=this.value.replace(/[, ]/g,'')"> <input id="name" name="Name" required maxlength="25" onkeyup="this.value=this.value.replace(/[, ]/g,'')">
@@ -171,7 +170,7 @@
</div> </div>
<div class="required inline fields" id="verionname"> <div class="required inline fields" id="verionname">
<div class="two wide field right aligned"> <div class="two wide field right aligned">
<label for="Version">模型版本</label>
<label for="Version">{{.i18n.Tr "repo.model.manage.version"}}</label>
</div> </div>
<div class="eight wide field"> <div class="eight wide field">
<input id="version" name="Version" value="" readonly required maxlength="255"> <input id="version" name="Version" value="" readonly required maxlength="255">
@@ -180,11 +179,11 @@


<div class="unite min_title inline fields required"> <div class="unite min_title inline fields required">
<div class="two wide field right aligned"> <div class="two wide field right aligned">
<label for="Engine">模型框架</label>
<label for="Engine">{{.i18n.Tr "repo.model.manage.engine"}}</label>
</div> </div>
<div class="ui ten wide field dropdown selection search" id="choice_Engine"> <div class="ui ten wide field dropdown selection search" id="choice_Engine">
<input type="hidden" id="Engine" name="Engine" required> <input type="hidden" id="Engine" name="Engine" required>
<div class="default text newtext">选择模型框架</div>
<div class="default text newtext">{{.i18n.Tr "repo.model.manage.select.engine"}}</div>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
<div class="menu" id="job-Engine"> <div class="menu" id="job-Engine">


@@ -195,7 +194,7 @@


<div class="unite min_title inline fields required"> <div class="unite min_title inline fields required">
<div class="two wide field right aligned"> <div class="two wide field right aligned">
<label for="modelSelectedFile">模型文件</label>
<label for="modelSelectedFile">{{.i18n.Tr "repo.model.manage.modelfile"}}</label>
</div> </div>
<div class="thirteen wide field" style="position:relative"> <div class="thirteen wide field" style="position:relative">
<input id="modelSelectedFile" type="text" readonly required onclick="showMenu();" name="modelSelectedFile" > <input id="modelSelectedFile" type="text" readonly required onclick="showMenu();" name="modelSelectedFile" >
@@ -207,7 +206,7 @@


<div class="inline fields"> <div class="inline fields">
<div class="two wide field right aligned"> <div class="two wide field right aligned">
<label for="Label">模型标签 &nbsp</label>
<label for="Label">{{.i18n.Tr "repo.model.manage.modellabel"}} &nbsp</label>
</div> </div>
<div class="thirteen wide field"> <div class="thirteen wide field">
<input id="label" name="Label" maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'> <input id="label" name="Label" maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'>
@@ -215,7 +214,7 @@
</div> </div>
<div class="inline fields"> <div class="inline fields">
<div class="two wide field right aligned"> <div class="two wide field right aligned">
<label for="description">模型描述 &nbsp</label>
<label for="description">{{.i18n.Tr "repo.model.manage.modeldesc"}} &nbsp</label>
</div> </div>
<div class="thirteen wide field"> <div class="thirteen wide field">
<textarea id="Description" name="Description" rows="3" <textarea id="Description" name="Description" rows="3"


+ 2
- 2
templates/repo/modelmanage/showinfo.tmpl View File

@@ -86,7 +86,7 @@
</div> </div>
<div class="ui tab active" data-tab="first"> <div class="ui tab active" data-tab="first">
<div class="half-table"> <div class="half-table">
<span class="model_header_text">基本信息</span>
<span class="model_header_text">{{$.i18n.Tr "repo.model.manage.baseinfo"}}</span>
<table class="tableStyle" style="margin-top:20px;"> <table class="tableStyle" style="margin-top:20px;">
<tbody> <tbody>
<tr> <tr>
@@ -125,7 +125,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="ti-text-form-label text-width80">训练任务</td>
<td class="ti-text-form-label text-width80">{{$.i18n.Tr "repo.model.manage.createtrainjob"}}</td>
<td class="ti-text-form-content word-elipsis"> <td class="ti-text-form-content word-elipsis">
<a id="DisplayJobNameHref" class="title" style="font-size: 14px;" target="_blank"> <a id="DisplayJobNameHref" class="title" style="font-size: 14px;" target="_blank">
<span id="DisplayJobName" class="fitted" style="width: 90%;vertical-align: middle;"></span> <span id="DisplayJobName" class="fitted" style="width: 90%;vertical-align: middle;"></span>


+ 3
- 1
web_src/js/components/MinioUploader.vue View File

@@ -18,7 +18,7 @@
<label <label
class="el-form-item__label" class="el-form-item__label"
style="width: 140px; position: absolute; left: -140px" style="width: 140px; position: absolute; left: -140px"
>上传状态:</label
>{{ upload_status }}:</label
> >
<div v-for="(item, index) in uploadFiles" class="datast-upload-progress"> <div v-for="(item, index) in uploadFiles" class="datast-upload-progress">
<span class="dataset-name nowrap" :title="item.name">{{ <span class="dataset-name nowrap" :title="item.name">{{
@@ -103,6 +103,7 @@ export default {
btnFlag: false, btnFlag: false,
cancel: "", cancel: "",
upload: "", upload: "",
upload_status: "",
uploadFiles: [], uploadFiles: [],
uploadFilesAddId: [], uploadFilesAddId: [],
// allUploadFiles: [], // allUploadFiles: [],
@@ -119,6 +120,7 @@ export default {
this.repoPath = this.dropzoneParams.data("repopath"); this.repoPath = this.dropzoneParams.data("repopath");
this.cancel = this.dropzoneParams.data("cancel"); this.cancel = this.dropzoneParams.data("cancel");
this.upload = this.dropzoneParams.data("upload"); this.upload = this.dropzoneParams.data("upload");
this.upload_status = this.dropzoneParams.data("upload-status");
let previewTemplate = ` let previewTemplate = `
<div class="dz-preview dz-file-preview"> <div class="dz-preview dz-file-preview">
<div class="dz-image"> <div class="dz-image">


+ 20
- 14
web_src/js/components/Model.vue View File

@@ -14,7 +14,7 @@
> >
<el-table-column <el-table-column
prop="Name" prop="Name"
label="模型名称"
:label="i18n.model_name"
align="left" align="left"
min-width="18%" min-width="18%"
> >
@@ -28,7 +28,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="Version" prop="Version"
label="版本"
:label="i18n.model_version"
align="center" align="center"
min-width="6.5%" min-width="6.5%"
> >
@@ -39,7 +39,7 @@
<el-table-column <el-table-column
prop="VersionCount" prop="VersionCount"
label="版本数"
:label="i18n.model_version_num"
align="center" align="center"
min-width="7.5%" min-width="7.5%"
> >
@@ -50,7 +50,7 @@


<el-table-column <el-table-column
prop="Size" prop="Size"
label="模型大小"
:label="i18n.model_size"
align="center" align="center"
min-width="10.5%" min-width="10.5%"
> >
@@ -60,7 +60,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="EngineName" prop="EngineName"
label="模型框架"
:label="i18n.model_egine"
align="center" align="center"
min-width="8.5%" min-width="8.5%"
> >
@@ -70,7 +70,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="ComputeResource" prop="ComputeResource"
label="计算资源"
:label="i18n.model_compute_resource"
align="center" align="center"
min-width="10.5%" min-width="10.5%"
> >
@@ -80,7 +80,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="CreatedUnix" prop="CreatedUnix"
label="创建时间"
:label="i18n.model_create_time"
align="center" align="center"
min-width="13.75%" min-width="13.75%"
> >
@@ -90,7 +90,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="UserName" prop="UserName"
label="创建者"
:label="i18n.model_creator"
align="center" align="center"
min-width="6.75%" min-width="6.75%"
> >
@@ -101,12 +101,12 @@
</template> </template>
</el-table-column> </el-table-column>


<el-table-column label="操作" min-width="18%" align="center">
<el-table-column :label="i18n.model_operation" min-width="18%" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="space-around"> <div class="space-around">
<a :style="{visibility:!scope.row.Children ? 'visible':'hidden'}" :class="{'disabled':!scope.row.IsCanOper}" @click="showcreateVue(scope.row.Name,scope.row.Version,scope.row.Label)">创建新版本</a>
<a :href="loadhref+scope.row.ID" :class="{'disabled':!scope.row.IsCanOper}">下载</a>
<a :class="{'disabled':!scope.row.IsCanDelete}" @click="deleteModel(scope.row.ID,scope.row.cName,scope.row.rowKey)">删除</a>
<a :style="{visibility:!scope.row.Children ? 'visible':'hidden'}" :class="{'disabled':!scope.row.IsCanOper}" @click="showcreateVue(scope.row.Name,scope.row.Version,scope.row.Label)">{{i18n.model_create_new_ver}}</a>
<a :href="loadhref+scope.row.ID" :class="{'disabled':!scope.row.IsCanOper}">{{i18n.model_download}}</a>
<a :class="{'disabled':!scope.row.IsCanDelete}" @click="deleteModel(scope.row.ID,scope.row.cName,scope.row.rowKey)">{{i18n.model_delete}}</a>
</div> </div>
</template> </template>
@@ -141,7 +141,7 @@ export default {
}, },
data() { data() {
return { return {
i18n: {},
currentPage:1, currentPage:1,
pageSize:10, pageSize:10,
totalNum:0, totalNum:0,
@@ -451,7 +451,13 @@ export default {
this.url_create_newVersion = this.url + 'create_model' this.url_create_newVersion = this.url + 'create_model'
this.url_create_newModel = this.url + 'create_new_model' this.url_create_newModel = this.url + 'create_new_model'
}, },

created() {
if (document.documentElement.attributes["lang"].nodeValue == "en-US") {
this.i18n = this.$locale.US;
} else {
this.i18n = this.$locale.CN;
}
},
beforeDestroy() { // 实例销毁之前对点击事件进行解绑 beforeDestroy() { // 实例销毁之前对点击事件进行解绑
this.submitId.removeEventListener('click', this.submit); this.submitId.removeEventListener('click', this.submit);
} }


+ 738
- 0
web_src/js/components/dataset/referenceDataset.vue View File

@@ -0,0 +1,738 @@
<template>
<div>
<template v-if="showFlag">
<div v-loading="loadingLinkPage">
<div class="ui container">
<div class="ui mobile reversed stackable grid">
<div class="row" style="justify-content: space-between">
<div class="ui blue small menu compact selectcloudbrain">
<a class="item" :href="`${repoLink}/datasets`">{{
i18n.current_dataset
}}</a>
<a
class="active item"
:href="`${repoLink}/datasets/reference_datasets`"
>{{ i18n.linked_datasets }}</a
>
</div>
<button
style="margin-right: 2rem"
class="ui green button"
:class="{ disabled: !canWrite }"
@click="openDataset()"
>
{{ i18n.linked_datasets }}
</button>
</div>
<div class="row">
<div class="ui two cards" style="width: 100%">
<div
class="ui card refer-dataset-card"
v-for="(item, index) in datasetList"
:key="index"
@click="gotoDataset(item)"
>
<div class="content" style="border-bottom: none">
<div class="refer-dataset-card-content">
<div class="refer-dataset-card-title">
<span
:title="item.Title"
class="nowrap"
style="display: inline-block; max-width: 90%"
>{{ item.Title }}</span
><img
v-if="item.Recommend"
src="/img/jian.svg"
style="margin-left: 0.5rem"
/>
</div>
<template v-if="item.IsStaring">
<div style="display: flex">
<button
class="ui mini basic button dataset-card-flavor"
@click.stop="postStar(item, isSigned)"
>
<i class="ri-heart-fill" style="color: #fa8c16"></i>
<span style="margin-left: 0.3rem">{{
i18n.unfavorite
}}</span>
</button>
<a class="ui mini basic button card-flavor-num">
{{ item.NumStars }}
</a>
</div>
</template>
<template v-else>
<div style="display: flex">
<button
class="ui mini basic button dataset-card-flavor"
@click.stop="postStar(item, isSigned)"
>
<i class="ri-heart-line"></i>
<span style="margin-left: 0.3rem">{{
i18n.favorite
}}</span>
</button>
<a class="ui mini basic button card-flavor-num">
{{ item.NumStars }}
</a>
</div>
</template>
</div>
<div style="font-size: 12px; margin-top: 5px">
<a
v-if="item.Category"
:href="'/explore/datasets?category=' + item.Category"
class="ui repo-topic label topic"
@click.stop
>{{ i18n[item.Category] || item.Category }}</a
>
<a
v-if="item.Task"
:href="'/explore/datasets?task=' + item.Task"
class="ui repo-topic label topic"
@click.stop
>{{ i18n[item.Task] || item.Task }}</a
>
<a
v-if="item.License"
:href="'/explore/datasets?license=' + item.License"
class="ui repo-topic label topic"
@click.stop
>{{ item.License }}</a
>
</div>
<div class="description card-flavor-desc">
<p>{{ item.Description }}</p>
</div>
</div>
<div
class="extra content"
style="border-top: none !important"
>
<div style="display: flex; align-items: center">
<a
:href="'/' + item.Repo.OwnerName"
:title="item.Repo.OwnerName"
@click.stop
>
<img
class="ui avatar image"
style="width: 22px; height: 22px"
:src="'/user/avatar/' + item.Repo.OwnerName + '/-1'"
/>
</a>
<span
style="
color: #999999;
font-size: 12px;
margin-left: 0.5rem;
"
>{{ item.CreatedUnix | transformTimestamp }}</span
>
<span
style="
display: flex;
align-items: center;
justify-content: center;
margin: 0 1rem;
"
:title="i18n.citations"
>
<i class="ri-link"></i>
<span
style="
color: #101010;
font-size: 12px;
margin-left: 0.2rem;
"
>{{ item.UseCount }}</span
>
</span>
<span
style="display: flex; align-items: center; flex: 1"
:title="i18n.downloads"
>
<i class="ri-download-line"></i>
<span
style="
color: #101010;
font-size: 12px;
margin-left: 0.2rem;
"
>{{ item.DownloadTimes }}</span
>
</span>
<button
class="ui mini button"
:class="{ disabled1: !canWrite }"
@click.stop="
cancelReferData(item.ID, item.Title, canWrite)
"
>
{{ i18n.disassociate }}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<template v-else>
<div class="ui container">
<div class="ui mobile reversed stackable grid">
<div class="row" style="justify-content: space-between">
<div class="ui blue small menu compact selectcloudbrain">
<a class="item" :href="`${repoLink}/datasets`">{{
i18n.current_dataset
}}</a>
<a
class="active item"
:href="`${repoLink}/datasets/reference_datasets`"
>{{ i18n.linked_datasets }}</a
>
</div>
<button class="ui green button" @click="openDataset()">
{{ i18n.linked_datasets }}
</button>
</div>
</div>
<div class="ui placeholder segment bgtask-none">
<div class="ui icon header bgtask-header-pic"></div>
<div class="bgtask-content-header">{{ i18n.not_link_dataset }}</div>
<div class="bgtask-content">
<div class="bgtask-content-txt">
{{ i18n.no_link_dataset_tips1 }}
</div>
<div class="bgtask-content-txt">
{{ i18n.dataset_instructions_for_use
}}<a href="https://git.openi.org.cn/zeizei/OpenI_Learning">{{
i18n.dataset_camp_course
}}</a>
</div>
</div>
</div>
</div>
</template>

<el-dialog
:title="i18n.linked_datasets"
:visible.sync="dialogVisible"
:width="dialogWidth"
@closed="refreshData"
>
<div class="ui icon input dataset-search-vue">
<i
class="search icon"
style="cursor: pointer; pointer-events: auto"
@click="searchName"
></i>
<input
type="text"
:placeholder="i18n.search_dataset"
v-model="search"
@keydown.enter.stop.prevent="searchName"
/>
</div>
<el-row>
<el-col
:span="17"
style="
padding-right: 1rem;
border-right: 1px solid #f5f5f6;
position: relative;
"
>
<el-tabs v-model="activeName">
<el-tab-pane :label="i18n.public_dataset" name="first">
<el-row v-loading="loadingPublicPage">
<el-checkbox-group
v-model="checkList"
style="font-size: 14px; line-height: 1"
>
<div
v-for="(item, index) in publicDatasetList"
:key="index"
class="select-data-wrap"
>
<div class="dataset-header-vue">
<el-checkbox
:label="item.ID"
@change="(checked) => changeCheckbox(checked, item)"
:title="item.Title"
class="select-data-title"
style="display: flex; align-items: end"
><span class="ref-data-title">
<span
style="overflow: hidden; text-overflow: ellipsis"
>
{{ item.Title }}
</span>
<img
v-if="item.Recommend"
src="/img/jian.svg"
style="margin-left: 0.5rem"
/> </span
></el-checkbox>
<a
class="select-data-title select-data-href"
:href="`/${item.Repo.OwnerName}/${item.Repo.Name}/datasets`"
:title="`${item.Repo.OwnerName}/${item.Repo.Alias}`"
style="font-size: 12px"
>{{ item.Repo.OwnerName }}/{{ item.Repo.Alias }}</a
>
</div>
<div class="data-multiple-wrap" :title="item.Description">
{{ item.Description }}
</div>
</div>
</el-checkbox-group>
</el-row>
<div
class="ui container"
style="margin-top: 25px; text-align: center"
>
<el-pagination
background
@current-change="currentChange"
:current-page="currentPage"
:page-size="5"
layout="total, prev, pager, next"
:total="totalNum"
>
</el-pagination>
</div>
</el-tab-pane>
</el-tabs>
</el-col>
<el-col
:span="7"
style="
display: flex;
flex-direction: column;
height: 100%;
right: 0;
position: absolute;
padding: 0 1.5rem;
"
>
<div
style="
font-size: 14px;
height: 40px;
text-align: left;
color: #0066ff;
line-height: 40px;
"
>
{{ i18n.selected_data_file }}
</div>
<div
style="
flex: 1;
margin-top: 1.5rem;
margin-bottom: 1rem;
overflow-y: auto;
"
>
<el-checkbox-group v-model="checkList">
<el-checkbox
v-for="(item, index) in selectDatasetArray"
:key="index"
:label="item.ID"
:title="item.Title"
@change="(checked) => changeCheckSelected(checked, item)"
style="display: flex; margin: 0.5rem 0"
><span class="select-data-right">{{
item.Title
}}</span></el-checkbox
>
</el-checkbox-group>
</div>
<div style="text-align: end">
<el-button
@click.native="confirmDataset"
size="small"
style="
background: #389e0d;
color: #fff;
border: 1px solid #389e0d;
"
>{{ i18n.sure }}</el-button
>
</div>
</el-col>
</el-row>
</el-dialog>
</div>
</template>

<script>
const { _AppSubUrl, _StaticUrlPrefix, csrf } = window.config;

export default {
components: {},
data() {
return {
dialogWidth: "65%",
dialogVisible: false,
activeName: "first",
repoLink: "",
datasetList: [],
test: false,
checkList: [],
publicDatasetList: [],
showFlag: true,
search: "",
selectDatasetArray: [],
paramsPublics: { page: 1, q: "" },

i18n: {},

totalNum: 0,
currentPage: 1,
loadingLinkPage: false,
loadingPublicPage: false,
canWrite: true,
isSigned: false,
maxReferenceNum: 20,
isCurrentUrl: true,
};
},
methods: {
openDataset() {
this.checkList = this.datasetList.map((item) => {
this.selectDatasetArray.push({ ID: item.ID, Title: item.Title });
return item.ID;
});
this.dialogVisible = true;
this.getDatasetList();
},
refreshData() {
this.checkList = [];
this.selectDatasetArray = [];
},
gotoDataset(item) {
window.open(`/${item.Repo.OwnerName}/${item.Repo.Name}/datasets`);
},
currentChange(page) {
this.paramsPublics.page = page;
this.getDatasetList();
},
searchName() {
this.paramsPublics.q = this.search;
this.paramsPublics.page = 1;
this.getDatasetList();
},
cancelReferData(id, name, canWrite) {
if (!canWrite) {
return;
}
let url = `${this.repoLink}/datasets/reference_datasets/${id}`;
this.$axios
.delete(url)
.then((res) => {
if (res.data.Code === 0) {
this.$message.success(this.i18n.cancel_link_dataset.format(name));
let index = this.datasetList.findIndex((item) => {
return item.ID === id;
});
this.datasetList.splice(index, 1);
if (this.datasetList.length === 0) {
this.showFlag = false;
}
} else {
this.$message.error(res.data.Message);
}
})
.catch((err) => {
this.$message.error(this.i18n.dataset_link_failed);
console.log(err);
});
},
confirmDataset() {
this.submitReferDataset();
this.dialogVisible = false;
},
changeCheckbox(checked, item) {
if (this.checkList.length > this.maxReferenceNum) {
this.checkList.pop();
this.$message.error(
this.i18n.dataset_over_nums.format(this.maxReferenceNum)
);
return;
}
if (this.checkList.length === this.maxReferenceNum && !checked) {
this.$message.error(
this.i18n.dataset_over_nums.format(this.maxReferenceNum)
);
return;
}
if (checked) {
this.selectDatasetArray.push({ ID: item.ID, Title: item.Title });
} else {
let index = this.selectDatasetArray.findIndex((element) => {
return element.ID === item.ID;
});
this.selectDatasetArray.splice(index, 1);
}
},
changeCheckSelected(checked, item) {
let index = this.selectDatasetArray.findIndex((element) => {
return element.ID === item.ID;
});
this.selectDatasetArray.splice(index, 1);
},
postStar(item, isSigned) {
if (!isSigned) {
return;
}
if (item.IsStaring) {
let url = `${this.repoLink}/datasets/${item.ID}/unstar`;
this.$axios.put(url).then((res) => {
if (res.data.Code === 0) {
this.datasetList.forEach((element, i) => {
if (element.ID === item.ID) {
this.datasetList[i].NumStars -= 1;
this.datasetList[i].IsStaring = !this.datasetList[i].IsStaring;
}
});
}
});
} else {
let url = `${this.repoLink}/datasets/${item.ID}/star`;
this.$axios.put(url).then((res) => {
if (res.data.Code === 0) {
this.datasetList.forEach((element, i) => {
if (element.ID === item.ID) {
this.datasetList[i].NumStars += 1;
this.datasetList[i].IsStaring = !this.datasetList[i].IsStaring;
}
});
}
});
}
},

getSelectDatasetList() {
this.loadingLinkPage = true;
let url = `${this.repoLink}/datasets/reference_datasets_data`;
this.$axios.get(url).then((res) => {
this.loadingLinkPage = false;
if (!res.data) {
this.showFlag = false;
this.datasetList = [];
return;
} else {
this.datasetList = res.data;
this.datasetList.length
? (this.showFlag = true)
: (this.showFlag = false);
}
});
},
getDatasetList() {
this.loadingPublicPage = true;
let url = `${this.repoLink}/datasets/reference_datasets_available`;
this.$axios
.get(url, {
params: this.paramsPublics,
})
.then((res) => {
this.publicDatasetList = JSON.parse(res.data.data);
this.totalNum = parseInt(res.data.count);
this.loadingPublicPage = false;
});
},
submitReferDataset() {
if (this.checkList.length > this.maxReferenceNum) {
this.$message.error(
this.i18n.dataset_over_nums.format(this.maxReferenceNum)
);
return;
}
let url = `${this.repoLink}/datasets/reference_datasets`;
let data = this.qs.stringify(
{
_csrf: csrf,
dataset_id: this.checkList,
},
{ arrayFormat: "repeat" }
);
this.$axios
.post(url, data)
.then((res) => {
if (res.data.Code === 0) {
this.$message.success(this.i18n.dataset_link_success);
this.getSelectDatasetList();
} else {
this.$message.error(res.data.Message);
}
})
.catch((err) => {
this.$message.error(this.i18n.dataset_link_failed);
console.log(err);
});
},
},

filters: {
transformTimestamp(timestamp) {
const date = new Date(parseInt(timestamp) * 1000);
const Y = date.getFullYear() + "-";
const M =
(date.getMonth() + 1 < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1) + "-";
const D =
(date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";

const dateString = Y + M + D;
return dateString;
},
},
watch: {
search(val) {
if (!val) {
this.searchName();
}
},
showFlag(val) {
if (!val || this.isCurrentUrl) {
document
.getElementById("header-dataset")
.setAttribute("href", this.repoLink + "/datasets");
} else {
document
.getElementById("header-dataset")
.setAttribute("href", this.repoLink + "/datasets/reference_datasets");
}
},
},
mounted() {
this.getSelectDatasetList();
},
created() {
this.repoLink = $(".reference-dataset").data("repolink") || "";
this.canWrite = $(".reference-dataset").data("canwrite");
this.isSigned = $(".reference-dataset").data("is-sign");
this.maxReferenceNum = $(".reference-dataset").data("max-reference-num");
this.isCurrentUrl = $(".reference-dataset").data("address");
if (document.documentElement.attributes["lang"].nodeValue == "en-US") {
this.i18n = this.$locale.US;
} else {
this.i18n = this.$locale.CN;
}
},
beforeDestroy() {},
};
</script>

<style scoped>
.dataset-search-vue {
z-index: 9999;
position: absolute;
right: 31%;
height: 30px;
top: 60px;
}
.refer-dataset-card {
cursor: pointer;
box-shadow: 0px 4px 4px 0px rgba(232, 232, 232, 0.6);
border: 1px solid rgba(232, 232, 232, 1);
}
.refer-dataset-card .refer-dataset-card-content {
font-size: 16px;
color: #0366d6;
font-family: SourceHanSansSC-medium;
height: 34px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: space-between;
}
.refer-dataset-card-title {
display: flex;
align-items: center;
max-width: 80%;
width: 100%;
}
.dataset-card-flavor {
display: flex;
align-items: center;
padding: 0.3rem 0.5rem;
border: #888888;
border-top-right-radius: 0 !important;
border-bottom-right-radius: 0 !important;
margin-right: -1px;
}
.card-flavor-num {
padding: 0.5rem;
border: #888888;
border-top-left-radius: 0 !important;
border-bottom-left-radius: 0 !important;
cursor: default !important;
}
.card-flavor-desc {
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
display: -webkit-box;
overflow: hidden;
color: #999999;
font-size: 14px;
margin-top: 10px;
}
.select-data-wrap {
padding: 1rem 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.select-data-title {
flex: 1;
overflow: hidden;
}
.select-data-title .ref-data-title {
font-size: 18px;
color: #454545;
font-weight: 700;
display: flex;
align-items: baseline;
max-width: 100%;
}
.select-data-href {
text-align: right;
text-overflow: ellipsis;
max-width: 35%;
word-break: initial;
margin-left: 1rem;
white-space: nowrap;
}
/deep/ .el-checkbox-group .el-checkbox .el-checkbox__label {
display: flex;
max-width: 90%;
}
.select-data-right {
overflow: hidden;
vertical-align: middle;
text-overflow: ellipsis;
max-width: 100%;
display: inline-block;
}
.data-multiple-wrap {
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
display: -webkit-box;
max-width: 100%;
overflow: hidden;
padding-top: 1rem;
color: #888888;
font: 12px;
line-height: 20px;
margin-left: 2rem;
}
.disabled1 {
opacity: 0.45 !important;
}
</style>

+ 38
- 24
web_src/js/components/dataset/selectDataset.vue View File

@@ -11,9 +11,9 @@
v-if="benchmarkNew" v-if="benchmarkNew"
class="label-fix-width" class="label-fix-width"
style="font-weight: normal" style="font-weight: normal"
>数据集</label
>{{i18n.dataset_label}}</label
> >
<label v-else>数据集</label>
<label v-else>{{i18n.dataset_label}}</label>
<span <span
:class=" :class="
benchmarkNew === true ? 'dataset-train-span' : 'dataset-debug-span' benchmarkNew === true ? 'dataset-train-span' : 'dataset-debug-span'
@@ -38,7 +38,7 @@
type="text" type="text"
class="disabled" class="disabled"
style="width: 48.5%" style="width: 48.5%"
placeholder="选择数据集文件"
:placeholder="i18n.dataset_select_placeholder"
required required
/> />
<input <input
@@ -46,7 +46,7 @@
type="text" type="text"
class="disabled" class="disabled"
:required="required" :required="required"
placeholder="选择数据集文件"
:placeholder="i18n.dataset_select_placeholder"
/> />
</span> </span>


@@ -59,10 +59,10 @@
? 'select-dataset-button' ? 'select-dataset-button'
: 'select-dataset-button-color' : 'select-dataset-button-color'
" "
>选择数据集
>{{i18n.dataset_select}}
</el-button> </el-button>
<el-dialog <el-dialog
title="选择数据集"
:title="i18n.dataset_select"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:width="dialogWidth" :width="dialogWidth"
> >
@@ -74,7 +74,7 @@
></i> ></i>
<input <input
type="text" type="text"
placeholder="搜数据集名称/描述..."
:placeholder="i18n.dataset_search_placeholder"
v-model="search" v-model="search"
@keydown.enter.stop.prevent="searchName" @keydown.enter.stop.prevent="searchName"
/> />
@@ -90,7 +90,7 @@
> >
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<!-- 当前项目的数据集 --> <!-- 当前项目的数据集 -->
<el-tab-pane label="本项目" name="first" v-loading="loadingCurrent">
<el-tab-pane :label="i18n.dataset_current_repo" name="first" v-loading="loadingCurrent">
<el-row> <el-row>
<el-tree <el-tree
:data="currentDatasetList" :data="currentDatasetList"
@@ -141,6 +141,15 @@
class="dataset-repolink dataset-nowrap" class="dataset-repolink dataset-nowrap"
@click.stop="return false;" @click.stop="return false;"
> >
<i
class="ri-links-line"
style="color: #21ba45; margin-right: 0.3rem"
:title="i18n.dataset_relate"
v-if="
'/' + data.Repo.OwnerName + '/' + data.Repo.Name !==
repoLink
"
></i>
<a <a
:href=" :href="
'/' + '/' +
@@ -163,13 +172,13 @@
class="zip-loading" class="zip-loading"
v-if="data.DecompressState === 2" v-if="data.DecompressState === 2"
> >
正在解压缩
{{i18n.dataset_unziping}}
</span> </span>
<span <span
class="unzip-failed" class="unzip-failed"
v-if="data.DecompressState === 3" v-if="data.DecompressState === 3"
> >
解压失败
{{i18n.dataset_unzip_failed}}
</span> </span>
</span> </span>
</span> </span>
@@ -192,7 +201,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<!-- 我上传的数据集 --> <!-- 我上传的数据集 -->
<el-tab-pane label="我上传的" name="second" v-loading="loadingMy">
<el-tab-pane :label="i18n.dataset_my_upload" name="second" v-loading="loadingMy">
<el-row> <el-row>
<el-tree <el-tree
:data="myDatasetList" :data="myDatasetList"
@@ -265,13 +274,13 @@
class="zip-loading" class="zip-loading"
v-if="data.DecompressState === 2" v-if="data.DecompressState === 2"
> >
正在解压缩
{{i18n.dataset_unziping}}
</span> </span>
<span <span
class="unzip-failed" class="unzip-failed"
v-if="data.DecompressState === 3" v-if="data.DecompressState === 3"
> >
解压失败
{{i18n.dataset_unzip_failed}}
</span> </span>
</span> </span>
</span> </span>
@@ -295,7 +304,7 @@
</el-tab-pane> </el-tab-pane>
<!-- 公开的数据集 --> <!-- 公开的数据集 -->
<el-tab-pane <el-tab-pane
label="公开数据集"
:label="i18n.dataset_public"
name="third" name="third"
v-loading="loadingPublic" v-loading="loadingPublic"
> >
@@ -371,13 +380,13 @@
class="zip-loading" class="zip-loading"
v-if="data.DecompressState === 2" v-if="data.DecompressState === 2"
> >
正在解压缩
{{i18n.dataset_unziping}}
</span> </span>
<span <span
class="unzip-failed" class="unzip-failed"
v-if="data.DecompressState === 3" v-if="data.DecompressState === 3"
> >
解压失败
{{i18n.dataset_unzip_failed}}
</span> </span>
</span> </span>
</span> </span>
@@ -401,7 +410,7 @@
</el-tab-pane> </el-tab-pane>
<!-- 我点赞的数据集 --> <!-- 我点赞的数据集 -->
<el-tab-pane <el-tab-pane
label="我收藏的"
:label="i18n.dataset_collected"
name="four" name="four"
v-loading="loadingFavorite" v-loading="loadingFavorite"
> >
@@ -477,13 +486,13 @@
class="zip-loading" class="zip-loading"
v-if="data.DecompressState === 2" v-if="data.DecompressState === 2"
> >
正在解压缩
{{i18n.dataset_unziping}}
</span> </span>
<span <span
class="unzip-failed" class="unzip-failed"
v-if="data.DecompressState === 3" v-if="data.DecompressState === 3"
> >
解压失败
{{i18n.dataset_unzip_failed}}
</span> </span>
</span> </span>
</span> </span>
@@ -527,7 +536,7 @@
line-height: 40px; line-height: 40px;
" "
> >
已选数据文件
{{i18n.dataset_selected}}
</div> </div>
<div style="flex: 1; margin-top: 1.5rem"> <div style="flex: 1; margin-top: 1.5rem">
<el-checkbox-group v-model="checkList"> <el-checkbox-group v-model="checkList">
@@ -549,7 +558,7 @@
color: #fff; color: #fff;
border: 1px solid #389e0d; border: 1px solid #389e0d;
" "
>确定</el-button
>{{i18n.dataset_ok}}</el-button
> >
</div> </div>
</el-col> </el-col>
@@ -576,7 +585,7 @@ export default {
activeName: "first", activeName: "first",
search: "", search: "",
required: true, required: true,
i18n: {},
type: 0, type: 0,
repoLink: "", repoLink: "",
selectDatasetArray: [], selectDatasetArray: [],
@@ -657,10 +666,10 @@ export default {
}) })
) { ) {
this.$refs[data.ref].setChecked(data.id, false, false); this.$refs[data.ref].setChecked(data.id, false, false);
this.$message.warning("不能选择相同名称的数据文件");
this.$message.warning(this.i18n.dataset_not_equal_file);
} else if (this.selectDatasetArray.length === 5) { } else if (this.selectDatasetArray.length === 5) {
this.$refs[data.ref].setChecked(data.id, false, false); this.$refs[data.ref].setChecked(data.id, false, false);
this.$message.error("最多不超过五个文件");
this.$message.error(this.i18n.dataset_most);
} else { } else {
this.selectDatasetArray.push(data); this.selectDatasetArray.push(data);
} }
@@ -1004,6 +1013,11 @@ export default {
}, },
created() { created() {
this.setDialogWidth(); this.setDialogWidth();
if (document.documentElement.attributes["lang"].nodeValue == "en-US") {
this.i18n = this.$locale.US;
} else {
this.i18n = this.$locale.CN;
}
}, },
}; };
</script> </script>


+ 17
- 10
web_src/js/components/images/selectGrampusImages.vue View File

@@ -7,32 +7,32 @@
v-if="benchmarkNew" v-if="benchmarkNew"
class="label-fix-width" class="label-fix-width"
style="font-weight: normal" style="font-weight: normal"
>镜像</label
>{{i18n.image_label}}</label
> >
<label v-else>镜像</label>
<label v-else>{{i18n.image_label}}</label>
<input <input
v-if="benchmarkNew" v-if="benchmarkNew"
type="text" type="text"
name="image" name="image"
:value="imageAddress" :value="imageAddress"
style="width: 48.5%" style="width: 48.5%"
placeholder="选择镜像或输入镜像地址"
:placeholder="i18n.image_select_placeholder"
/> />
<input <input
v-else v-else
type="text" type="text"
name="image" name="image"
:value="imageAddress" :value="imageAddress"
placeholder="选择镜像或输入镜像地址"
:placeholder="i18n.image_select_placeholder"
/> />
<el-button <el-button
type="text" type="text"
@click="dialogVisible = true" @click="dialogVisible = true"
icon="el-icon-plus" icon="el-icon-plus"
style="color: #0366d6" style="color: #0366d6"
>选择镜像
>{{i18n.image_select}}
</el-button> </el-button>
<el-dialog title="选择镜像" :visible.sync="dialogVisible" width="50%">
<el-dialog :title="i18n.image_select" :visible.sync="dialogVisible" width="50%">
<div <div
class="ui icon input" class="ui icon input"
style="z-index: 9999; position: absolute; right: 50px; height: 30px" style="z-index: 9999; position: absolute; right: 50px; height: 30px"
@@ -43,12 +43,12 @@
></i> ></i>
<input <input
type="text" type="text"
placeholder="搜镜像Tag/描述/标签..."
:placeholder="i18n.image_search_placeholder"
v-model="search" v-model="search"
/> />
</div> </div>
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="公开镜像" name="first" v-loading="loadingPublic">
<el-tab-pane :label="i18n.image_public" name="first" v-loading="loadingPublic">
<div <div
style=" style="
display: flex; display: flex;
@@ -120,7 +120,7 @@
selectImages(publicData.place, publicData.tag) selectImages(publicData.place, publicData.tag)
" "
> >
使用
{{i18n.image_use}}
</button> </button>
</div> </div>
</div> </div>
@@ -169,6 +169,7 @@ export default {
}, },
tableDataPublic: [], tableDataPublic: [],
loadingPublic: false, loadingPublic: false,
i18n: {},
}; };
}, },
methods: { methods: {
@@ -236,7 +237,13 @@ export default {
this.benchmarkNew = true; this.benchmarkNew = true;
} }
}, },
created() {},
created() {
if (document.documentElement.attributes["lang"].nodeValue == "en-US") {
this.i18n = this.$locale.US;
} else {
this.i18n = this.$locale.CN;
}
},
}; };
</script> </script>




+ 24
- 18
web_src/js/components/images/selectImages.vue View File

@@ -7,16 +7,16 @@
v-if="benchmarkNew" v-if="benchmarkNew"
class="label-fix-width" class="label-fix-width"
style="font-weight: normal" style="font-weight: normal"
>镜像</label
>{{i18n.image_label}}</label
> >
<label v-else>镜像</label>
<label v-else>{{i18n.image_label}}</label>
<input <input
v-if="benchmarkNew" v-if="benchmarkNew"
type="text" type="text"
name="image" name="image"
:value="imageAddress" :value="imageAddress"
style="width: 48.5%" style="width: 48.5%"
placeholder="选择镜像或输入镜像地址"
:placeholder="i18n.image_select_placeholder"
required required
/> />
<input <input
@@ -24,7 +24,7 @@
type="text" type="text"
name="image" name="image"
:value="imageAddress" :value="imageAddress"
placeholder="选择镜像或输入镜像地址"
:placeholder="i18n.image_select_placeholder"
required required
/> />
<el-button <el-button
@@ -32,9 +32,9 @@
@click="dialogVisible = true" @click="dialogVisible = true"
icon="el-icon-plus" icon="el-icon-plus"
style="color: #0366d6" style="color: #0366d6"
>选择镜像
>{{i18n.image_select}}
</el-button> </el-button>
<el-dialog title="选择镜像" :visible.sync="dialogVisible" width="50%">
<el-dialog :title="i18n.image_select" :visible.sync="dialogVisible" width="50%">
<div <div
class="ui icon input" class="ui icon input"
style="z-index: 9999; position: absolute; right: 50px; height: 30px" style="z-index: 9999; position: absolute; right: 50px; height: 30px"
@@ -45,12 +45,12 @@
></i> ></i>
<input <input
type="text" type="text"
placeholder="搜镜像Tag/描述/标签..."
:placeholder="i18n.image_search_placeholder"
v-model="search" v-model="search"
/> />
</div> </div>
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="公开镜像" name="first" v-loading="loadingPublic">
<el-tab-pane :label="i18n.image_public" name="first" v-loading="loadingPublic">
<div <div
style=" style="
display: flex; display: flex;
@@ -122,7 +122,7 @@
selectImages(publicData.place, publicData.tag) selectImages(publicData.place, publicData.tag)
" "
> >
使用
{{i18n.image_use}}
</button> </button>
</div> </div>
</div> </div>
@@ -142,7 +142,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>


<el-tab-pane label="我的镜像" name="second" v-loading="loadingCustom">
<el-tab-pane :label="i18n.image_my" name="second" v-loading="loadingCustom">
<div <div
style=" style="
display: flex; display: flex;
@@ -208,7 +208,7 @@
selectImages(customData.place, customData.tag) selectImages(customData.place, customData.tag)
" "
> >
使用
{{i18n.image_use}}
</button> </button>
<span <span
v-if="customData.status === 0" v-if="customData.status === 0"
@@ -217,7 +217,7 @@
<i class="CREATING"></i> <i class="CREATING"></i>
<span <span
style="margin-left: 0.4em; font-size: 12px; color: #5a5a5a" style="margin-left: 0.4em; font-size: 12px; color: #5a5a5a"
>提交中</span
>{{i18n.image_commit}}</span
> >
</span> </span>
<span <span
@@ -228,11 +228,11 @@
<el-tooltip <el-tooltip
class="item" class="item"
effect="dark" effect="dark"
content="检测提交镜像是否大小超过20G!"
:content="i18n.image_commit_content"
placement="left" placement="left"
> >
<span style="margin-left: 0.4em; font-size: 12px; color: red" <span style="margin-left: 0.4em; font-size: 12px; color: red"
>提交失败</span
>{{i18n.image_commit_failed}}</span
> >
</el-tooltip> </el-tooltip>
</span> </span>
@@ -254,7 +254,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>


<el-tab-pane label="我收藏的镜像" name="third">
<el-tab-pane :label="i18n.image_collected" name="third">
<div <div
style=" style="
display: flex; display: flex;
@@ -324,7 +324,7 @@
class="ui primary basic button mini" class="ui primary basic button mini"
@click.stop.prevent="selectImages(starData.place, starData.tag)" @click.stop.prevent="selectImages(starData.place, starData.tag)"
> >
使用
{{i18n.image_use}}
</button> </button>
</div> </div>
</div> </div>
@@ -368,7 +368,7 @@ export default {
paramsPublic: { page: 1, pageSize: 5, q: "", recommend: false }, paramsPublic: { page: 1, pageSize: 5, q: "", recommend: false },
tableDataPublic: [], tableDataPublic: [],
loadingPublic: false, loadingPublic: false,
i18n: {},
currentPageCustom: 1, currentPageCustom: 1,
pageSizeCustom: 5, pageSizeCustom: 5,
totalNumCustom: 0, totalNumCustom: 0,
@@ -513,7 +513,13 @@ export default {
this.benchmark = true; this.benchmark = true;
} }
}, },
created() {},
created() {
if (document.documentElement.attributes["lang"].nodeValue == "en-US") {
this.i18n = this.$locale.US;
} else {
this.i18n = this.$locale.CN;
}
},
}; };
</script> </script>




+ 200
- 0
web_src/js/features/i18nVue.js View File

@@ -0,0 +1,200 @@
export const i18nVue = {
CN: {
computer_vision: "计算机视觉",
natural_language_processing: "自然语言处理",
speech_processing: "语音处理",
computer_vision_natural_language_processing: "计算机视觉、自然语言处理",
machine_translation: "机器翻译",
question_answering_system: "问答系统",
information_retrieval: "信息检索",
knowledge_graph: "知识图谱",
text_annotation: "文本标注",
text_categorization: "文本分类",
emotion_analysis: "情感分析",
language_modeling: "语言建模",
speech_recognition: "语音识别",
automatic_digest: "自动文摘",
information_extraction: "信息抽取",
description_generation: "说明生成",
image_classification: "图像分类",
face_recognition: "人脸识别",
image_search: "图像搜索",
target_detection: "目标检测",
image_description_generation: "图像描述生成",
vehicle_license_plate_recognition: "车辆车牌识别",
medical_image_analysis: "医学图像分析",
unmanned: "无人驾驶",
unmanned_security: "无人安防",
drone: "无人机",
vr_ar: "VR/AR",
"2_d_vision": "2-D视觉",
"2_5_d_vision": "2.5-D视觉",
"3_d_reconstruction": "3D重构",
image_processing: "图像处理",
video_processing: "视频处理",
visual_input_system: "视觉输入系统",
speech_coding: "语音编码",
speech_enhancement: "语音增强",
speech_recognition: "语音识别",
speech_synthesis: "语音合成",
current_dataset: "当前数据集",
linked_datasets: "关联数据集",
unfavorite: "取消收藏",
favorite: "收藏",
disassociate: "取消关联",
public_dataset: "公开数据集",
selected_data_file: "已选数据集",
sure: "确定",
search_dataset: "搜数据集名称/描述...",
citations: "引用次数",
downloads: "下载次数",
not_link_dataset: "还未关联过数据集",
no_link_dataset_tips1:
"您可以通过单击关联数据集按钮,将平台上公开数据集展示在这里。",
dataset_instructions_for_use: "使用说明:可以参考启智AI协作平台",
dataset_camp_course: "小白训练营课程",
dataset_link_success: "关联数据集成功!",
dataset_link_failed: "关联数据集失败!",
dataset_over_nums: "关联超过?个数据集",
cancel_link_dataset: "取消?关联数据集成功!",
image_label: "镜像",
image_select_placeholder: "选择镜像或输入镜像地址",
image_select: "选择镜像",
image_search_placeholder: "搜镜像Tag/描述/标签...",
image_public: "公开镜像",
image_use: "使用",
image_my: "我的镜像",
image_commit: "提交中",
image_commit_content: "检测提交镜像是否大小超过20G!",
image_commit_failed: "提交失败",
image_collected: "我收藏的镜像",
dataset_label: "数据集",
dataset_select_placeholder: "选择数据集文件",
dataset_select: "选择数据集",
dataset_search_placeholder: "搜数据集名称/描述...",
dataset_unziping: "正在解压缩",
dataset_unzip_failed: "解压失败",
dataset_my_upload: "我上传的",
dataset_current_repo: "本项目",
dataset_public: "公开数据集",
dataset_relate: "关联数据集",
dataset_collected: "我收藏的",
dataset_selected: "已选数据文件",
dataset_ok: "确定",
dataset_not_equal_file: "不能选择相同名称的数据文件",
dataset_most: "最多不超过五个文件",
model_name: "模型名称",
model_version: "版本",
model_version_num: "版本数",
model_size: "模型大小",
model_egine: "模型框架",
model_compute_resource: "计算资源",
model_create_time: "创建时间",
model_creator: "创建者",
model_operation: "操作",
model_create_new_ver: "创建新版本",
model_download: "下载",
model_delete: "删除",
},
US: {
computer_vision: "computer vision",
natural_language_processing: "natural language processing",
speech_processing: "speech processing",
computer_vision_natural_language_processing:
"computer vision and natural language processing",
machine_translation: "machine translation",
question_answering_system: "question answering system",
information_retrieval: "information retrieval",
knowledge_graph: "knowledge graph",
text_annotation: "text annotation",
text_categorization: "text categorization",
emotion_analysis: "emotion analysis",
language_modeling: "language modeling",
speech_recognition: "speech recognition",
automatic_digest: "automatic digest",
information_extraction: "information extraction",
description_generation: "description generation",
image_classification: "image classification",
face_recognition: "face recognition",
image_search: "image search",
target_detection: "target detection",
image_description_generation: "image description generation",
vehicle_license_plate_recognition: "vehicle license plate recognition",
medical_image_analysis: "medical image analysis",
unmanned: "unmanned",
unmanned_security: "unmanned security",
drone: "drone",
vr_ar: "VR/AR",
"2_d_vision": "2.D vision",
"2.5_d_vision": "2.5D vision",
"3_d_reconstruction": "3Dreconstruction",
image_processing: "image processing",
video_processing: "video processing",
visual_input_system: "visual input system",
speech_coding: "speech coding",
speech_enhancement: "speech enhancement",
speech_recognition: "speech recognition",
speech_synthesis: "speech synthesis",
current_dataset: "Current Dataset",
linked_datasets: "Linked Datasets",
unfavorite: "UnLike",
favorite: "Like",
disassociate: "Unlink",
public_dataset: "Public Dataset",
selected_data_file: "Selected DataSets",
sure: "Ok",
search_dataset: "Search dataset name/description ...",
citations: "Citations",
downloads: "Downloads",
not_link_dataset: "No datasets have been associated yet",
no_link_dataset_tips1:
"You can display public datasets on the platform here by clicking the New Linked Dataset button.",

dataset_instructions_for_use:
"Instructions for use: You can refer to Openi AI Collaboration Platform ",
dataset_camp_course: " Newcomer Training Camp Course",
dataset_link_success: "Linked dataset succeeded!",
dataset_link_failed: "Linked dataset Failed!",
dataset_over_nums: "Linked over ? datasets!",
cancel_link_dataset: "Cancel ? Linked dataset succeeded!",
image_label: "Image",
image_select_placeholder: "Select image or input image url",
image_select: "Select Image",
image_search_placeholder: "Search image tag/description/label...",
image_public: "Public Image",
image_use: "Use",
image_my: "My Images",
image_commit: "Commiting",
image_commit_content:
"Check whether the size of the submitted image exceeds 20g.",
image_commit_failed: "Commit failed",
image_collected: "My collected images",
dataset_label: "Dataset",
dataset_select_placeholder: "Select dataset file",
dataset_select: "Select dataset",
dataset_search_placeholder: "Search dataset name/description ...",
dataset_unziping: "Decompressing",
dataset_unzip_failed: "Decompression failed",
dataset_my_upload: "Upload by me",
dataset_current_repo: "Current Repository",
dataset_public: "Public dataset",
dataset_collected: "My collection",
dataset_relate: "Related dataset",
dataset_selected: "Selected dataset file",
dataset_ok: "OK",
dataset_not_equal_file: "Cannot select a data file with the same name.",
dataset_most: "Up to five files.",
model_name: "Model Name",
model_version: "Version",
model_version_num: "Total",
model_size: "Size",
model_egine: "Engine",
model_compute_resource: "Compute Resource",
model_create_time: "Created Time",
model_creator: "Creator",
model_operation: "Operation",
model_create_new_ver: "New Version",
model_download: "Download",
model_delete: "Delete",
},
};

+ 15
- 0
web_src/js/index.js View File

@@ -46,15 +46,19 @@ import initCloudrain from "./features/cloudrbanin.js";
import initCloudrainSow from "./features/cloudbrainShow.js"; import initCloudrainSow from "./features/cloudbrainShow.js";
import initImage from "./features/images.js"; import initImage from "./features/images.js";
import selectDataset from "./components/dataset/selectDataset.vue"; import selectDataset from "./components/dataset/selectDataset.vue";
import referenceDataset from "./components/dataset/referenceDataset.vue";
// import $ from 'jquery.js' // import $ from 'jquery.js'
import router from "./router/index.js"; import router from "./router/index.js";
import { Message } from "element-ui"; import { Message } from "element-ui";


import { i18nVue } from "./features/i18nVue.js";

Vue.use(ElementUI); Vue.use(ElementUI);
Vue.prototype.$axios = axios; Vue.prototype.$axios = axios;
Vue.prototype.$Cookies = Cookies; Vue.prototype.$Cookies = Cookies;
Vue.prototype.qs = qs; Vue.prototype.qs = qs;
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
Vue.prototype.$locale = i18nVue;
const { AppSubUrl, StaticUrlPrefix, csrf } = window.config; const { AppSubUrl, StaticUrlPrefix, csrf } = window.config;


Object.defineProperty(Vue.prototype, "$echarts", { Object.defineProperty(Vue.prototype, "$echarts", {
@@ -2900,6 +2904,7 @@ $(document).ready(async () => {
initVueDataAnalysis(); initVueDataAnalysis();
initVueWxAutorize(); initVueWxAutorize();
initVueselectDataset(); initVueselectDataset();
initVuereferenceDataset();
initTeamSettings(); initTeamSettings();
initCtrlEnterSubmit(); initCtrlEnterSubmit();
initNavbarContentToggle(); initNavbarContentToggle();
@@ -4532,6 +4537,16 @@ function initVueselectDataset() {
render: (h) => h(selectDataset), render: (h) => h(selectDataset),
}); });
} }
function initVuereferenceDataset() {
const el = document.getElementById("reference-dataset");
if (!el) {
return;
}
new Vue({
el: el,
render: (h) => h(referenceDataset),
});
}
window.timeAddManual = function () { window.timeAddManual = function () {
$(".mini.modal") $(".mini.modal")
.modal({ .modal({


Loading…
Cancel
Save