feat: add hybrid bot implementation and enhance NNUE training pipeline with tactical data extraction

This commit is contained in:
2026-04-09 22:36:09 +02:00
parent 0bf1d52132
commit 5d4cf5f13c
16 changed files with 940 additions and 245 deletions
+4 -3
View File
@@ -13,8 +13,9 @@ def export_weights_to_binary(weights_file, output_file):
print(f"Error: Weights file not found at {weights_file}")
sys.exit(1)
# Load weights
state_dict = torch.load(weights_file, map_location='cpu')
# Load weights — handle both raw state dicts and full training checkpoints
loaded = torch.load(weights_file, map_location='cpu')
state_dict = loaded["model_state_dict"] if isinstance(loaded, dict) and "model_state_dict" in loaded else loaded
# Debug: print available layers
print(f"Available layers in {weights_file}:")
@@ -31,7 +32,7 @@ def export_weights_to_binary(weights_file, output_file):
f.write(struct.pack('<I', 1)) # version 1
# Write each weight tensor in order
for layer_name in ['l1.weight', 'l1.bias', 'l2.weight', 'l2.bias', 'l3.weight', 'l3.bias']:
for layer_name in ['l1.weight', 'l1.bias', 'l2.weight', 'l2.bias', 'l3.weight', 'l3.bias', 'l4.weight', 'l4.bias', 'l5.weight', 'l5.bias']:
if layer_name not in state_dict:
print(f"Error: Missing layer {layer_name}")
sys.exit(1)