Browse Source

优化主动学习实例详情

dev-active_learn
chenzhihang 9 months ago
parent
commit
fcc06ef81c
2 changed files with 4 additions and 6 deletions
  1. +1
    -1
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/domain/ActiveLearnIns.java
  2. +3
    -5
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnInsServiceImpl.java

+ 1
- 1
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/domain/ActiveLearnIns.java View File

@@ -41,7 +41,7 @@ public class ActiveLearnIns {
private String nodeResult; private String nodeResult;


@TableField(exist = false) @TableField(exist = false)
private Map<String, Object> dataMap;
private String data;


@TableField(exist = false) @TableField(exist = false)
private List<Map<String, Object>> trialList; private List<Map<String, Object>> trialList;


+ 3
- 5
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnInsServiceImpl.java View File

@@ -270,8 +270,8 @@ public class ActiveLearnInsServiceImpl implements ActiveLearnInsService {


public void getTrialList(ActiveLearnIns ins) { public void getTrialList(ActiveLearnIns ins) {
String directoryPath = ins.getResultPath(); String directoryPath = ins.getResultPath();
ins.setResultPath(endpoint + "/" + directoryPath + "/final_checkpoint/final_model_weights.pth");


ins.setResultPath(endpoint + "/" + directoryPath);
try { try {
String bucketName = directoryPath.substring(0, directoryPath.indexOf("/")); String bucketName = directoryPath.substring(0, directoryPath.indexOf("/"));
String prefix = directoryPath.substring(directoryPath.indexOf("/") + 1, directoryPath.length()) + "/"; String prefix = directoryPath.substring(directoryPath.indexOf("/") + 1, directoryPath.length()) + "/";
@@ -282,11 +282,9 @@ public class ActiveLearnInsServiceImpl implements ActiveLearnInsService {
List<Map<String, Object>> trialList = JacksonUtil.parseJSONStr2MapList(trialJson); List<Map<String, Object>> trialList = JacksonUtil.parseJSONStr2MapList(trialJson);
ins.setTrialList(trialList); ins.setTrialList(trialList);


String dataJson = minioUtil.readObjectAsString(bucketName, prefix + "data.json");
Map<String, Object> dataMap = JacksonUtil.parseJSONStr2Map(dataJson);
ins.setDataMap(dataMap);

ins.setData(endpoint + "/" + directoryPath + "/data.json");
for (Map<String, Object> trial : trialList) { for (Map<String, Object> trial : trialList) {
trial.put("query_idx", endpoint + "/" + directoryPath + "/" + trial.get("query_idx"));
Integer trialId = (Integer) trial.get("trial_id"); Integer trialId = (Integer) trial.get("trial_id");
for (Map fileMap : fileMaps) { for (Map fileMap : fileMaps) {
String[] split = fileMap.get("name").toString().split("_"); String[] split = fileMap.get("name").toString().split("_");


Loading…
Cancel
Save