diff --git a/README.md b/README.md index c39f8425..fdc54fad 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/ui/src/app/api/datasets/delete/route.tsx b/ui/src/app/api/datasets/delete/route.tsx index 9a1d970e..3ec3e426 100644 --- a/ui/src/app/api/datasets/delete/route.tsx +++ b/ui/src/app/api/datasets/delete/route.tsx @@ -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 }); } } diff --git a/ui/src/app/api/jobs/[jobID]/delete/route.ts b/ui/src/app/api/jobs/[jobID]/delete/route.ts index 618e33f4..626c0053 100644 --- a/ui/src/app/api/jobs/[jobID]/delete/route.ts +++ b/ui/src/app/api/jobs/[jobID]/delete/route.ts @@ -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({