best epoch 파일 선택 수정
This commit is contained in:
@@ -9,6 +9,7 @@ import java.io.InputStreamReader;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@@ -414,12 +415,10 @@ public class DockerTrainService {
|
|||||||
if (uuid == null || uuid.isBlank()) throw new IllegalArgumentException("uuid is required");
|
if (uuid == null || uuid.isBlank()) throw new IllegalArgumentException("uuid is required");
|
||||||
if (epoch == null || epoch <= 0) throw new IllegalArgumentException("epoch must be > 0");
|
if (epoch == null || epoch <= 0) throw new IllegalArgumentException("epoch must be > 0");
|
||||||
|
|
||||||
String modelFile =
|
Path epochPath = Paths.get(responseDir, req.getOutputFolder());
|
||||||
String.valueOf(findCheckpoint(Path.of(responseDir + req.getOutputFolder()), epoch));
|
|
||||||
|
|
||||||
if (modelFile == null || modelFile.isBlank()) {
|
Path checkpoint = findCheckpoint(epochPath, epoch);
|
||||||
throw new IllegalArgumentException("best model file is required");
|
String modelFile = checkpoint.toString();
|
||||||
}
|
|
||||||
|
|
||||||
List<String> c = new ArrayList<>();
|
List<String> c = new ArrayList<>();
|
||||||
|
|
||||||
@@ -469,7 +468,6 @@ public class DockerTrainService {
|
|||||||
return normalPath;
|
return normalPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 둘 다 없으면 null 또는 예외
|
throw new IllegalStateException("Checkpoint 파일이 없습니다. epoch=" + epoch);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user