This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| 43-Parameter MLP for Multiplication — PyTorch Port | |
| Original solution by Stefan Mesken (Code Golf, 2019) | |
| Ported from TensorFlow to PyTorch with identical weights. | |
| A standard neural network architecture with weights that would emerge | |
| from actual training — not hand-crafted mathematical tricks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| 3-Parameter MLP for Addition | |
| A minimal neural network with weights that would emerge from actual training. | |
| Empirically verified: all random initializations converge to these exact weights. | |
| Architecture: Input(2) → Dense(1, linear) | |
| Parameters: 3 (weights [1, 1], bias 0) | |
| Max error: 0.0 (exact) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Deep AST-based static analysis of the dockercraft package. | |
| Designed to catch artifacts from parallel agent edits: | |
| - Duplicate/conflicting definitions across files | |
| - Broken import chains after renames | |
| - Orphaned references to moved/deleted symbols | |
| - Inconsistent class hierarchies | |
| - self.attr usage for attrs never set in __init__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| General-purpose AST-based Python module splitter. | |
| Analyzes any monolithic .py file, builds a full dependency graph with structural | |
| fingerprints, auto-discovers natural clusters, and produces split module files. | |
| Capabilities: | |
| - AST parsing with full symbol table (ast + inspect-style signatures) | |
| - Structural hashing (hashlib) to fingerprint each symbol for drift detection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <LLM_JUDGE_SPEC version="1.0" name="AntiLLMY" schema="1"> | |
| <mission>Score a passage for LLM-y speak (“slop”), using only the given text. Return a compact diagnosis plus concrete fixes.</mission> | |
| <!-- ===== Regex library (mechanically checkable signs) ===== --> | |
| <regex_library flags="i"> | |
| <!-- Tone / puffery / editorializing --> | |
| <pattern id="puffery_words">\b(stunning|breathtaking|must[- ]?(see|visit)|rich (?:cultural )?heritage|enduring(?:\s+legacy)?|nestled|in the heart of|watershed moment|stands as|serves as|is a testament|plays a (?:vital|significant) role|continues to captivate|solidifies)\b</pattern> | |
| <pattern id="editorialize">\b(it'?s (?:important|worth) (?:to note|noting)|no discussion would be complete|this (?:article|section) (?:wouldn'?t|would not) exist without)\b</pattern> | |
| <pattern id="weasel">\b(some (?:critics|observers|commentators) (?:argue|say|believe)|many (?:believe|say)|industry (?:reports|analysts) (?:suggest|say))\b</pattern> | |
| <pattern id="superficial_ing">\b(?:ens |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import json | |
| import time | |
| import copy | |
| from enum import Enum | |
| from typing import Dict, List, Any, Optional, Union, Iterator | |
| from dataclasses import dataclass, field | |
| class ModelErrorType(Enum): | |
| MAX_LENGTH = "1024" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import json | |
| import os | |
| import subprocess | |
| import time | |
| from typing import Dict, List, Any, Optional | |
| import uuid | |
| import shutil | |
| class ToolCallingTester: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <output_sequence function="x(i)=2(i)+2" i_start="0" i_end="10000" count="10001"> | |
| 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, 308, 310, 312, 314, 316, 318, 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 346, 348, 350, 352, 354, 356, 358, 360, 362, 364, 366, 368, 370, 372, 374, 376, 378, 380, 382, 384, 386, 388, 390, 392, 394, 396, 398, 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch, torch.nn.functional as F | |
| from transformers import AutoModelForCausalLM, AutoTokenizer, AutoProcessor | |
| from PIL import Image | |
| REVISION = "2025-04-14" # lock to a known good tag | |
| MODEL_ID = "vikhyatk/moondream2" | |
| device = "cuda" # or "cpu" / bitsandbytes / GGUF, etc. | |
| # 1️⃣ load model + text tokenizer | |
| model = AutoModelForCausalLM.from_pretrained( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch, torch.nn.functional as F | |
| from transformers import AutoProcessor, LlavaForConditionalGeneration | |
| from PIL import Image | |
| MODEL_ID = "llava-hf/llava-1.5-7b-hf" | |
| device = "cuda" | |
| model = LlavaForConditionalGeneration.from_pretrained( | |
| MODEL_ID, torch_dtype=torch.float16, device_map="auto") | |
| processor = AutoProcessor.from_pretrained(MODEL_ID) |
NewerOlder