Browse Source

Merge branch 'V20220601' of git.openi.org.cn:OpenI/aiforge into grampus

pull/2379/head
lewis 3 years ago
parent
commit
0d03842c86
3 changed files with 12 additions and 8 deletions
  1. +5
    -1
      models/org.go
  2. +3
    -3
      routers/repo/cloudbrain.go
  3. +4
    -4
      routers/repo/modelarts.go

+ 5
- 1
models/org.go View File

@@ -160,7 +160,11 @@ func UpdateOrgStatistics() {
has, _ := x.Get(orgStat)

orgStat.NumScore = numScore
if has {

count, err := GetPublicRepositoryCount(&org)
if err != nil || count == 0 {
x.ID(orgStat.ID).Delete(new(OrgStatistic))
} else if has {
x.ID(orgStat.ID).Cols("num_score").Update(&orgStat)
} else {
x.Insert(orgStat)


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

@@ -206,7 +206,7 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) {
ctx.Data["PageIsCloudBrain"] = true
displayJobName := form.DisplayJobName
jobName := util.ConvertDisplayJobNameToJobName(displayJobName)
image := form.Image
image := strings.TrimSpace(form.Image)
uuid := form.Attachment
jobType := form.JobType
gpuQueue := form.GpuType
@@ -1845,7 +1845,7 @@ func BenchMarkAlgorithmCreate(ctx *context.Context, form auth.CreateCloudBrainFo
ctx.Data["PageIsCloudBrain"] = true
displayJobName := form.DisplayJobName
jobName := util.ConvertDisplayJobNameToJobName(displayJobName)
image := form.Image
image := strings.TrimSpace(form.Image)
gpuQueue := form.GpuType
command := cloudbrain.CommandBenchmark
codePath := setting.JobPath + jobName + cloudbrain.CodeMountPath
@@ -2136,7 +2136,7 @@ func CloudBrainTrainJobNew(ctx *context.Context) {

func getTrainJobCommand(form auth.CreateCloudBrainForm) (string, error) {
var command string
bootFile := form.BootFile
bootFile := strings.TrimSpace(form.BootFile)
params := form.Params

if !strings.HasSuffix(bootFile, ".py") {


+ 4
- 4
routers/repo/modelarts.go View File

@@ -967,7 +967,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm)
description := form.Description
workServerNumber := form.WorkServerNumber
engineID := form.EngineID
bootFile := form.BootFile
bootFile := strings.TrimSpace(form.BootFile)
flavorCode := form.Flavor
params := form.Params
poolID := form.PoolID
@@ -1210,7 +1210,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ
description := form.Description
workServerNumber := form.WorkServerNumber
engineID := form.EngineID
bootFile := form.BootFile
bootFile := strings.TrimSpace(form.BootFile)
flavorCode := form.Flavor
params := form.Params
poolID := form.PoolID
@@ -1284,7 +1284,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ

var parameters models.Parameters
param := make([]models.Parameter, 0)
existDeviceTarget := true
existDeviceTarget := false
if len(params) != 0 {
err := json.Unmarshal([]byte(params), &parameters)
if err != nil {
@@ -1803,7 +1803,7 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference
description := form.Description
workServerNumber := form.WorkServerNumber
engineID := form.EngineID
bootFile := form.BootFile
bootFile := strings.TrimSpace(form.BootFile)
flavorCode := form.Flavor
params := form.Params
poolID := form.PoolID


Loading…
Cancel
Save