| @@ -26,7 +26,6 @@ import ( | |||||
| "code.gitea.io/gitea/modules/util" | "code.gitea.io/gitea/modules/util" | ||||
| "code.gitea.io/gitea/services/cloudbrain/resource" | "code.gitea.io/gitea/services/cloudbrain/resource" | ||||
| "code.gitea.io/gitea/services/reward/point/account" | "code.gitea.io/gitea/services/reward/point/account" | ||||
| uuid "github.com/satori/go.uuid" | |||||
| ) | ) | ||||
| const ( | const ( | ||||
| @@ -37,39 +36,6 @@ const ( | |||||
| tplModelSafetyTestShow = "repo/modelsafety/show" | tplModelSafetyTestShow = "repo/modelsafety/show" | ||||
| ) | ) | ||||
| func CloudBrainAiSafetyCreateTest(ctx *context.Context) { | |||||
| log.Info("start to create CloudBrainAiSafetyCreate") | |||||
| uuid := uuid.NewV4() | |||||
| id := uuid.String() | |||||
| seriaNoParas := ctx.Query("serialNo") | |||||
| fileName := ctx.Query("fileName") | |||||
| //if jobType == string(models.JobTypeBenchmark) { | |||||
| req := aisafety.TaskReq{ | |||||
| UnionId: id, | |||||
| EvalName: "test1", | |||||
| EvalContent: "test1", | |||||
| TLPath: "test1", | |||||
| Indicators: []string{"ACC", "ASS"}, | |||||
| CDName: "CIFAR10_1000_FGSM", | |||||
| BDName: "CIFAR10_1000基础数据集", | |||||
| } | |||||
| aisafety.GetAlgorithmList() | |||||
| if seriaNoParas != "" { | |||||
| aisafety.GetTaskStatus(seriaNoParas) | |||||
| } else { | |||||
| jsonStr, err := getJsonContent("http://192.168.207.34:8065/Test_zap1234/openi_aisafety/raw/branch/master/result/" + fileName) | |||||
| serialNo, err := aisafety.CreateSafetyTask(req, jsonStr) | |||||
| if err == nil { | |||||
| log.Info("serialNo=" + serialNo) | |||||
| time.Sleep(time.Duration(2) * time.Second) | |||||
| aisafety.GetTaskStatus(serialNo) | |||||
| } else { | |||||
| log.Info("CreateSafetyTask error," + err.Error()) | |||||
| } | |||||
| } | |||||
| } | |||||
| func GetAiSafetyTaskByJob(job *models.Cloudbrain) { | func GetAiSafetyTaskByJob(job *models.Cloudbrain) { | ||||
| if job == nil { | if job == nil { | ||||
| log.Error("GetCloudbrainByJobID failed") | log.Error("GetCloudbrainByJobID failed") | ||||