diff --git a/models/org.go b/models/org.go index 2a6528023..c956f1f89 100755 --- a/models/org.go +++ b/models/org.go @@ -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) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 12d254812..13791de6d 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -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") { diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index bcc6f6156..3b4e8738f 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -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), ¶meters) 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