하이퍼 파라미터 수정 #109
@@ -194,32 +194,37 @@ public class TrainJobService {
|
|||||||
Object out = paramsJson.get("outputFolder");
|
Object out = paramsJson.get("outputFolder");
|
||||||
if (out == null) return null;
|
if (out == null) return null;
|
||||||
|
|
||||||
String outputFolder = String.valueOf(out).trim(); // uuid
|
String outputFolder = String.valueOf(out).trim();
|
||||||
if (outputFolder.isEmpty()) return null;
|
if (outputFolder.isEmpty()) return null;
|
||||||
|
|
||||||
// 호스트 기준 경로
|
|
||||||
Path outDir = Paths.get(responseDir, outputFolder);
|
Path outDir = Paths.get(responseDir, outputFolder);
|
||||||
log.info("resume outDir response path: {}", outDir);
|
log.info("resume outDir response path: {}", outDir);
|
||||||
|
|
||||||
Path last = outDir.resolve("last_checkpoint");
|
Path last = outDir.resolve("last_checkpoint");
|
||||||
log.info("resume last response path: {}", last);
|
log.info("resume last response path: {}", last);
|
||||||
|
|
||||||
if (!Files.isRegularFile(last)) return null;
|
if (!Files.isRegularFile(last)) return null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String ckptFile = Files.readString(last).trim(); // epoch_10.pth
|
// last_checkpoint 내용 그대로 읽기
|
||||||
ckptFile = ckptFile.replace("/checkpoints", responseDir);
|
String containerPath = Files.readString(last).trim();
|
||||||
log.info("resume ckptFile: {}", ckptFile);
|
log.info("resume containerPath: {}", containerPath);
|
||||||
|
|
||||||
if (ckptFile.isEmpty()) return null;
|
if (containerPath.isEmpty()) return null;
|
||||||
|
|
||||||
Path ckptHost = outDir.resolve(ckptFile);
|
// 호스트 경로로 변환해서 실제 파일 존재 확인
|
||||||
log.info("resume ckptHost: {}", ckptHost);
|
String hostPathStr = containerPath.replace("/checkpoints", responseDir);
|
||||||
if (!Files.isRegularFile(ckptHost)) return null;
|
Path hostPath = Paths.get(hostPathStr);
|
||||||
|
|
||||||
// 컨테이너 경로 반환
|
log.info("resume hostPath: {}", hostPath);
|
||||||
return ckptFile;
|
|
||||||
|
if (!Files.isRegularFile(hostPath)) return null;
|
||||||
|
|
||||||
|
// 3컨테이너 경로 그대로 반환
|
||||||
|
return containerPath;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error("resume error", e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user