seriffic Claude Opus 4.7 (1M context) commited on
Commit
bf7ea70
·
1 Parent(s): 5b8e335

fix(prithvi): drop .view() on lists; enrich warmup traceback

Browse files

Diag output from the previous deploy:

warm/prithvi: AttributeError: 'list' object has no attribute 'view'

The yaml-instantiated GenericNonGeoSegmentationDataModule stores
`means` and `stds` as Python lists (verified against the v2
config). The previous patch chained `_old.means.view(-1)
.detach().clone()` BEFORE handing them to _DictNormalize, which
crashed on the .view() call before reaching the conversion logic
inside the class.

Fix: pass `_old.means` and `_old.stds` to _DictNormalize raw.
The class's `_torch.as_tensor(mean).view(-1, 1, 1).float()` handles
list-to-tensor conversion internally — same end state, no
precondition that assumes the inputs are already tensors.

Also: lifespan warmup now stores a 5-line traceback tail in
_LAST_ERR so the next regression surfaces with a real stack
location through /healthz and /v1/diag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

2 files changed +23 -11
Files changed (2)
app/flood_layers/prithvi_live.py+8-4
services/riprap-models/main.py+15-7