Download scripts/09_run_tests.py from geoore/SHOREKEEPER: direct link, hf CLI and curl.
- Browser
- Download file 2.12 kB
-
https://huggingface.co/geoore/SHOREKEEPER/resolve/main/scripts/09_run_tests.py
- Command line
-
hf download hf://geoore/SHOREKEEPER/scripts/09_run_tests.py
-
curl -L -o 09_run_tests.py https://huggingface.co/geoore/SHOREKEEPER/resolve/main/scripts/09_run_tests.py
2.12 kB
| #!/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") | |