diff --git a/server/src/features/weights/domain/exec_weights_process_scenario.ts b/server/src/features/weights/domain/exec_weights_process_scenario.ts index e22e254..42192be 100644 --- a/server/src/features/weights/domain/exec_weights_process_scenario.ts +++ b/server/src/features/weights/domain/exec_weights_process_scenario.ts @@ -7,6 +7,7 @@ import { MongoIdValidation } from "../../../core/validations/mongo_id_validation import { ProcessWatcherAndDatabaseUpdateService } from "../../datasets/domain/create_dataset_scenario"; import { WeightDBModel, IWeightModel } from "../models/weights_validation_model"; import { match } from "ts-pattern"; +import { FolderStructure } from "../../projects/domain/upload_file_to_to_project_scenario"; export class ExecWeightProcessScenario extends CallbackStrategyWithIdQuery { idValidationExpression = new MongoIdValidation(); @@ -15,8 +16,8 @@ export class ExecWeightProcessScenario extends CallbackStrategyWithIdQuery { return (await new IsHaveActiveProcessUseCase().call()).map(async () => { await WeightDBModel.findById(id).updateOne({ processStatus: "RUN" }); return match(model.processStatus) - .with("exec", "RUN", "none", () => this.exec(id, model, true)) - .with("new", () => this.exec(id, model, false)) + .with("exec", "RUN", "none", () => this.exec(id, model, false)) + .with("exec", "RUN", () => this.exec(id, model, true)) .otherwise(() => Result.error(`model status is ${model.processStatus}`)); }); }); @@ -27,12 +28,11 @@ export class ExecWeightProcessScenario extends CallbackStrategyWithIdQuery { .with(true, async () => { if (typeof model.project === "object" && typeof model.datasetId === "object") { console.log( - `${model.project.rootDir}/`, - `python3 $PYTHON_EDUCATION --path ${model.project.rootDir} --name ${model.name} --datasetName ${model.datasetId.name} --outpath ${model.project.rootDir} --type ${model.datasetId.formBuilder.output.typedataset} --epoch ${model.epoch} --pretrain ${preTrain}` + `python3 $PYTHON_EDUCATION --path ${model.project.rootDir}/${FolderStructure.datasets} --name ${model.name} --datasetName ${model.datasetId.name} --outpath ${model.project.rootDir}/${FolderStructure.weights} --type ${model.datasetId.formBuilder.output.typedataset} --epoch ${model.epoch} --pretrain ${preTrain}` ); return await new ExecProcessUseCase().call( `${model.project.rootDir}/`, - `python3 $PYTHON_EDUCATION --path ${model.project.rootDir} --name ${model.name} --datasetName ${model.datasetId.name} --outpath ${model.project.rootDir} --type ${model.datasetId.formBuilder.output.typedataset} --epoch ${model.epoch} --pretrain ${preTrain}`, + `python3 $PYTHON_EDUCATION --path ${model.project.rootDir}/${FolderStructure.datasets} --name ${model.name} --datasetName ${model.datasetId.name} --outpath ${model.project.rootDir}/${FolderStructure.weights} --type ${model.datasetId.formBuilder.output.typedataset} --epoch ${model.epoch} --pretrain ${preTrain}`, id, new ProcessWatcherAndDatabaseUpdateService(id as unknown as ObjectId, WeightDBModel) ); diff --git a/ui/src/features/skils/skill_card.tsx b/ui/src/features/skils/skill_card.tsx index 57e9c5d..8ba994c 100644 --- a/ui/src/features/skils/skill_card.tsx +++ b/ui/src/features/skils/skill_card.tsx @@ -100,6 +100,21 @@ export const SkillCard = (props: ISkillCardProps) => {