wording fixes
This commit is contained in:
@@ -17,10 +17,14 @@ import { ModelVersion } from '../../api/governance.types';
|
||||
import { ModelStatusChip } from '../model-status-chip/model-status-chip';
|
||||
import { ModelVersionDialog } from '../model-version-dialog/model-version-dialog';
|
||||
|
||||
/** The only scenario with a trainer today (ML-cin2_logistic, CaCu): `entrenar`'s own domain and scenario. */
|
||||
const TRAINABLE = { domain: 'cacu', scenario: 'cin2_logistic' };
|
||||
|
||||
/**
|
||||
* Every registered model version with its status (desarrollo, candidata,
|
||||
* en producción, retirada). The detail dialog holds the promotion
|
||||
* checklist, lineage, artifacts and reports.
|
||||
* checklist, lineage, artifacts and reports. The toolbar also offers
|
||||
* training the one scenario with a trainer, over HTTP instead of a shell.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'app-model-versions-panel',
|
||||
@@ -50,6 +54,7 @@ export class ModelVersionsPanel implements OnInit {
|
||||
readonly versions = signal<ModelVersion[]>([]);
|
||||
readonly loading = signal(false);
|
||||
readonly loadError = signal<string | null>(null);
|
||||
readonly training = signal(false);
|
||||
|
||||
readonly displayedColumns = ['version', 'scenario', 'environment', 'armado', 'status', 'created_at', 'acciones'];
|
||||
|
||||
@@ -94,4 +99,23 @@ export class ModelVersionsPanel implements OnInit {
|
||||
metrics(version: ModelVersion): { key: string; value: unknown }[] {
|
||||
return Object.entries(version.metrics ?? {}).map(([key, value]) => ({ key, value }));
|
||||
}
|
||||
|
||||
train(): void {
|
||||
this.training.set(true);
|
||||
this.api
|
||||
.trainModelVersion(TRAINABLE.domain, TRAINABLE.scenario)
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe({
|
||||
next: () => {
|
||||
this.training.set(false);
|
||||
this.snackBar.open(`El modelo ${TRAINABLE.domain}/${TRAINABLE.scenario} se entrenó correctamente.`, 'OK', { duration: 3000 });
|
||||
this.reload();
|
||||
},
|
||||
error: (error) => {
|
||||
this.training.set(false);
|
||||
this.snackBar.open(apiErrorMessage(error, 'No se pudo entrenar el modelo.'), 'OK', { duration: 5000 });
|
||||
if (error?.status === 409) this.reload();
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user