Load a Lightning checkpoint¶
Use this guide when you want inference and TimeSHAP from a pretrained model.
What you need¶
- checkpoint file (
.ckpt,.pt, or.pth) - dataset with the same feature semantics used during model training
- optionally, a scaler file (
.npz) withmeanandstd
Steps¶
- Start the app:
- In sidebar
Model: -
set
Model sourcetoLoad Lightning checkpoint -
Upload checkpoint and optional metadata:
Lightning checkpoint: upload fileLightning class path(optional):- format
package.module.ClassName - use when loading through
Class.load_from_checkpoint(...) Model attribute:- default
model -
set to where the
torch.nn.Modulelives on the loaded Lightning object -
Optional scaler:
- upload
.npzcontainingmeanandstdarrays -
lengths must equal number of selected features
-
Click
Load checkpoint
Validation checklist¶
After load:
Model Diagnosticsshould showActive model source: checkpoint- notes under diagnostics should describe how loading happened
- no exception should appear in the UI
Then run TimeSHAP as usual from TimeSHAP Local Explanations.
If it fails¶
Check:
- feature count matches checkpoint input
- preprocessing (column order, scaling) matches training-time setup
- model output is compatible with app contract:
(logits, seq_hidden, hidden_state)or(logits, seq_hidden)