Browse Source

实验模型导出元数据记录指标修改

dev-lhz
chenzhihang 1 year ago
parent
commit
52a306510d
3 changed files with 20 additions and 3 deletions
  1. +3
    -1
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/constant/Constant.java
  2. +16
    -1
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java
  3. +1
    -1
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java

+ 3
- 1
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/constant/Constant.java View File

@@ -23,7 +23,9 @@ public class Constant {

public final static int Git_Category_Id = 39;

public final static String Source_Export = "export";
public final static String Source_Auto_Export = "auto_export";

public final static String Source_Hand_Export = "hand_export";

public final static String Source_Add = "add";
}

+ 16
- 1
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java View File

@@ -23,6 +23,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.io.InputStreamResource;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
@@ -78,6 +79,11 @@ public class ModelsServiceImpl implements ModelsService {

@Resource
private AssetIconService assetIconService;

@Resource
@Lazy
private AimService aimsService;

@Resource
private NewHttpUtils httpUtils;
@Resource
@@ -711,7 +717,7 @@ public class ModelsServiceImpl implements ModelsService {
if (modelsVo.getModelVersionVos() != null && modelsVo.getModelVersionVos().size() != 0) {
String sourcePath = modelsVo.getModelVersionVos().get(0).getUrl();

if (Constant.Source_Export.equals(modelsVo.getModelSource())) {
if (Constant.Source_Hand_Export.equals(modelsVo.getModelSource())) {
String bucketName = sourcePath.split("/")[0];
String root_path = sourcePath.split("/")[1];
minioUtil.downloadFiles(bucketName, root_path, modelPath);
@@ -724,6 +730,8 @@ public class ModelsServiceImpl implements ModelsService {
ModelDependency1 buildingModel = modelDependency1Dao.getBuildingModel(modelsVo.getId(), modelsVo.getIdentifier(), modelsVo.getVersion());
if (buildingModel != null) {
modelMetaVo = JSON.parseObject(buildingModel.getMeta(), ModelMetaVo.class);
//获取指标
getMetrics(modelMetaVo);
}

//拼接生产的元数据后写入yaml文件
@@ -1124,4 +1132,11 @@ public class ModelsServiceImpl implements ModelsService {
userInfo.put("token", token);
return userInfo;
}

void getMetrics(ModelMetaVo modelMetaVo) throws Exception {
List<InsMetricInfoVo> expTrainInfos = aimsService.getExpTrainInfos(modelMetaVo.getTrainTask().getExperimentId());
for (InsMetricInfoVo expTrainInfo : expTrainInfos) {
System.out.println(expTrainInfo.getMetrics());
}
}
}

+ 1
- 1
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java View File

@@ -201,7 +201,7 @@ public class NewDatasetServiceImpl implements NewDatasetService {
//干掉目标文件夹
dvcUtils.deleteDirectory(datasetPath);

if (Constant.Source_Export.equals(datasetVo.getDatasetSource())) {
if (Constant.Source_Hand_Export.equals(datasetVo.getDatasetSource())) {
String bucketName = sourcePath.split("/")[0];
String root_path = sourcePath.split("/")[1];
minioUtil.downloadFiles(bucketName, root_path, datasetPath);


Loading…
Cancel
Save