predictions display

This commit is contained in:
Dobromir Popov
2025-12-08 22:59:16 +02:00
parent 5a4b0cf35b
commit 8c3dc5423e
3 changed files with 301 additions and 44 deletions

View File

@@ -2525,7 +2525,17 @@ class AnnotationDashboard:
if transformer_preds:
# Convert any remaining tensors to Python types before JSON serialization
transformer_pred = transformer_preds[-1].copy()
# CRITICAL: Log prediction structure to debug missing predicted_candle
logger.debug(f"Transformer prediction keys: {list(transformer_pred.keys())}")
if 'predicted_candle' in transformer_pred:
logger.debug(f"predicted_candle timeframes: {list(transformer_pred['predicted_candle'].keys()) if isinstance(transformer_pred['predicted_candle'], dict) else 'not a dict'}")
predictions['transformer'] = self._serialize_prediction(transformer_pred)
# Verify predicted_candle is preserved after serialization
if 'predicted_candle' not in predictions['transformer'] and 'predicted_candle' in transformer_pred:
logger.warning("predicted_candle was lost during serialization!")
if predictions:
response['prediction'] = predictions