File size: 2,116 Bytes
73400c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python3
"""Simple test script to verify SHOREKEEPER is working."""

import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).parent.parent))

print("=" * 50)
print("Testing SHOREKEEPER-4B Installation")
print("=" * 50)

# Test 1: Import modules
print("\n1. Testing imports...")
try:
    from src.shorekeeper import SHOREKEEPER
    print("   βœ“ SHOREKEEPER imported successfully")
except Exception as e:
    print(f"   βœ— Failed to import SHOREKEEPER: {e}")
    sys.exit(1)

try:
    from src.council import Sentinel, BaseExpert, EXPERT_REGISTRY
    print("   βœ“ Council modules imported successfully")
except Exception as e:
    print(f"   βœ— Failed to import council: {e}")

try:
    from src.memory import JSONLibrary
    print("   βœ“ Memory module imported successfully")
except Exception as e:
    print(f"   βœ— Failed to import memory: {e}")

# Test 2: Create model instance
print("\n2. Creating SHOREKEEPER instance...")
try:
    model = SHOREKEEPER()
    print("   βœ“ Model created successfully")
    print(f"   βœ“ Number of experts: {len(model.experts)}")
    print(f"   βœ“ Expert names: {list(model.experts.keys())}")
except Exception as e:
    print(f"   βœ— Failed to create model: {e}")

# Test 3: Test memory
print("\n3. Testing memory system...")
try:
    mem_id = model.remember("Test fact: SHOREKEEPER is working")
    print(f"   βœ“ Memory stored with ID: {mem_id}")
    
    memories = model.recall("test")
    print(f"   βœ“ Memory recall found {len(memories)} items")
except Exception as e:
    print(f"   βœ— Memory test failed: {e}")

# Test 4: Test forward pass
print("\n4. Testing forward pass...")
try:
    import torch
    dummy_input = torch.randint(0, 1000, (1, 128))
    with torch.no_grad():
        output = model(dummy_input)
    print(f"   βœ“ Forward pass successful. Output shape: {output.shape}")
except Exception as e:
    print(f"   βœ— Forward pass failed: {e}")

print("\n" + "=" * 50)
print("βœ… All tests passed! SHOREKEEPER is ready.")
print("=" * 50)
print("\nTo run SHOREKEEPER:")
print("  python scripts/07_run_shorekeeper.py")