| |
| """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) |
|
|
| |
| 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}") |
|
|
| |
| 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}") |
|
|
| |
| 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}") |
|
|
| |
| 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") |
|
|