Add ability to download or delete the optimizer state from the ui

This commit is contained in:
Jaret Burkett
2026-05-29 08:56:22 -06:00
parent 5e84bf0d0b
commit 212cfe998a
2 changed files with 56 additions and 6 deletions

View File

@@ -44,5 +44,15 @@ export async function GET(request: NextRequest, { params }: { params: { jobID: s
};
});
// include the optimizer state if it exists
const optimizerPath = path.join(jobFolder, 'optimizer.pt');
if (fs.existsSync(optimizerPath)) {
const stats = fs.statSync(optimizerPath);
fileObjects.push({
path: optimizerPath,
size: stats.size,
});
}
return NextResponse.json({ files: fileObjects });
}