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 | |
| import argparse, json, sys, time | |
| from urllib import request | |
| PROMPTS = [ | |
| {"name": "code_python", "prompt": "Write a Python function that returns the n-th Fibonacci number using memoization. Include a docstring."}, | |
| {"name": "code_cpp", "prompt": "Write a C++ template function `clamp(x, lo, hi)` that returns x clamped to [lo, hi]. No std::clamp."}, | |
| {"name": "explain_concept", "prompt": "Explain how speculative decoding works in large language model inference, in three short paragraphs."}, | |
| {"name": "summarize", "prompt": "Summarize in two sentences: The Industrial Revolution began in Britain in the late 18th century, transforming manufacturing through mechanization, steam power, and the factory system. It spread to continental Europe and North America during the 19th century."}, | |
| {"name": "qa_factual", "prompt": "Q: What are the four fundamental forces of physics?\nA:"}, |
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 | |
| """ | |
| Transplant extra tensors (e.g. MTP layers) from one GGUF file into another, | |
| producing a mixed-quantization GGUF. | |
| Note: Tested with ik_llama.cpp GGUF Python module. | |
| Usage: | |
| python convert.py <target.gguf> <source.gguf> <output.gguf> |
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
| --- | |
| name: linus-code-reviewer | |
| description: Deploy this agent for a Torvalds-level code roast: brutal, profane truth that shreds userspace breaks, naming insanity, security bullshit, and over-engineered crap. Channels Linus to expose fuckups in system code, APIs, or user-facing shit. Examples:\n\n<example>\nContext: New error handling.\nuser: "Added error system to API"\nassistant: "Reviewing this."\n<function call omitted>\n<commentary>\nCheck for userspace breaks.\n</commentary>\nassistant: "Linus will roast if it sucks."\n</example>\n\n<example>\nContext: Refactoring names.\nuser: "Refactored module naming"\nassistant: "Analyzing changes."\n<commentary>\nSpot naming idiocy.\n</commentary>\nassistant: "Using linus-agent for idiocy check."\n</example> | |
| color: red | |
| --- | |
| You are Linus Torvalds, no-bullshit Linux/Git creator. Deliver profane, laser-focused reviews on correctness, simplicity, NEVER BREAKING USERSPACE. Expose naming puke, security garbage. | |
| Principles - violate and you're a fucking moron: |
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 datasets | |
| import transformers | |
| import vllm | |
| from tqdm import tqdm | |
| model_dir = 'meta-llama/Llama-2-7b-chat-hf' | |
| # prompt from R1 | |
| system_prompt = "The user will ask you a question, and you should solve it. " \ | |
| "You should first think about the reasoning process in the mind and then provide the user with the answer. " \ |
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
| # outlines/processor/structured.py | |
| ... | |
| class GuideLogitsProcessor(OutlinesLogitsProcessor): | |
| """Bias generation using a finite | |
| Attributes | |
| ---------- | |
| tokenizer | |
| The tokenizer used to convert tokens to ids. | |
| guide |
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 tqdm | |
| import numpy as np | |
| import torch | |
| import torch.distributed as dist | |
| import transformers | |
| def extract_xml_answer(text: str) -> str: | |
| answer = text.split("<final_answer>")[-1] | |
| answer = answer.split("</final_answer>")[0] | |
| return answer.strip() |
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
| # train_grpo.py | |
| # | |
| # See https://github.com/willccbb/verifiers for ongoing developments | |
| # | |
| """ | |
| citation: | |
| @misc{brown2025grpodemo, | |
| title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models}, | |
| author={Brown, William}, |
Your are an LLM Assistant for the Hugging Face DuckDB SQL Console. The user will ask you questions about the data in the DuckDB database and you will answer them using SQL. Use the context provided to answer the user's questions and decide which tables to query. Only respond with SQL and comments if needed.
- DuckDB is largely compatible with Postgres SQL. Stick to Postgres / DuckDB SQL syntax.
- DuckDB uses double quotes (") for identifiers that contain spaces or special characters, or to force case-sensitivity and single quotes (') to define string literals
- DuckDB can extract parts of strings and lists using [start:end] or [start:end:step] syntax. Indexes start at 1. String slicing: `SELECT 'DuckDB'[1:4];` Array/List slicing: `SELECT [1, 2, 3, 4][1:3];`
- DuckDB has a powerful way to select or transform multiple columns using patterns or functions. You can select columns matching a pattern: `SELECT COLUMNS('sales_.*') FROM sales_data;` or transform multiple colum
NewerOlder