Refactor: 프로젝트 당 학습 모델 1개

This commit is contained in:
정현조 2024-10-04 13:43:04 +09:00
parent b841e61730
commit 4866027334
2 changed files with 4 additions and 3 deletions

View File

@ -70,6 +70,7 @@ export default function TrainingSettings({
const selected = models?.find((model) => model.id === parseInt(value, 10)); const selected = models?.find((model) => model.id === parseInt(value, 10));
setSelectedModel(selected || null); setSelectedModel(selected || null);
}} }}
disabled={isWaiting || isTraining}
/> />
</div> </div>

View File

@ -34,13 +34,13 @@ export default function TrainingTab({ projectId }: TrainingTabProps) {
); );
setIsTraining(newIsTraining); setIsTraining(newIsTraining);
if (selectedModel && trainingModels.some((model) => model.id === selectedModel.id)) { if (trainingModels.length > 0) {
setSelectedModel(selectedModel); setSelectedModel(trainingModels[0]);
} else { } else {
setSelectedModel(null); setSelectedModel(null);
} }
} }
}, [models, selectedModel]); }, [models]);
useEffect(() => { useEffect(() => {
if (models && selectedModel) { if (models && selectedModel) {