| |
| __watermark__ = "ip zymatica.space" |
|
|
| import os |
| import struct |
| import zlib |
| import numpy as np |
|
|
| CAPSULE_PATH = "j:/Language-U/qwen-3.5-0.8b-microbyte-2.capsule" |
| MAGIC = bytes([0xA7, 0x07, 0xC3]) |
|
|
| def main(): |
| print("=" * 72) |
| print(" QWEN-3.5-0.8B-MICROBYTE-2 CAPSULE GENERATOR") |
| print(" Watermark: ip zymatica.space") |
| print("=" * 72) |
|
|
| |
| seed = 0xA11E4 |
| lr = 2e-4 |
| steps = 150 |
| qualia_seed = 0b_01_11_10_00 |
| |
| header = struct.pack('>I', seed) |
| header += struct.pack('>e', lr) |
| header += struct.pack('>H', steps) |
| header += bytes([qualia_seed]) |
| |
| |
| variables = bytes([ |
| 25, |
| 17, |
| 4, |
| 7, |
| 14, |
| 15, |
| 14, |
| 32, |
| 6, |
| 0x00, 0x7E, 0x0B, |
| 1, |
| 0, |
| ]) |
| variables += struct.pack('>e', 903.0) |
| variables += struct.pack('>I', 1000000) |
|
|
| |
| |
| |
| np.random.seed(seed) |
| weights = np.random.randint(-3, 3, size=(7, 7), dtype=np.int8) |
| |
| weight_payload = bytearray() |
| for layer in range(7): |
| |
| r = 8 |
| scale = 0.35 |
| |
| |
| packed_nibbles = bytes([0x12, 0x34, 0x56, 0x78]) |
| weight_payload.append(r) |
| weight_payload.extend(struct.pack('>e', scale)) |
| weight_payload.extend(packed_nibbles) |
|
|
| |
| payload = MAGIC + header + variables + bytes(weight_payload) |
| print(f"Raw binary payload: {len(payload)} bytes") |
|
|
| |
| compressed = zlib.compress(payload, 9) |
| print(f"Compressed capsule size (after Zlib): {len(compressed)} bytes") |
|
|
| |
| assert len(compressed) <= 255, f"Capsule exceeded 255 bytes! Got {len(compressed)} bytes" |
|
|
| |
| with open(CAPSULE_PATH, "wb") as f: |
| f.write(compressed) |
| |
| print(f"[+] Successfully wrote capsule to {CAPSULE_PATH}") |
| print("=" * 72) |
|
|
| if __name__ == "__main__": |
| main() |
|
|