|
|
@@ -109,6 +109,7 @@ type GenerateNotebookJobReq struct { |
|
|
|
Spec *models.Specification |
|
|
|
CodeName string |
|
|
|
ModelPath string //参考启智GPU调试, 挂载/model目录用户的模型可以输出到这个目录 |
|
|
|
ModelStorageType int |
|
|
|
} |
|
|
|
|
|
|
|
func getEndPoint() string { |
|
|
@@ -215,14 +216,25 @@ func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (job |
|
|
|
datasetGrampus, cpCommand = getDatasetGPUGrampus(req.DatasetInfos) |
|
|
|
} |
|
|
|
if len(req.ModelName) != 0 { |
|
|
|
datasetGrampus = append(datasetGrampus, models.GrampusDataset{ |
|
|
|
Name: req.ModelName, |
|
|
|
Bucket: setting.Attachment.Minio.Bucket, |
|
|
|
EndPoint: setting.Attachment.Minio.Endpoint, |
|
|
|
ObjectKey: req.PreTrainModelPath, |
|
|
|
ReadOnly: true, |
|
|
|
ContainerPath: cloudbrain.PretrainModelMountPath, |
|
|
|
}) |
|
|
|
if req.ModelStorageType == models.TypeCloudBrainOne { |
|
|
|
datasetGrampus = append(datasetGrampus, models.GrampusDataset{ |
|
|
|
Name: req.ModelName, |
|
|
|
Bucket: setting.Attachment.Minio.Bucket, |
|
|
|
EndPoint: setting.Attachment.Minio.Endpoint, |
|
|
|
ObjectKey: req.PreTrainModelPath, |
|
|
|
ReadOnly: true, |
|
|
|
ContainerPath: cloudbrain.PretrainModelMountPath, |
|
|
|
}) |
|
|
|
} else { |
|
|
|
datasetGrampus = append(datasetGrampus, models.GrampusDataset{ |
|
|
|
Name: req.ModelName, |
|
|
|
Bucket: setting.Bucket, |
|
|
|
EndPoint: getEndPoint(), |
|
|
|
ReadOnly: true, |
|
|
|
ObjectKey: req.PreTrainModelPath, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
codeArchiveName := cloudbrain.DefaultBranchName + ".zip" |
|
|
|
codeGrampus = models.GrampusDataset{ |
|
|
|