File size: 1,094 Bytes
6534252
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3

import sys
import os
sys.path.append('src')

print("Testing model loading...")

try:
    import torch
    print(f"✅ PyTorch version: {torch.__version__}")
    
    # Test checkpoint loading
    ckpt_path = "logs/test_glen_vault/GLEN_P2_test/checkpoint-7/model.safetensors"
    print(f"Checking checkpoint: {ckpt_path}")
    
    if os.path.exists(ckpt_path):
        print("✅ Checkpoint file exists")
        
        # Test loading
        print("Testing checkpoint loading...")
        state_dict = torch.load(ckpt_path, map_location="cpu", weights_only=False)
        print(f"✅ Checkpoint loaded successfully! Keys: {len(state_dict)}")
        
        # Check for 'state_dict' key
        if "state_dict" in state_dict:
            print("✅ Found 'state_dict' key")
            state_dict = state_dict["state_dict"]
        
        print(f"Final state dict keys: {len(state_dict)}")
        
    else:
        print("❌ Checkpoint file not found")
        
except Exception as e:
    print(f"❌ Error: {e}")
    import traceback
    traceback.print_exc()