#2732 解决#2647及相关国际化修改。

Merged
lewis merged 7 commits from zouap into V20220830 1 year ago
  1. +17
    -7
      models/dataset.go
  2. +8
    -4
      options/locale/locale_en-US.ini
  3. +5
    -2
      options/locale/locale_zh-CN.ini
  4. +10
    -0
      routers/repo/setting.go
  5. +3
    -3
      templates/home.tmpl
  6. +1
    -1
      templates/repo/cloudbrain/inference/show.tmpl
  7. +1
    -1
      templates/repo/cloudbrain/show.tmpl
  8. +1
    -1
      templates/repo/cloudbrain/trainjob/show.tmpl
  9. +1
    -1
      templates/repo/modelarts/inferencejob/show.tmpl
  10. +3
    -3
      templates/repo/modelarts/notebook/show.tmpl
  11. +1
    -1
      templates/repo/modelarts/trainjob/show.tmpl

+ 17
- 7
models/dataset.go View File

@@ -88,7 +88,7 @@ func (datasets DatasetList) loadAttributes(e Engine) error {
if err := e.
Where("id > 0").
In("id", keysInt64(set)).
Cols("id", "owner_id", "owner_name", "lower_name", "name", "description", "alias", "lower_alias","is_private").
Cols("id", "owner_id", "owner_name", "lower_name", "name", "description", "alias", "lower_alias", "is_private").
Find(&repos); err != nil {
return fmt.Errorf("find repos: %v", err)
}
@@ -121,12 +121,12 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions)
if attachment.DatasetID == datasets[i].ID {
if opts.StarByMe {

permission,ok := permissionMap[datasets[i].ID];
permission, ok := permissionMap[datasets[i].ID]
if !ok {

permission = false
datasets[i].Repo.GetOwner()
if datasets[i].Repo.Owner.IsOrganization() {
if datasets[i].Repo.Owner.IsOrganization() {
if datasets[i].Repo.Owner.IsUserPartOfOrg(opts.User.ID) {
log.Info("user is member of org.")
permission = true
@@ -140,10 +140,10 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions)
}
}

permissionMap[datasets[i].ID]=permission
permissionMap[datasets[i].ID] = permission
}

if permission{
if permission {
datasets[i].Attachments = append(datasets[i].Attachments, attachment)
} else if !attachment.IsPrivate {
datasets[i].Attachments = append(datasets[i].Attachments, attachment)
@@ -159,8 +159,8 @@ func (datasets DatasetList) loadAttachmentAttributes(opts *SearchDatasetOptions)
}

for i := range datasets {
if datasets[i].Attachments==nil{
datasets[i].Attachments=[]*Attachment{}
if datasets[i].Attachments == nil {
datasets[i].Attachments = []*Attachment{}
}
datasets[i].Repo.Owner = nil
}
@@ -585,3 +585,13 @@ func GetTeamDatasetIdsByUserID(userID int64) []int64 {
Cols("dataset.id").Find(&datasets)
return datasets
}

func UpdateDatasetCreateUser(ID int64, user *User) error {
_, err := x.Where("id = ?", ID).Cols("user_id").Update(&Dataset{
UserID: user.ID,
})
if err != nil {
return err
}
return nil
}

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

@@ -253,13 +253,15 @@ page_dev_env_desc2_desc=Associate the model with the code version, you can adjus
page_dev_env_desc3_title=Once Configuration, Multiple Reuse
page_dev_env_desc3_desc=Provide execution environment sharing, Once Configuration, Multiple Reuse. Lower the threshold of model development, and avoid spending repetitive time configuring complex environments.
page_dev_yunlao=OpenI AI Collaboration Platform
page_dev_yunlao_desc1=OpenI AI collaboration platform has cooperated with Pengcheng cloud brain and China computing power network (c ² Net) can be used to complete AI development tasks by using the rich computing resources of Pengcheng cloud brain and China computing network.
page_dev_yunlao_desc1=OpenI AI collaboration platform has cooperated with Pengcheng cloud brain and China computing power network (C²NET) can be used to complete AI development tasks by using the rich computing resources of Pengcheng cloud brain and China computing network.
page_dev_yunlao_desc2=Pengcheng CloudBrain's existing AI computing power is 100p FLOPS@FP16 (billions of half precision floating-point calculations per second), the main hardware infrastructure consists of GPU servers equipped with NVIDIA Tesla V100 and A100, and Atlas 900 AI clusters equipped with Kunpeng and shengteng processors.
page_dev_yunlao_desc3=China computing power network (c ² Net) phase I can realize high-speed network interconnection between different artificial intelligence computing centers, and realize reasonable scheduling of computing power and flexible allocation of resources. At present, 11 intelligent computing centers have been connected, and the total scale of computing power is 1924p OPS@FP16 。 Qizhi AI collaboration platform has been connected to Pengcheng Cloud Computing Institute, Chengdu Intelligent Computing Center, Zhongyuan Intelligent Computing Center, Hefei brain and other nodes.
page_dev_yunlao_desc3=China computing power network (C²NET) phase I can realize high-speed network interconnection between different artificial intelligence computing centers, and realize reasonable scheduling of computing power and flexible allocation of resources. At present, 11 intelligent computing centers have been connected, and the total scale of computing power is 1924p OPS@FP16. OpenI AI collaboration platform has been connected to Pengcheng Cloud Computing Institute, Chengdu Intelligent Computing Center, Zhongyuan Intelligent Computing Center, Hefei brain and other nodes.
page_dev_yunlao_desc4=Developers can freely select the corresponding computing resources according to the use needs, and can test the adaptability, performance, stability, etc. of the model in different hardware environments.
page_dev_yunlao_desc5=If your model requires more computing resources, you can also apply for it separately.
page_dev_yunlao_apply=Apply Separately

c2net_title=C²NET
c2net_desc=The artificial intelligence computing power network promotion alliance has access to 11 intelligent computing centers, with a total scale of 1924p.
c2net_center=Center
search=Search
search_repo=Repository
search_dataset=DataSet
@@ -822,6 +824,8 @@ title_format_err=Name can only contain number,letter,'-','_' or '.', and can be
description = Description
description_format_err=Description's length can be up to %s characters long.
create_dataset = Create Dataset
download_url=Download Url
download_oper=Operation
create_dataset_fail=Failed to create dataset.
query_dataset_fail=Failed to query dataset.
edit_attachment_fail=Failed to update description.
@@ -3094,7 +3098,7 @@ resource_cluster = Resource Cluster
resource_cluster_openi = OpenI Resource Cluster
resource_cluster_c2net = China Computing NET
resource_cluster_openi_simple = OpenI
resource_cluster_c2net_simple = Computing NET
resource_cluster_c2net_simple = C²NET
compute_resource = Computing resources
task_name = Task name
task_type = Task type


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

@@ -261,7 +261,9 @@ page_dev_yunlao_desc3=中国算力网(C²NET)一期可实现不同人工智
page_dev_yunlao_desc4=开发者可以根据使用需求,自由选择相应计算资源,可以测试模型在不同硬件环境下的适配能力、性能、稳定性等。
page_dev_yunlao_desc5=如果您的模型需要更多的计算资源,也可以单独申请。
page_dev_yunlao_apply=单独申请

c2net_title=智算网络
c2net_desc=人工智能算力网络推进联盟已接入11家智算中心,算力总规模1924P
c2net_center=中心
search=搜索
search_repo=项目
search_dataset=数据集
@@ -830,7 +832,8 @@ create_dataset=创建数据集
create_dataset_fail=创建数据集失败。
query_dataset_fail=查询数据集失败。
edit_attachment_fail=修改描述失败。

download_url=数据集下载地址
download_oper=操作
show_dataset=数据集
edit_dataset=编辑数据集
update_dataset=更新数据集


+ 10
- 0
routers/repo/setting.go View File

@@ -464,6 +464,16 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
}
return
}
dataset, err := models.GetDatasetByRepo(repo)
if err == nil {
if dataset != nil {
models.UpdateDatasetCreateUser(dataset.ID, newOwner)
} else {
log.Info("not found the dataset")
}
} else {
log.Info("error=" + err.Error())
}

log.Trace("Repository transferred: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newOwner)
ctx.Flash.Success(ctx.Tr("repo.settings.transfer_succeed"))


+ 3
- 3
templates/home.tmpl View File

@@ -89,8 +89,8 @@
<div class="ui vertical masthead secondary c2net segment">
<div class="ui container">
<div class="ui center am-pt-30 am-pb-30">
<h2>智算网络</h2>
<p><span class="ui text grey">人工智能算力网络推进联盟已接入11家智算中心,算力总规模1924P</p>
<h2>{{.i18n.Tr "home.c2net_title"}}</h2>
<p><span class="ui text grey">{{.i18n.Tr "home.c2net_desc"}}</p>
</div>

<div id="app" v-cloak>
@@ -98,7 +98,7 @@
<div class="rotation3D-baseMap"></div>
<!--旋转3D-->
<div id="rotation3D" class="rotation3D">
<button class="center">中心</button>
<button class="center">{{.i18n.Tr "home.c2net_center"}}</button>
<div class="itemList">
<div class="rotation3D__item" :class="item.type" v-for="item in itemList">


+ 1
- 1
templates/repo/cloudbrain/inference/show.tmpl View File

@@ -495,7 +495,7 @@
<div style="clear:both">
<table style="border:none" class="ui fixed small stackable table">
<thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">数据集文件</th>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">{{$.i18n.Tr "dataset.file"}}</th>
</tr></thead>
<tbody>
{{range $m ,$n := $.datasetDownload}}


+ 1
- 1
templates/repo/cloudbrain/show.tmpl View File

@@ -493,7 +493,7 @@
<div style="clear:both">
<table style="border:none" class="ui fixed small stackable table">
<thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">数据集文件</th>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">{{$.i18n.Tr "dataset.file"}}</th>
</tr></thead>
<tbody>
{{range $m ,$n := $.datasetDownload}}


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

@@ -459,7 +459,7 @@
<div style="clear:both">
<table style="border:none" class="ui fixed small stackable table">
<thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">数据集文件</th>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">{{$.i18n.Tr "dataset.file"}}</th>
</tr></thead>
<tbody>
{{range $m ,$n := $.datasetDownload}}


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

@@ -436,7 +436,7 @@ td, th {
<div style="clear:both">
<table style="border:none" class="ui fixed small stackable table">
<thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">数据集文件</th>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">{{$.i18n.Tr "dataset.file"}}</th>
</tr></thead>
<tbody>
{{range $m ,$n := $.datasetDownload}}


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

@@ -432,9 +432,9 @@
<div style="clear:both">
<table style="border:none" class="ui fixed small stackable table">
<thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide center aligned">数据集文件</th>
<th style="color: #8a8e99;font-size:12px"class="eleven wide">数据集下载地址</th>
<th style="color: #8a8e99;font-size:12px" class="two wide center aligned">操作</th>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide center aligned">{{$.i18n.Tr "dataset.file"}}</th>
<th style="color: #8a8e99;font-size:12px"class="eleven wide">{{$.i18n.Tr "dataset.download_url"}}</th>
<th style="color: #8a8e99;font-size:12px" class="two wide center aligned">{{$.i18n.Tr "dataset.download_oper"}}</th>
</tr></thead>
<tbody>
{{range $.datasetDownload}}


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

@@ -478,7 +478,7 @@
<div style="clear:both">
<table style="border:none" class="ui fixed small stackable table">
<thead>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">数据集文件</th>
<tr><th style="color: #8a8e99;font-size:12px" class="three wide left aligned">{{$.i18n.Tr "dataset.file"}}</th>
</tr></thead>
<tbody>
{{range $m ,$n := $.datasetList}}


Loading…
Cancel
Save