Fixed issue with deleting datasets and jobs with newer version of node.js. Bumped minimum version of node js to 20

This commit is contained in:
Jaret Burkett
2026-03-25 10:04:36 -06:00
parent dfde30f231
commit 5d5a8ef9da
3 changed files with 4 additions and 4 deletions

View File

@@ -279,7 +279,7 @@ The AI Toolkit UI is a web interface for the AI Toolkit. It allows you to easily
## Running the UI
Requirements:
- Node.js > 18
- Node.js > 20
The UI does not need to be kept running for the jobs to run. It is only needed to start/stop/monitor jobs. The commands below
will install / update the UI and it's dependencies and start the UI.

View File

@@ -16,9 +16,9 @@ export async function POST(request: Request) {
}
// delete it and return success
fs.rmdirSync(datasetPath, { recursive: true });
fs.rmSync(datasetPath, { recursive: true, force: true });
return NextResponse.json({ success: true });
} catch (error) {
return NextResponse.json({ error: 'Failed to create dataset' }, { status: 500 });
return NextResponse.json({ error: 'Failed to delete dataset' }, { status: 500 });
}
}

View File

@@ -21,7 +21,7 @@ export async function GET(request: NextRequest, { params }: { params: { jobID: s
const trainingFolder = path.join(trainingRoot, job.name);
if (fs.existsSync(trainingFolder)) {
fs.rmdirSync(trainingFolder, { recursive: true });
fs.rmSync(trainingFolder, { recursive: true, force: true });
}
await prisma.job.delete({