|
|
|
@@ -1,6 +1,8 @@ |
|
|
|
package com.ruoyi.platform.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON; |
|
|
|
import com.alibaba.fastjson2.JSONArray; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
import com.ruoyi.common.security.utils.SecurityUtils; |
|
|
|
import com.ruoyi.platform.annotations.CheckDuplicate; |
|
|
|
import com.ruoyi.platform.constant.Constant; |
|
|
|
@@ -294,7 +296,7 @@ public class ExperimentServiceImpl implements ExperimentService { |
|
|
|
ExperimentIns insert = experimentInsService.insert(experimentIns); |
|
|
|
//插入到模型依赖关系表 |
|
|
|
if (dependendcy != null && trainInfo != null) { |
|
|
|
insertModelDependencyNew(dependendcy, trainInfo, output, insert.getId(), experiment.getName()); |
|
|
|
insertModelDependencyNew(dependendcy, trainInfo, output, insert.getId(), experiment.getName(), experiment.getGlobalParam()); |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, Object> datasetDependendcy = (Map<String, Object>) converMap2.get("dataset_dependency"); |
|
|
|
@@ -488,7 +490,7 @@ public class ExperimentServiceImpl implements ExperimentService { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private void insertModelDependencyNew(Map<String, Object> dependendcy, Map<String, Object> trainInfo, Map<String, Object> output, Integer experimentInsId, String experimentName) throws Exception { |
|
|
|
private void insertModelDependencyNew(Map<String, Object> dependendcy, Map<String, Object> trainInfo, Map<String, Object> output, Integer experimentInsId, String experimentName, String globalParam) throws Exception { |
|
|
|
Iterator<Map.Entry<String, Object>> dependendcyIterator = dependendcy.entrySet().iterator(); |
|
|
|
Map<String, Object> modelTrain = (Map<String, Object>) trainInfo.get("model_train"); |
|
|
|
Map<String, Object> modelEvaluate = (Map<String, Object>) trainInfo.get("model_evaluate"); |
|
|
|
@@ -518,8 +520,17 @@ public class ExperimentServiceImpl implements ExperimentService { |
|
|
|
//处理镜像 |
|
|
|
Map<String, String> imagesMap = (Map<String, String>) modelTrainMap.get("image"); |
|
|
|
modelMetaVo.setImage(imagesMap.get("name")); |
|
|
|
|
|
|
|
//处理训练参数 todo |
|
|
|
// HashMap<String, Object> trainParam = (HashMap<String, Object>) modelTrainMap.get("params"); |
|
|
|
HashMap<String, Object> trainParam = new HashMap<>(); |
|
|
|
JSONArray jsonArray = JSONArray.parseArray(globalParam); |
|
|
|
for (int i = 0; i < jsonArray.size(); i++) { |
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i); |
|
|
|
String paramName = jsonObject.getString("param_name"); |
|
|
|
String paramValue = jsonObject.getString("param_value"); |
|
|
|
trainParam.put(paramName, paramValue); |
|
|
|
} |
|
|
|
modelMetaVo.setParams(trainParam); |
|
|
|
|
|
|
|
//处理source数据 |
|
|
|
List<Map<String, Object>> modelsList = (List<Map<String, Object>>) modelTrainMap.get("models"); |
|
|
|
|