Skip to content

Instantly share code, notes, and snippets.

View wassname's full-sized avatar
🙃

wassname (Michael J Clark) wassname

🙃
  • I'm just a guy who likes to machine learn
  • IAU #90377 (Sedna), IAU #137924 (2000 BD19), IAU #85770 (1998 UP1), IAU #66063 (1998 RO1), and minor planet 1992 TY₁. from 2025 Feb 25.
  • X @wassname
  • LinkedIn in/mclark52
View GitHub Profile
@wassname
wassname / docustore_aten_asteroid_property_rights.md
Last active April 4, 2025 23:21
docustore_aten_asteroid_property_rights.md

Asteroid Claim

I, wassname, also known as Michael J Clark of Perth hereby establish a formal claim to the following celestial bodies. This claim is established with explicit intent toward future resource utilization. This declaration constitutes the formal establishment of property interest.

This claim encompasses the entirety of the bodies, including all constituent materials, spatial volume within 50 km of its center of mass, and any natural satellites that may be discovered in the future. The claim extends to all mineral, volatile, and material resources contained within this boundary.

Legal Framework Anticipation

While acknowledging current limitations in international space law regarding private property claims on celestial bodies, this declaration is established in anticipation of evolving legal frameworks that will eventually recognize early, persistent, and well-documented claims as humanity expands into the solar system.

@wassname
wassname / load_md_fm_j2_prompt.py
Created March 4, 2025 03:03
IMO the nicest prompt format is prompt.md.j2. Here we make the messages explicit, and the markdown and jinja syntax obvious
def split_frontmatter(fm_md_split :str):
"""Load prompt in md.jinja2 format
In this format we have multiple frontmatters and content sections, each defining a message. The idea here is to use jinja formatting in a promt.md.jinja file to make the markdown, and jinja formatting obvious
e.g.
---
role: system
---
@wassname
wassname / reddit_thread2md.py
Created December 26, 2024 00:46
Format a reddit thread into markdown suitable for an llm
# from https://github.dev/JosefAlbers/rd2md
import textwrap
from datetime import datetime
def format_flair(obj):
if obj.author_flair_text is not None:
return f" *{obj.author_flair_text}*"
return ""
@socketteer
socketteer / base_chat.py
Last active March 21, 2025 04:58
external_store
import anthropic
import sys
import os
import argparse
client = anthropic.Anthropic() # Will use ANTHROPIC_API_KEY from environment
DEFAULT_STORAGE_FILE = "/tmp/gist_files/continuation.txt"
def get_continuation(text):
@wassname
wassname / symphypothesis.py
Last active August 2, 2024 02:55
fhypothesis: a easy way to display hypothesis in python, kind of like assert
import sympy as sp
from typing import Dict, Any
from IPython.display import display
from sympy import init_printing
init_printing()
def shypothesis(hypothesis: str, variables: Dict[str, Any] = None, round=3, verbose=False):
"""
Evaluate a hypothesis using SymPy, showing simplified equation and result.
@wassname
wassname / choice_tree.py
Last active June 3, 2024 13:44
for huggingface transformers sometime you want to constrain output to json schema and record the probabilities on choices/enums. I use it when rating, judging. It's much more efficient than sampling multiple times.
from jaxtyping import Float, Int
import torch
from torch.nn import functional as F
from torch import Tensor
from typing import List, Callable, Tuple, Dict, Optional
import pandas as pd
from transformers import AutoModelForCausalLM, AutoTokenizer
def get_valid_next_choices(choices_tokens, current_tokens):
@wassname
wassname / hf_perplexity.py
Last active March 31, 2025 23:08
simple perplexity for huggingface models similar to llam..cpp
# Directly taken from https://huggingface.co/spaces/evaluate-measurement/perplexity/blob/main/perplexity.py
# TODO replace with a strided version https://github.com/huggingface/transformers/issues/9648#issuecomment-812981524
import numpy as np
import torch
import itertools
from torch.nn import CrossEntropyLoss
from tqdm.auto import tqdm
import torch.nn.functional as F
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
#Add e5-instruct-mistral layers, so they naming is different than
# original mistral instruct one
from __future__ import annotations
from typing import Sequence
from .constants import MODEL_ARCH, MODEL_TENSOR, MODEL_TENSORS, TENSOR_NAMES
@0xdevalias
0xdevalias / _gh-cli-copilot-api.md
Last active April 13, 2025 17:43
Some notes and references while exploring the GitHub CLI extension for the GitHub Copilot CLI
@wassname
wassname / STOP_DOING_MATH.md
Last active April 4, 2025 22:55
It turns out LLM's can generate the STOP DOING MATH meme https://knowyourmeme.com/memes/stop-doing-math

STOP DOING MATH

  • NUMBERS WERE NOT SUPPOSED TO BE GIVEN NAMES
  • YEARS OF COUNTING yet NO REAL-WORLD USE FOUND for going higher than your FINGERS
  • Wanted to go higher anyway for a laugh? We had a tool for that: It was called "GUESSING"
  • "Yes please give me ZERO of something. Please give me INFINITE of it" - Statements dreamed up by the utterly Deranged

LOOK at what Mathematicians have been demanding your Respect for all this time, with all the calculators & abacus we built for them