wip training
This commit is contained in:
@@ -2559,13 +2559,26 @@ class AnnotationDashboard:
|
||||
|
||||
signals = self.training_adapter.get_latest_signals()
|
||||
|
||||
# Get metrics from active inference sessions
|
||||
# Get metrics from active inference sessions or orchestrator
|
||||
metrics = {'accuracy': 0.0, 'loss': 0.0}
|
||||
if hasattr(self.training_adapter, 'inference_sessions'):
|
||||
for session in self.training_adapter.inference_sessions.values():
|
||||
if 'metrics' in session:
|
||||
metrics = session['metrics']
|
||||
break
|
||||
|
||||
# Try to get metrics from orchestrator first (most recent)
|
||||
if self.orchestrator and hasattr(self.orchestrator, 'primary_transformer_trainer'):
|
||||
trainer = self.orchestrator.primary_transformer_trainer
|
||||
if trainer and hasattr(trainer, 'training_history'):
|
||||
history = trainer.training_history
|
||||
if history.get('train_accuracy'):
|
||||
metrics['accuracy'] = history['train_accuracy'][-1] if history['train_accuracy'] else 0.0
|
||||
if history.get('train_loss'):
|
||||
metrics['loss'] = history['train_loss'][-1] if history['train_loss'] else 0.0
|
||||
|
||||
# Fallback to inference session metrics
|
||||
if metrics['accuracy'] == 0.0 and metrics['loss'] == 0.0:
|
||||
if hasattr(self.training_adapter, 'inference_sessions'):
|
||||
for session in self.training_adapter.inference_sessions.values():
|
||||
if 'metrics' in session and session['metrics']:
|
||||
metrics = session['metrics'].copy()
|
||||
break
|
||||
|
||||
return jsonify({
|
||||
'success': True,
|
||||
|
||||
@@ -1236,7 +1236,21 @@
|
||||
const accuracyPct = (data.metrics.accuracy * 100).toFixed(1);
|
||||
const lossVal = data.metrics.loss ? data.metrics.loss.toFixed(4) : '--';
|
||||
|
||||
document.getElementById('metric-accuracy').textContent = accuracyPct + '%';
|
||||
// CRITICAL FIX: Update live-accuracy and live-loss elements
|
||||
const liveAccuracyEl = document.getElementById('live-accuracy');
|
||||
const liveLossEl = document.getElementById('live-loss');
|
||||
if (liveAccuracyEl) {
|
||||
liveAccuracyEl.textContent = accuracyPct + '%';
|
||||
}
|
||||
if (liveLossEl) {
|
||||
liveLossEl.textContent = lossVal;
|
||||
}
|
||||
|
||||
// Also update metric-accuracy if it exists
|
||||
const metricAccuracyEl = document.getElementById('metric-accuracy');
|
||||
if (metricAccuracyEl) {
|
||||
metricAccuracyEl.textContent = accuracyPct + '%';
|
||||
}
|
||||
|
||||
// Update live banner with metrics
|
||||
const banner = document.getElementById('inference-status');
|
||||
|
||||
Reference in New Issue
Block a user