Skip to content

Instantly share code, notes, and snippets.

@am17an
am17an / mtp-bench.py
Last active June 10, 2026 20:02
MTP benchmark
#!/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:"},
@richard512
richard512 / mergecsv.sh
Last active March 16, 2017 19:28
merge all csv files in a directory into one csv file. one header. removes header from the other files
#!/bin/bash
awk 'FNR==1 && NR!=1{next;}{print}' *.csv > _ALL.csv