Browse Source

Merge pull request '解决issue#3388' (#3394) from zouap_static into V20221214

Reviewed-on: https://openi.pcl.ac.cn/OpenI/aiforge/pulls/3394
Reviewed-by: ychao_1983 <ychao_1983@sina.com>
pull/3396/head
ychao_1983 2 years ago
parent
commit
9f1fb49001
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      routers/repo/aisafety.go

+ 4
- 1
routers/repo/aisafety.go View File

@@ -847,6 +847,9 @@ func createForGPU(ctx *context.Context, jobName string) error {
codePath := setting.JobPath + jobName + cloudbrain.CodeMountPath
os.RemoveAll(codePath)

gitRepo, _ := git.OpenRepository(repo.RepoPath())
commitID, _ := gitRepo.GetBranchCommitID(cloudbrain.DefaultBranchName)

if err := downloadCode(repo, codePath, cloudbrain.DefaultBranchName); err != nil {
log.Error("downloadCode failed, %v", err, ctx.Data["MsgID"])
return errors.New("system error")
@@ -891,7 +894,7 @@ func createForGPU(ctx *context.Context, jobName string) error {
BranchName: cloudbrain.DefaultBranchName,
BootFile: BootFile,
Params: Params,
CommitID: "",
CommitID: commitID,
ModelName: modelName,
ModelVersion: modelVersion,
CkptName: CkptName,


Loading…
Cancel
Save