From 84aa5dbd5f67619d322e63ce978f87ce30995dac Mon Sep 17 00:00:00 2001 From: Michael Quested Date: Mon, 11 Dec 2023 14:24:19 +0000 Subject: [PATCH] Remove training dialog --- src/pages/DataPage.svelte | 3 ++- src/pages/training/TrainingButton.svelte | 32 ++++++------------------ src/translations.ts | 6 ----- 3 files changed, 10 insertions(+), 31 deletions(-) diff --git a/src/pages/DataPage.svelte b/src/pages/DataPage.svelte index 60b3db7a6..1afbdcfe3 100644 --- a/src/pages/DataPage.svelte +++ b/src/pages/DataPage.svelte @@ -22,6 +22,7 @@ import { onMount } from 'svelte'; import TrainingButton from './training/TrainingButton.svelte'; import TabView from '../views/TabView.svelte'; + import { navigate } from '../router/paths'; let isConnectionDialogOpen = false; @@ -123,6 +124,6 @@ - + {/if} diff --git a/src/pages/training/TrainingButton.svelte b/src/pages/training/TrainingButton.svelte index 503794ce3..fbc2cdafc 100644 --- a/src/pages/training/TrainingButton.svelte +++ b/src/pages/training/TrainingButton.svelte @@ -9,10 +9,11 @@ import StandardButton from '../../components/StandardButton.svelte'; import { trainModel } from '../../script/ml'; import { t } from '../../i18n'; - import StandardDialog from '../../components/dialogs/StandardDialog.svelte'; import { Paths, navigate } from '../../router/paths'; import { gestures } from '../../script/stores/mlStore'; + export let type: 'navigate' | 'train' = 'train'; + $: trainButtonLabel = !$state.isPredicting ? 'menu.trainer.trainModelButton' : 'menu.trainer.trainNewModelButton'; @@ -27,36 +28,19 @@ trainingDialogOpen = false; }; - const startTraining = async (): Promise => { + const startTraining = () => { closeTrainingDialog(); + trainModel(); + }; + + const navitgateToTrainingPage = () => { navigate(Paths.TRAINING); - const shouldRedirect = await trainModel(); - if (shouldRedirect) { - navigate(Paths.MODEL); - } }; { - trainingDialogOpen = true; - }} + onClick={type === 'navigate' ? navitgateToTrainingPage : startTraining} disabled={trainingButtonDisabled} type="primary" >{$t(trainButtonLabel)} - - -
-

{$t('content.data.trainDialog.title')}

-

{$t('content.data.trainDialog.text')}

-
- {$t('connectMB.backButton')} - {$t('content.data.trainDialog.title')} -
-
-
diff --git a/src/translations.ts b/src/translations.ts index d3691abe2..493b4597c 100644 --- a/src/translations.ts +++ b/src/translations.ts @@ -62,9 +62,6 @@ export const translations: TranslationMap = { "content.data.recording.button.cancel": TRANSLATION_NEEDED, "content.data.recording.description": TRANSLATION_NEEDED, - "content.data.trainDialog.title": TRANSLATION_NEEDED, - "content.data.trainDialog.text": TRANSLATION_NEEDED, - // TRAINER PAGE: "content.trainer.failure.header": "Træning mislykkedes", "content.trainer.failure.body": "Træningen resulterede ikke i en brugbar model. Grunden til dette ligger sandsynligvis i dataet. Hvis dataet i forskellige klasser minder for meget om hinanden, kan dette resultere i nogle forskellige problemer i træningsprocessen, der ikke gør det muligt at træne modellen ordentligt.", @@ -327,9 +324,6 @@ export const translations: TranslationMap = { "content.data.recording.button.cancel": "Cancel recording", "content.data.recording.description": "Start action before the countdown finishes", - "content.data.trainDialog.title": "Train the model", - "content.data.trainDialog.text": "Do you want to train the model with the data you have added so you can test it?", - // TRAINER PAGE: "content.trainer.failure.header": "Training Failed", "content.trainer.failure.body": "The training did not result in a usable model. The reason for this is most likely the data used for training. If the data for different classes are too similar, this can result in issues in the training process.",