|
|
|
@@ -39,7 +39,6 @@ func saveModelByParameters(jobId string, versionName string, name string, versio |
|
|
|
modelPath := id |
|
|
|
var lastNewModelId string |
|
|
|
var modelSize int64 |
|
|
|
cloudType := models.TypeCloudBrainTwo |
|
|
|
|
|
|
|
log.Info("find task name:" + aiTask.JobName) |
|
|
|
aimodels := models.QueryModelByName(name, aiTask.RepoID) |
|
|
|
@@ -53,7 +52,7 @@ func saveModelByParameters(jobId string, versionName string, name string, versio |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
cloudType = aiTask.Type |
|
|
|
cloudType := aiTask.Type |
|
|
|
//download model zip //train type |
|
|
|
if cloudType == models.TypeCloudBrainTwo { |
|
|
|
modelPath, modelSize, err = downloadModelFromCloudBrainTwo(id, aiTask.JobName, "", aiTask.TrainUrl) |
|
|
|
@@ -61,6 +60,8 @@ func saveModelByParameters(jobId string, versionName string, name string, versio |
|
|
|
log.Info("download model from CloudBrainTwo faild." + err.Error()) |
|
|
|
return err |
|
|
|
} |
|
|
|
} else if cloudType == models.TypeCloudBrainOne { |
|
|
|
|
|
|
|
} |
|
|
|
accuracy := make(map[string]string) |
|
|
|
accuracy["F1"] = "" |
|
|
|
@@ -199,6 +200,18 @@ func downloadModelFromCloudBrainTwo(modelUUID string, jobName string, parentDir |
|
|
|
return dataActualPath, size, nil |
|
|
|
} |
|
|
|
|
|
|
|
func downloadModelFromCloudBrainOne(modelUUID string, jobName string, parentDir string, trainUrl string) (string, int64, error) { |
|
|
|
modelActualPath := storage.GetMinioPath(jobName, "/model/") |
|
|
|
destKeyNamePrefix := Model_prefix + models.AttachmentRelativePath(modelUUID) + "/" |
|
|
|
size, err := storage.MinioPathCopy(setting.Bucket, modelActualPath, destKeyNamePrefix) |
|
|
|
if err == nil { |
|
|
|
dataActualPath := setting.Bucket + "/" + destKeyNamePrefix |
|
|
|
return dataActualPath, size, nil |
|
|
|
} else { |
|
|
|
return "", 0, nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func DeleteModel(ctx *context.Context) { |
|
|
|
log.Info("delete model start.") |
|
|
|
id := ctx.Query("ID") |
|
|
|
|