AI Agent commited on
Commit
e453ecf
·
1 Parent(s): a284745

Fix tracking API return types for PyTorch models

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -488,7 +488,11 @@ class CTM_ART17:
488
  best_pred = predictions[:, :, best_tick_idx].cpu().numpy()[0]
489
 
490
  # sync_out shape
491
- sync_matrix = sync_outs[0].cpu().numpy()[0] if isinstance(sync_outs, tuple) else sync_outs.cpu().numpy()[0] if sync_outs is not None else None
 
 
 
 
492
 
493
  result = {
494
  "predictions": final_pred.tolist(),
 
488
  best_pred = predictions[:, :, best_tick_idx].cpu().numpy()[0]
489
 
490
  # sync_out shape
491
+ if track:
492
+ # When track=True, sync_outs is a tuple of numpy arrays (synch_out_tracking, synch_action_tracking)
493
+ sync_matrix = sync_outs[0][0] if sync_outs[0] is not None and len(sync_outs[0]) > 0 else None
494
+ else:
495
+ sync_matrix = sync_outs[0].cpu().numpy()[0] if sync_outs[0] is not None else None
496
 
497
  result = {
498
  "predictions": final_pred.tolist(),