Skip to content

Commit

Permalink
chore: add default actions
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkrieger committed Apr 14, 2024
1 parent baf52cd commit d0eea93
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/hooks/trainer/useTrainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,17 @@ export default function useTrainer(): TrainerAPI {
return { ...trainingState, actions: { reset: onReset } };
}

const trainingActions = {
downloadEmbeddings: onDownloadEmbeddings,
reset: onReset,
};

if (trainingState.type === "pretrained") {
return {
...trainingState,
actions: {
...trainingActions,
train: onTrain,
downloadEmbeddings: onDownloadEmbeddings,
reset: onReset,
},
};
}
Expand All @@ -198,20 +202,16 @@ export default function useTrainer(): TrainerAPI {
) {
return {
...trainingState,
actions: {
downloadEmbeddings: onDownloadEmbeddings,
reset: onReset,
},
actions: trainingActions,
};
}

// Done training state
return {
...trainingState,
actions: {
downloadEmbeddings: onDownloadEmbeddings,
...trainingActions,
train: onTrain,
reset: onReset,
},
};
}

0 comments on commit d0eea93

Please sign in to comment.