你确认删除该任务么?此任务一旦删除不可恢复。
+{{.i18n.Tr "cloudbrain.task_delete_confirm"}}
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 226fa2147..3ebe5a9b5 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -273,6 +273,20 @@ code_search_results = Search results for '%s' code_last_indexed_at = Last indexed %s save=Save cancel=Cancel +hot_repo=Hot Repositories +active_repo=Active Repositories +all_fields = All fields +large_model = Large model +ai_development_tools = AI tools +computer_version = Computer version +natural_language_processing = NLP +machine_learning = Machine learning +neural_networks = Neural networks +autopilot = Autopilot +robot = Robot +federated_learning = Federated learning +data_mining = Data mining +RISC-V_development = RISC-V development [auth] create_new_account = Register Account @@ -848,6 +862,7 @@ model_noright=No right model_rename=Duplicate model name, please modify model name. debug=Debug +debug_again=Restart stop=Stop delete=Delete more=More @@ -855,7 +870,7 @@ gpu_type_all=All model_download=Model Download submit_image=Submit Image download=Download - +score=score cloudbrain=Cloudbrain cloudbrain.new=New cloudbrain @@ -977,13 +992,28 @@ cloudbrain.benchmark.evaluate_child_type=Child Type cloudbrain.benchmark.evaluate_mirror=Mirror cloudbrain.benchmark.evaluate_train=Train Script cloudbrain.benchmark.evaluate_test=Test Script +cloudbrain.benchmark.types={"type":[{"id":1,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=detection","first":"Target detection","second":[{"id":1,"value":"None","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"yangzhx","repo_name":"detection_benchmark_script"}]},{"id":2,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=reid","first":"Target re-identification","second":[{"id":1,"value":"Vehicle re-identification","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"},{"id":2,"value":"Image-based person re-identification","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"}]},{"id":3,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=tracking","first":"Multi-target tracking","second":[{"id":1,"value":"None","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"lix07","repo_name":"MOT_benchmark_script"}]}]} + modelarts.infer_job_model = Model modelarts.infer_job_model_file = Model File modelarts.infer_job = Inference Job modelarts.infer_job.model_version = Model/Version 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.tooltip = The model has been deleted and cannot be viewed. + +debug_task_not_created = Debug task has not been created +train_task_not_created = Train task has not been created +inference_job_not_created = Inference job has not been created +model_Evaluation_not_created = Model evaluation has not been created +repo_not_initialized = Code version: You have not initialized the code repository, please initialized first ; +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; +platform_instructions = Instructions for use: You can refer to the Xiaobai training camp course of Qizhi AI collaboration platform. +model_not_exist = Model file: You do not have a model file yet, please generate and export the model through the training task first ; +benchmark_leaderboards = Benchmark leaderboards + model.manage.import_new_model=Import New Model model.manage.create_error=Equal Name and Version has existed. model.manage.model_name = Model Name @@ -2819,4 +2849,24 @@ benchmark_path = Benchmark script path snn4imagenet_path = Snn4imagenet script path brainscore_path = Brainscore script path start_command = Start command -choose_mirror = select mirror +choose_mirror = select mirror or enter mirror path +select_dataset = select dataset +specification = specification +select_specification = select specification +description = description + +job_name_rule = Please enter letters, numbers, _ and - up to 64 characters and cannot end with a dash (-). +dataset_path_rule = The dataset location is stored in the environment variable data_url, and the training output path is stored in the environment variable train_url. +view_sample = View sample +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 + +delete_task = Delete task +task_delete_confirm = Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered. +operate_confirm = confirm +operate_cancel = cancel + +gpu_num = GPU +cpu_num = CPU +memory = Memory +shared_memory = Shared Memory diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index ce5367d98..7078bdb52 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -275,6 +275,20 @@ code_search_results=“%s” 的搜索结果是 code_last_indexed_at=最后索引于 %s save=保存 cancel=取消 +hot_repo=热门项目 +active_repo=活跃项目 +all_fields = 全部领域 +large_model = 大模型 +ai_development_tools = AI开发工具 +computer_version = 计算机视觉 +natural_language_processing = 自然语言处理 +machine_learning = 机器学习 +neural_networks = 神经网络 +autopilot = 自动驾驶 +robot = 机器人 +federated_learning = 联邦学习 +data_mining = 数据挖掘 +RISC-V_development = RISC-V开发 [auth] create_new_account=注册帐号 @@ -860,6 +874,7 @@ gpu_type_all=全部 model_download=结果下载 submit_image=提交镜像 download=模型下载 +score=评分 cloudbrain=云脑 cloudbrain.new=新建任务 @@ -983,7 +998,7 @@ cloudbrain.benchmark.evaluate_child_type=子类型 cloudbrain.benchmark.evaluate_mirror=镜像 cloudbrain.benchmark.evaluate_train=训练程序 cloudbrain.benchmark.evaluate_test=测试程序 - +cloudbrain.benchmark.types={"type":[{"id":1,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=detection","first":"目标检测","second":[{"id":1,"value":"无","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"yangzhx","repo_name":"detection_benchmark_script"}]},{"id":2,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=reid","first":"目标重识别","second":[{"id":1,"value":"车辆重识别","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"},{"id":2,"value":"基于图像的行人重识别","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"JiahongXu","repo_name":"benchmark_reID_script"}]},{"id":3,"rank_link":"https://git.openi.org.cn/benchmark/?username=admin&algType=tracking","first":"多目标跟踪","second":[{"id":1,"value":"无","attachment":"84cf39c4-d8bc-41aa-aaa3-182ce289b105","owner":"lix07","repo_name":"MOT_benchmark_script"}]}]} modelarts.infer_job_model = 模型名称 modelarts.infer_job_model_file = 模型文件 @@ -993,6 +1008,18 @@ modelarts.infer_job.select_model = 选择模型 modelarts.infer_job.boot_file_helper=启动文件是您程序执行的入口文件,必须是以.py结尾的文件。比如inference.py、main.py、example/inference.py、case/main.py。 modelarts.infer_job.tooltip = 该模型已删除,无法查看。 + +debug_task_not_created = 未创建过调试任务 +train_task_not_created = 未创建过训练任务 +inference_job_not_created = 未创建过推理任务 +model_Evaluation_not_created = 未创建过评测任务 +repo_not_initialized = 代码版本:您还没有初始化代码仓库,请先创建代码版本; +debug_task_running_limit = 运行时长:最长不超过4个小时,超过4个小时将自动停止; +dataset_desc = 数据集:云脑1提供 CPU / GPU 资源,云脑2提供 Ascend NPU 资源,调试使用的数据集也需要上传到对应的环境; +platform_instructions = 使用说明:可以参考启智AI协作平台小白训练营课程。 +model_not_exist = 模型文件:您还没有模型文件,请先通过训练任务产生并 导出模型 ; +benchmark_leaderboards = 基准测试排行榜 + model.manage.import_new_model=导入新模型 model.manage.create_error=相同的名称和版本的模型已经存在。 model.manage.model_name = 模型名称 @@ -2828,3 +2855,24 @@ snn4imagenet_path = snn4imagenet脚本存放路径 brainscore_path = brainscore脚本存放路径 start_command = 启动命令 choose_mirror = 选择镜像或输入镜像地址 +select_dataset = 选择数据集 +specification = 规格 +select_specification = 选择资源规格 +description = 描述 + +job_name_rule = 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。 +dataset_path_rule = 数据集位置存储在环境变量data_url中,训练输出路径存储在环境变量train_url中。 +view_sample = 查看样例 +inference_output_path_rule = 推理输出路径存储在环境变量result_url中。 +model_file_path_rule = 模型文件位置存储在环境变量ckpt_url中。 + +delete_task = 删除任务 +task_delete_confirm = 你确认删除该任务么?此任务一旦删除不可恢复。 +operate_confirm = 确定操作 +operate_cancel = 取消操作 + +gpu_num = GPU数 +cpu_num = CPU数 +memory = 内存 +shared_memory = 共享内存 + diff --git a/routers/api/v1/repo/repo_dashbord.go b/routers/api/v1/repo/repo_dashbord.go index b1f344d55..2c42f8a16 100644 --- a/routers/api/v1/repo/repo_dashbord.go +++ b/routers/api/v1/repo/repo_dashbord.go @@ -292,41 +292,41 @@ func getFileName(ctx *context.Context, beginTime time.Time, endTime time.Time, p func allProjectsPeroidHeader(ctx *context.Context) map[string]string { - return map[string]string{"A1": ctx.Tr("admin.repos.id"), "B1": ctx.Tr("admin.repos.projectName"), "C1": ctx.Tr("repo.owner"), "D1": ctx.Tr("admin.repos.isPrivate"), "E1": ctx.Tr("admin.repos.isFork"), "F1": ctx.Tr("admin.repos.isMirror"), "G1": ctx.Tr("admin.repos.openi"), "H1": ctx.Tr("admin.repos.visit"), "I1": ctx.Tr("admin.repos.download"), "J1": ctx.Tr("admin.repos.pr"), "K1": ctx.Tr("admin.repos.commit"), - "L1": ctx.Tr("admin.repos.watches"), "M1": ctx.Tr("admin.repos.stars"), "N1": ctx.Tr("admin.repos.forks"), "O1": ctx.Tr("admin.repos.issues"), "P1": ctx.Tr("admin.repos.closedIssues"), "Q1": ctx.Tr("admin.repos.contributor"), "R1": ctx.Tr("admin.repos.create")} + return map[string]string{"A1": ctx.Tr("admin.repos.id"), "B1": ctx.Tr("admin.repos.projectName"), "C1": ctx.Tr("repo.owner"), "D1": ctx.Tr("admin.repos.isPrivate"), "E1": ctx.Tr("admin.repos.openi"), "F1": ctx.Tr("admin.repos.visit"), "G1": ctx.Tr("admin.repos.download"), "H1": ctx.Tr("admin.repos.pr"), "I1": ctx.Tr("admin.repos.commit"), + "J1": ctx.Tr("admin.repos.watches"), "K1": ctx.Tr("admin.repos.stars"), "L1": ctx.Tr("admin.repos.forks"), "M1": ctx.Tr("admin.repos.issues"), "N1": ctx.Tr("admin.repos.closedIssues"), "O1": ctx.Tr("admin.repos.contributor"), "P1": ctx.Tr("admin.repos.isFork"), "Q1": ctx.Tr("admin.repos.isMirror"), "R1": ctx.Tr("admin.repos.create")} } func allProjectsPeroidValues(row int, rs *models.RepoStatistic, ctx *context.Context) map[string]string { - return map[string]string{getCellName("A", row): strconv.FormatInt(rs.RepoID, 10), getCellName("B", row): rs.DisplayName(), getCellName("C", row): rs.OwnerName, getCellName("D", row): getBoolDisplay(rs.IsPrivate, ctx), getCellName("E", row): getBoolDisplay(rs.IsFork, ctx), getCellName("F", row): getBoolDisplay(rs.IsMirror, ctx), getCellName("G", row): strconv.FormatFloat(rs.RadarTotal, 'f', 2, 64), - getCellName("H", row): strconv.FormatInt(rs.NumVisits, 10), getCellName("I", row): strconv.FormatInt(rs.NumDownloads, 10), getCellName("J", row): strconv.FormatInt(rs.NumPulls, 10), getCellName("K", row): strconv.FormatInt(rs.NumCommits, 10), - getCellName("L", row): strconv.FormatInt(rs.NumWatches, 10), getCellName("M", row): strconv.FormatInt(rs.NumStars, 10), getCellName("N", row): strconv.FormatInt(rs.NumForks, 10), getCellName("O", row): strconv.FormatInt(rs.NumIssues, 10), - getCellName("P", row): strconv.FormatInt(rs.NumClosedIssues, 10), getCellName("Q", row): strconv.FormatInt(rs.NumContributor, 10), getCellName("R", row): time.Unix(int64(rs.RepoCreatedUnix), 0).Format(CREATE_TIME_FORMAT), + return map[string]string{getCellName("A", row): strconv.FormatInt(rs.RepoID, 10), getCellName("B", row): rs.DisplayName(), getCellName("C", row): rs.OwnerName, getCellName("D", row): getBoolDisplay(rs.IsPrivate, ctx), getCellName("E", row): strconv.FormatFloat(rs.RadarTotal, 'f', 2, 64), + getCellName("F", row): strconv.FormatInt(rs.NumVisits, 10), getCellName("G", row): strconv.FormatInt(rs.NumDownloads, 10), getCellName("H", row): strconv.FormatInt(rs.NumPulls, 10), getCellName("I", row): strconv.FormatInt(rs.NumCommits, 10), + getCellName("J", row): strconv.FormatInt(rs.NumWatches, 10), getCellName("K", row): strconv.FormatInt(rs.NumStars, 10), getCellName("L", row): strconv.FormatInt(rs.NumForks, 10), getCellName("M", row): strconv.FormatInt(rs.NumIssues, 10), + getCellName("N", row): strconv.FormatInt(rs.NumClosedIssues, 10), getCellName("O", row): strconv.FormatInt(rs.NumContributor, 10), getCellName("P", row): getBoolDisplay(rs.IsFork, ctx), getCellName("Q", row): getBoolDisplay(rs.IsMirror, ctx), getCellName("R", row): time.Unix(int64(rs.RepoCreatedUnix), 0).Format(CREATE_TIME_FORMAT), } } func allProjectsOpenIHeader() map[string]string { - return map[string]string{"A1": "ID", "B1": "项目名称", "C1": "拥有者", "D1": "私有", "E1": "迁移", "F1": "镜像", "G1": "OpenI指数", - "H1": "影响力", "I1": "成熟度", "J1": "活跃度", "K1": "项目健康度", "L1": "团队健康度", "M1": "项目发展趋势", - "N1": "关注数", "O1": "点赞数", "P1": "派生数", "Q1": "代码下载量", "R1": "评论数", "S1": "浏览量", "T1": "已解决任务数", "U1": "版本发布数量", "V1": "有效开发年龄", - "W1": "数据集", "X1": "模型数", "Y1": "百科页面数量", "Z1": "提交数", "AA1": "任务数", "AB1": "PR数", "AC1": "版本发布数量", "AD1": "任务完成比例", "AE1": "贡献者数", "AF1": "关键贡献者数", - "AG1": "新人增长量", "AH1": "代码规模增长量", "AI1": "任务增长量", "AJ1": "新人增长量", "AK1": "提交增长量", "AL1": "评论增长量", "AM1": "项目创建时间", + return map[string]string{"A1": "ID", "B1": "项目名称", "C1": "拥有者", "D1": "私有", "E1": "OpenI指数", + "F1": "影响力", "G1": "成熟度", "H1": "活跃度", "I1": "项目健康度", "J1": "团队健康度", "K1": "项目发展趋势", + "L1": "关注数", "M1": "点赞数", "N1": "派生数", "O1": "代码下载量", "P1": "评论数", "Q1": "浏览量", "R1": "已解决任务数", "S1": "版本发布数量", "T1": "有效开发年龄", + "U1": "数据集", "V1": "模型数", "W1": "百科页面数量", "X1": "提交数", "Y1": "任务数", "Z1": "PR数", "AA1": "版本发布数量", "AB1": "任务完成比例", "AC1": "贡献者数", "AD1": "关键贡献者数", + "AE1": "新人增长量", "AF1": "代码规模增长量", "AG1": "任务增长量", "AH1": "新人增长量", "AI1": "提交增长量", "AJ1": "评论增长量", "AK1": "迁移", "AL1": "镜像", "AM1": "项目创建时间", } } func allProjectsOpenIValues(row int, rs *models.RepoStatistic, ctx *context.Context) map[string]string { - return map[string]string{getCellName("A", row): strconv.FormatInt(rs.RepoID, 10), getCellName("B", row): rs.DisplayName(), getCellName("C", row): rs.OwnerName, getCellName("D", row): getBoolDisplay(rs.IsPrivate, ctx), getCellName("E", row): getBoolDisplay(rs.IsFork, ctx), getCellName("F", row): getBoolDisplay(rs.IsMirror, ctx), getCellName("G", row): strconv.FormatFloat(rs.RadarTotal, 'f', 2, 64), - getCellName("H", row): strconv.FormatFloat(rs.Impact, 'f', 2, 64), getCellName("I", row): strconv.FormatFloat(rs.Completeness, 'f', 2, 64), getCellName("J", row): strconv.FormatFloat(rs.Liveness, 'f', 2, 64), getCellName("K", row): strconv.FormatFloat(rs.ProjectHealth, 'f', 2, 64), getCellName("L", row): strconv.FormatFloat(rs.TeamHealth, 'f', 2, 64), getCellName("M", row): strconv.FormatFloat(rs.Growth, 'f', 2, 64), - getCellName("N", row): strconv.FormatInt(rs.NumWatches, 10), getCellName("O", row): strconv.FormatInt(rs.NumStars, 10), getCellName("P", row): strconv.FormatInt(rs.NumForks, 10), getCellName("Q", row): strconv.FormatInt(rs.NumDownloads, 10), + return map[string]string{getCellName("A", row): strconv.FormatInt(rs.RepoID, 10), getCellName("B", row): rs.DisplayName(), getCellName("C", row): rs.OwnerName, getCellName("D", row): getBoolDisplay(rs.IsPrivate, ctx), getCellName("E", row): strconv.FormatFloat(rs.RadarTotal, 'f', 2, 64), + getCellName("F", row): strconv.FormatFloat(rs.Impact, 'f', 2, 64), getCellName("G", row): strconv.FormatFloat(rs.Completeness, 'f', 2, 64), getCellName("H", row): strconv.FormatFloat(rs.Liveness, 'f', 2, 64), getCellName("I", row): strconv.FormatFloat(rs.ProjectHealth, 'f', 2, 64), getCellName("J", row): strconv.FormatFloat(rs.TeamHealth, 'f', 2, 64), getCellName("K", row): strconv.FormatFloat(rs.Growth, 'f', 2, 64), + getCellName("L", row): strconv.FormatInt(rs.NumWatches, 10), getCellName("M", row): strconv.FormatInt(rs.NumStars, 10), getCellName("N", row): strconv.FormatInt(rs.NumForks, 10), getCellName("O", row): strconv.FormatInt(rs.NumDownloads, 10), - getCellName("R", row): strconv.FormatInt(rs.NumComments, 10), getCellName("S", row): strconv.FormatInt(rs.NumVisits, 10), getCellName("T", row): strconv.FormatInt(rs.NumClosedIssues, 10), getCellName("U", row): strconv.FormatInt(rs.NumVersions, 10), - getCellName("V", row): strconv.FormatInt(rs.NumDevMonths, 10), getCellName("W", row): strconv.FormatInt(rs.DatasetSize, 10), getCellName("X", row): strconv.FormatInt(rs.NumModels, 10), getCellName("Y", row): strconv.FormatInt(rs.NumWikiViews, 10), - getCellName("Z", row): strconv.FormatInt(rs.NumCommits, 10), getCellName("AA", row): strconv.FormatInt(rs.NumIssues, 10), getCellName("AB", row): strconv.FormatInt(rs.NumPulls, 10), getCellName("AC", row): strconv.FormatInt(rs.NumVersions, 10), - getCellName("AD", row): strconv.FormatFloat(float64(rs.IssueFixedRate), 'f', 2, 64), getCellName("AE", row): strconv.FormatInt(rs.NumContributor, 10), getCellName("AF", row): strconv.FormatInt(rs.NumKeyContributor, 10), getCellName("AG", row): strconv.FormatInt(rs.NumContributorsGrowth, 10), - getCellName("AH", row): strconv.FormatInt(rs.NumCommitLinesGrowth, 10), getCellName("AI", row): strconv.FormatInt(rs.NumIssuesGrowth, 10), getCellName("AJ", row): strconv.FormatInt(rs.NumContributorsGrowth, 10), getCellName("AK", row): strconv.FormatInt(rs.NumCommitsGrowth, 10), getCellName("AL", row): strconv.FormatInt(rs.NumCommentsGrowth, 10), getCellName("AM", row): time.Unix(int64(rs.RepoCreatedUnix), 0).Format(CREATE_TIME_FORMAT), + getCellName("P", row): strconv.FormatInt(rs.NumComments, 10), getCellName("Q", row): strconv.FormatInt(rs.NumVisits, 10), getCellName("R", row): strconv.FormatInt(rs.NumClosedIssues, 10), getCellName("S", row): strconv.FormatInt(rs.NumVersions, 10), + getCellName("T", row): strconv.FormatInt(rs.NumDevMonths, 10), getCellName("U", row): strconv.FormatInt(rs.DatasetSize, 10), getCellName("V", row): strconv.FormatInt(rs.NumModels, 10), getCellName("W", row): strconv.FormatInt(rs.NumWikiViews, 10), + getCellName("X", row): strconv.FormatInt(rs.NumCommits, 10), getCellName("Y", row): strconv.FormatInt(rs.NumIssues, 10), getCellName("Z", row): strconv.FormatInt(rs.NumPulls, 10), getCellName("AA", row): strconv.FormatInt(rs.NumVersions, 10), + getCellName("AB", row): strconv.FormatFloat(float64(rs.IssueFixedRate), 'f', 2, 64), getCellName("AC", row): strconv.FormatInt(rs.NumContributor, 10), getCellName("AD", row): strconv.FormatInt(rs.NumKeyContributor, 10), getCellName("AE", row): strconv.FormatInt(rs.NumContributorsGrowth, 10), + getCellName("AF", row): strconv.FormatInt(rs.NumCommitLinesGrowth, 10), getCellName("AG", row): strconv.FormatInt(rs.NumIssuesGrowth, 10), getCellName("AH", row): strconv.FormatInt(rs.NumContributorsGrowth, 10), getCellName("AI", row): strconv.FormatInt(rs.NumCommitsGrowth, 10), getCellName("AJ", row): strconv.FormatInt(rs.NumCommentsGrowth, 10), getCellName("AK", row): getBoolDisplay(rs.IsFork, ctx), getCellName("AL", row): getBoolDisplay(rs.IsMirror, ctx), getCellName("AM", row): time.Unix(int64(rs.RepoCreatedUnix), 0).Format(CREATE_TIME_FORMAT), } } diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 6e88b266d..65db818a0 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "github.com/unknwon/i18n" "io" "net/http" "os" @@ -45,6 +46,10 @@ var ( benchmarkResourceSpecs *models.ResourceSpecs ) +const BENCHMARK_TYPE_CODE = "repo.cloudbrain.benchmark.types" + +var benchmarkTypesMap = make(map[string]*models.BenchmarkTypes, 0) + var jobNamePattern = regexp.MustCompile(`^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$`) // MustEnableDataset check if repository enable internal cb @@ -130,12 +135,7 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { } ctx.Data["benchmark_categories"] = categories.Category - if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err, ctx.Data["MsgID"]) - } - } - ctx.Data["benchmark_types"] = benchmarkTypes.BenchmarkType + ctx.Data["benchmark_types"] = GetBenchmarkTypes(ctx).BenchmarkType if gpuInfos == nil { json.Unmarshal([]byte(setting.GpuTypes), &gpuInfos) @@ -339,13 +339,6 @@ func CloudBrainRestart(ctx *context.Context) { } func CloudBrainBenchMarkShow(ctx *context.Context) { - if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err, ctx.Data["MsgID"]) - ctx.ServerError(err.Error(), err) - return - } - } cloudBrainShow(ctx, tplCloudBrainBenchmarkShow) } @@ -412,7 +405,7 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { duration = int64(task.UpdatedUnix) - int64(task.CreatedUnix) } if task.BenchmarkTypeID > 0 { - for _, benchmarkType := range benchmarkTypes.BenchmarkType { + for _, benchmarkType := range GetBenchmarkTypes(ctx).BenchmarkType { if task.BenchmarkTypeID == benchmarkType.Id { ctx.Data["BenchmarkTypeName"] = benchmarkType.First for _, benchmarkChildType := range benchmarkType.Second { @@ -1059,13 +1052,6 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) { return } - if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { - ctx.ServerError("Get BenchmarkTypes faild:", err) - return - } - } - for i, task := range ciTasks { ciTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) ciTasks[i].Cloudbrain.ComputeResource = task.ComputeResource @@ -1078,7 +1064,7 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) { ciTasks[i].TrainJobDuration = util.AddZero(duration/3600000) + ":" + util.AddZero(duration%3600000/60000) + ":" + util.AddZero(duration%60000/1000) ciTasks[i].BenchmarkTypeName = "" if task.BenchmarkTypeID > 0 { - for _, benchmarkType := range benchmarkTypes.BenchmarkType { + for _, benchmarkType := range GetBenchmarkTypes(ctx).BenchmarkType { if task.BenchmarkTypeID == benchmarkType.Id { ciTasks[i].BenchmarkTypeRankLink = benchmarkType.RankLink ciTasks[i].BenchmarkTypeName = benchmarkType.First @@ -1102,15 +1088,8 @@ func GetChildTypes(ctx *context.Context) { benchmarkTypeID := ctx.QueryInt("benchmark_type_id") re := make(map[string]interface{}) for { - if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err, ctx.Data["MsgID"]) - re["errMsg"] = "system error" - break - } - } var isExist bool - for _, benchmarkType := range benchmarkTypes.BenchmarkType { + for _, benchmarkType := range GetBenchmarkTypes(ctx).BenchmarkType { if benchmarkTypeID == benchmarkType.Id { isExist = true re["child_types"] = benchmarkType.Second @@ -1141,17 +1120,11 @@ func CloudBrainBenchmarkNew(ctx *context.Context) { ctx.HTML(200, tplCloudBrainBenchmarkNew) } -func getBenchmarkAttachment(benchmarkTypeID, benchmarkChildTypeID int) (*models.BenchmarkDataset, error) { +func getBenchmarkAttachment(benchmarkTypeID, benchmarkChildTypeID int, ctx *context.Context) (*models.BenchmarkDataset, error) { var childInfo *models.BenchmarkDataset - if benchmarkTypes == nil { - if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err) - return childInfo, err - } - } var isExist bool - for _, benchmarkType := range benchmarkTypes.BenchmarkType { + for _, benchmarkType := range GetBenchmarkTypes(ctx).BenchmarkType { if benchmarkType.Id == benchmarkTypeID { for _, childType := range benchmarkType.Second { if childType.Id == benchmarkChildTypeID { @@ -1265,7 +1238,7 @@ func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainF return } - childInfo, err := getBenchmarkAttachment(benchmarkTypeID, benchmarkChildTypeID) + childInfo, err := getBenchmarkAttachment(benchmarkTypeID, benchmarkChildTypeID, ctx) if err != nil { log.Error("getBenchmarkAttachment failed:%v", err, ctx.Data["MsgID"]) cloudBrainNewDataPrepare(ctx) @@ -1395,3 +1368,17 @@ func BenchmarkDel(ctx *context.Context) { ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain/benchmark") } } + +func GetBenchmarkTypes(ctx *context.Context) *models.BenchmarkTypes { + var lang = ctx.Locale.Language() + if benchmarkTypesMap[lang] == nil { + var val = i18n.Tr(lang, BENCHMARK_TYPE_CODE) + var tempType *models.BenchmarkTypes + if err := json.Unmarshal([]byte(val), &tempType); err != nil { + log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", val, err, ctx.Data["MsgID"]) + return &models.BenchmarkTypes{} + } + benchmarkTypesMap[lang] = tempType + } + return benchmarkTypesMap[lang] +} diff --git a/templates/admin/cloudbrain/list.tmpl b/templates/admin/cloudbrain/list.tmpl index 9aac97e70..39b2c21de 100644 --- a/templates/admin/cloudbrain/list.tmpl +++ b/templates/admin/cloudbrain/list.tmpl @@ -43,26 +43,26 @@ {{$.i18n.Tr "repo.cloudbrain_status_runtime"}}
你确认删除该任务么?此任务一旦删除不可恢复。
+{{.i18n.Tr "cloudbrain.task_delete_confirm"}}
你确认删除该任务么?此任务一旦删除不可恢复。
+{{.i18n.Tr "cloudbrain.task_delete_confirm"}}
训练程序 | - +
train.py
@@ -314,19 +314,19 @@ td, th {
测试程序
|
-
+
|
test.py
| ||||||||||||||||||||||||||||||||||
- {{$.i18n.Tr "repo.modelarts.train_job.description"}} + {{$.i18n.Tr "repo.modelarts.train_job.description"}} | - +
{{.Description}}
@@ -336,9 +336,9 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.standard"}}
+ {{$.i18n.Tr "repo.modelarts.train_job.standard"}}
|
-
+
|
{{$.resource_spec}}
@@ -348,9 +348,9 @@ td, th {
- 创建者
+ 创建者
|
-
+
|
{{.User.Name}}
@@ -359,9 +359,9 @@ td, th {
- 子类型
+ 子类型
|
-
+
|
{{$.BenchmarkChildTypeName}}
@@ -373,7 +373,7 @@ td, th {
-
+
@@ -386,11 +386,11 @@ td, th {
-
+
-
+
-
+
@@ -400,24 +400,24 @@ td, th {
- 删除任务
+ {{.i18n.Tr "cloudbrain.delete_task"}}
-
+
-
你确认删除该任务么?此任务一旦删除不可恢复。 +{{.i18n.Tr "cloudbrain.task_delete_confirm"}}
-
+
-
+
+
{{range .Tasks}}
-
+
-
-
+
- {{.ModelName}} {{.ModelVersion}}
+
-
+
+ {{.ModelName}} {{.ModelVersion}}
@@ -126,12 +126,12 @@
{{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}}
-
- {{.TrainJobDuration}}
+
@@ -171,17 +171,17 @@
+ {{.TrainJobDuration}}
@@ -205,18 +205,18 @@
-
+
- 删除任务
+ {{.i18n.Tr "cloudbrain.delete_task"}}
-
你确认删除该任务么?此任务一旦删除不可恢复。 +{{.i18n.Tr "cloudbrain.task_delete_confirm"}}
- 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。
+ {{.i18n.Tr "cloudbrain.job_name_rule"}}
-
+
@@ -107,7 +107,7 @@
-
+
@@ -123,10 +123,10 @@
-
+
-
@@ -195,9 +195,9 @@
- 查看样例
+ {{.i18n.Tr "cloudbrain.view_sample"}}
@@ -222,7 +222,7 @@
{{end}}
${element.FileName} `
}
-
+
})
$('#model_checkpoint').append(html)
$("#select_model_checkpoint").removeClass("loading")
@@ -332,7 +332,7 @@
$("#select_model_checkpoint").dropdown('set text',initVersionText)
$("#select_model_checkpoint").dropdown('set value',initVersionValue,initVersionText,$('#model_name_version div.item:first-child'))
})
-
+
$("input#ai_model_version").val(text)
$("input#ai_model_label").val(label)
@@ -348,15 +348,15 @@
}
$('.question.circle.icon').hover(function(){
- $(this).popup('show')
+ $(this).popup('show')
});
// 参数增加、删除、修改、保存
function Add_parameter(i){
value = '' +
- ' '
$(".dynamic.field").append(value)
- }
+ }
$('#add_run_para').click(function(){
var len = $(".dynamic.field .two.fields").length
@@ -459,7 +459,7 @@
onSuccess: function(){
document.getElementById("mask").style.display = "block"
},
- onFailure: function(e){
+ onFailure: function(e){
return false;
}
})
@@ -470,8 +470,8 @@
}
}
$('.ui.create_train_job.green.button').click(function(e) {
- send_run_para()
+ send_run_para()
get_name()
validate()
})
-
\ No newline at end of file
+
diff --git a/templates/repo/modelarts/inferencejob/show.tmpl b/templates/repo/modelarts/inferencejob/show.tmpl
index 4e221acd4..e11919b71 100644
--- a/templates/repo/modelarts/inferencejob/show.tmpl
+++ b/templates/repo/modelarts/inferencejob/show.tmpl
@@ -82,7 +82,7 @@
vertical-align: inherit;
}
.ti-text-form-label {
-
+
padding-bottom: 20px;
padding-right: 20px;
color: #8a8e99;
@@ -152,7 +152,7 @@ td, th {
opacity: .45 !important;
}
.pad20{
-
+
border:0px !important;
}
.model_file_bread{
@@ -180,12 +180,12 @@ td, th {
{{with .task}}
' +
- ' ' +
- ' ' +
+ '' +
+ ' ' +
+ ' ' +
' ' +
'' +
' '+
@@ -366,7 +366,7 @@
'' +
'
@@ -218,7 +218,7 @@ td, th {
{{$.i18n.Tr "repo.modelarts.run_version"}}
|
-
+
|
{{.VersionName}}
@@ -227,9 +227,9 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.start_time"}}
+ {{$.i18n.Tr "repo.modelarts.train_job.start_time"}}
|
-
+
|
{{TimeSinceUnix1 .CreatedUnix}}
@@ -238,9 +238,9 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}
+ {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}
|
-
+
|
{{.TrainJobDuration}}
@@ -248,23 +248,23 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.AI_driver"}}
+ {{$.i18n.Tr "repo.modelarts.train_job.AI_driver"}}
|
|
-
+
{{.EngineName}}
{{$.i18n.Tr "repo.model.manage.description"}}
|
-
+
|
{{if .Description}}
@@ -279,7 +279,7 @@ td, th {
创建人
|
-
+
|
{{$.userName}}
@@ -288,7 +288,7 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.compute_node"}}
+ {{$.i18n.Tr "repo.modelarts.train_job.compute_node"}}
|
|
@@ -304,19 +304,19 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.infer_job_model"}}
+ {{$.i18n.Tr "repo.modelarts.infer_job_model"}}
|
|
{{.ModelName}}
{{$.i18n.Tr "repo.modelarts.version"}}:{{.ModelVersion}}
-
+
- {{$.i18n.Tr "repo.modelarts.infer_job_model_file"}}
+ {{$.i18n.Tr "repo.modelarts.infer_job_model_file"}}
|
|
@@ -328,10 +328,10 @@ td, th {
{{$.i18n.Tr "repo.modelarts.model_label"}}
|
-
+
|
-
+
{{if .LabelName}}
{{range $.labelName}}
{{.}}
@@ -342,7 +342,7 @@ td, th {
{{$.i18n.Tr "repo.modelarts.code_version"}}
@@ -358,7 +358,7 @@ td, th {
|
{{$.i18n.Tr "repo.modelarts.train_job.start_file"}}
|
-
+
|
{{.BootFile}}
@@ -367,9 +367,9 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.infer_dataset"}}
+ {{$.i18n.Tr "repo.modelarts.infer_dataset"}}
|
-
+
|
{{.DatasetName}}
@@ -378,9 +378,9 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}}
+ {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}}
|
-
+
|
{{if .Parameters}}
@@ -393,9 +393,9 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.standard"}}
+ {{$.i18n.Tr "repo.modelarts.train_job.standard"}}
|
-
+
| "
html += "
{{.FlavorName}}
@@ -407,10 +407,10 @@ td, th {
-
+
-
+
@@ -434,34 +434,34 @@ td, th {
-
+
-
+
{{end}}
-
-
-
-
-
+
+
+
+
+
- 删除任务
+ {{.i18n.Tr "cloudbrain.delete_task"}}
-
+
-
你确认删除该任务么?此任务一旦删除不可恢复。 +{{.i18n.Tr "cloudbrain.task_delete_confirm"}} ' + data.Content) + $(`#log${version_name}`).append('' + data.Content) } - + } }).fail(function(err) { console.log(err); @@ -529,7 +529,7 @@ function logScroll(version_name) { $(`.message${version_name} #header`).text('您已翻阅至日志顶部') $(`.message${version_name}`).css('display', 'block') setTimeout(function(){ - $(`.message${version_name}`).css('display', 'none') + $(`.message${version_name}`).css('display', 'none') }, 1000) }else{ $(`#log${version_name} input[name=start_line]`).val(data.StartLine) //如果变动就改变所对应的值 @@ -557,7 +557,7 @@ function loadModelFile(version_name,parents,filename,init){ filename = filename || '' init = init || '' $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/inference-job/${jobID}/result_list?version_name=${version_name}&parentDir=${parents}`, (data) => { - $(`#dir_list${version_name}`).empty() + $(`#dir_list${version_name}`).empty() renderDir(data,version_name) if(init==="init"){ $(`input[name=model${version_name}]`).val("") @@ -565,7 +565,7 @@ function loadModelFile(version_name,parents,filename,init){ $(`#file_breadcrumb${version_name}`).empty() let htmlBread = "" htmlBread += ` "
html += "" + data.Dirs[i].ModTime + ""
html += " | "
html += " |
你确认删除该任务么?此任务一旦删除不可恢复。
+{{.i18n.Tr "cloudbrain.task_delete_confirm"}}
你确认删除该任务么?此任务一旦删除不可恢复。
+{{.i18n.Tr "cloudbrain.task_delete_confirm"}}