Download code/check_keys.py from unknownBrain/survivalanalysis_checkpointing: direct link, hf CLI and curl.
- Browser
- Download file 337 Bytes
-
https://huggingface.co/datasets/unknownBrain/survivalanalysis_checkpointing/resolve/main/code/check_keys.py
- Command line
-
hf download hf://datasets/unknownBrain/survivalanalysis_checkpointing/code/check_keys.py
-
curl -L -o check_keys.py https://huggingface.co/datasets/unknownBrain/survivalanalysis_checkpointing/resolve/main/code/check_keys.py
337 Bytes
| import torch | |
| import glob | |
| import os | |
| cfe_files = glob.glob('results/CFE/Fold_0/CFE_F1_*.pkl') | |
| latest_cfe = max(cfe_files, key=os.path.getmtime) | |
| checkpoint = torch.load(latest_cfe, weights_only=False) | |
| state_dict = checkpoint.get('model_state_dict', checkpoint) | |
| for i, key in enumerate(state_dict.keys()): | |
| if i < 10: | |
| print(key) | |