sail / sail_scripts /inspect_pt.py
muterornament's picture
Industrialize: Backup sovereign training pipeline
e5b79b7 verified
Raw
History Blame Contribute Delete
584 Bytes
import torch
import sys
def inspect(file_path):
print(f"--- Inspecting {file_path} ---")
data = torch.load(file_path, map_location="cpu")
print("Config:", data.get('config', 'No config'))
state_dict = data.get('model_state_dict', {})
if state_dict:
for k, v in list(state_dict.items())[:10]:
print(f"Layer Key: {k} | Shape: {v.shape}")
print(f"... and {len(state_dict) - 10} more layer keys.")
else:
print("No model_state_dict found.")
if __name__ == "__main__":
inspect("/mnt/e/agent/agent_ai/sail/sail_7c3dcc01.pt")