Browse Source

优化主动学习

pull/225/head
chenzhihang 8 months ago
parent
commit
b78b0075cd
2 changed files with 16 additions and 2 deletions
  1. +4
    -0
      ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/constant/Constant.java
  2. +12
    -2
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnInsServiceImpl.java

+ 4
- 0
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/constant/Constant.java View File

@@ -67,6 +67,10 @@ public class Constant {
public final static String ML_TextClassification = "text_classification";
public final static String ML_VideoClassification = "video_classification";

public final static String AL_PYTORCH = "pytorch";
public final static String AL_SKLEARN = "sklearn";
public final static String AL_KERAS = "keras";

public final static String DelFlag = "2";

public final static String Code = "123123";


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

@@ -291,9 +291,19 @@ public class ActiveLearnInsServiceImpl implements ActiveLearnInsService {
return aimUrl + "/metrics?select=" + decode;
}

public void getTrialList(ActiveLearnIns ins) {
public void getTrialList(ActiveLearnIns ins) throws IOException {
String directoryPath = ins.getResultPath();
ins.setResultPath(endpoint + "/" + directoryPath + "/final_checkpoint/final_model_weights.pth");
switch ((String) JsonUtils.jsonToMap(ins.getParam()).get("framework_type")) {
case Constant.AL_PYTORCH: {
ins.setResultPath(endpoint + "/" + directoryPath + "/final_checkpoint/final_model_weights.pth");
}
case Constant.AL_SKLEARN: {
ins.setResultPath(endpoint + "/" + directoryPath + "/final_checkpoint/final_model.joblib");
}
case Constant.AL_KERAS: {
ins.setResultPath(endpoint + "/" + directoryPath + "/final_checkpoint/model.h5");
}
}

try {
String bucketName = directoryPath.substring(0, directoryPath.indexOf("/"));


Loading…
Cancel
Save