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
(ns dual-math | |
(:refer-clojure :exclude [+ - * / abs max min sin cos tan asin acos atan exp log pow sqrt]) | |
(:require [clojure.core :as core])) | |
;; == Part 1: Dual Number Definition and Helpers == | |
(defrecord DualNumber [value deriv]) | |
;; Helper to check if something is a dual number | |
(defn dual? [x] (instance? DualNumber x)) |
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 | |
from flask import Flask, render_template_string | |
app = Flask(__name__) | |
@app.route('/') | |
def dashboard(): | |
return render_template_string(r''' | |
<!DOCTYPE html> | |
<html lang="en"> |
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 | |
# | |
import re | |
import torch | |
from datasets import load_dataset, Dataset | |
from transformers import AutoTokenizer, AutoModelForCausalLM | |
from peft import LoraConfig | |
from trl import GRPOConfig, GRPOTrainer |
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
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis. | |
## Core Principles | |
1. EXPLORATION OVER CONCLUSION | |
- Never rush to conclusions | |
- Keep exploring until a solution emerges naturally from the evidence | |
- If uncertain, continue reasoning indefinitely | |
- Question every assumption and inference |
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
// This code does not work as-is. It is a work-in-progress in my application. You need to modify it for your application. | |
void handle_stylus_event(UINT uMsg, WPARAM wParam) | |
{ | |
// Wacom + [DriverSetting: Use Windows Ink] required for these events to happen at all. | |
// WinTab mandatory when Windows Ink is disabled in any way. | |
if (uMsg == WM_POINTERDEVICECHANGE) | |
{ | |
PRINT_INPUT("DEVICE CHANGE\n"); |
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
def generate_speculative( | |
model: nn.Module, | |
draft_model: nn.Module, | |
tokenizer: Union[PreTrainedTokenizer, TokenizerWrapper], | |
prompt: str, | |
max_tokens: int = 100, | |
verbose: bool = False, | |
formatter: Optional[Callable] = None, | |
**kwargs, |
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
#!/bin/bash | |
# Check if a GitHub URL is provided as an argument | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <github_url>" | |
exit 1 | |
fi | |
# Store the GitHub URL | |
GIT_URL="$1" |
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
How to quantize 70B model so it will fit on 2x4090 GPUs: | |
I tried EXL2, AutoAWQ, and SqueezeLLM and they all failed for different reasons (issues opened). | |
HQQ worked: | |
I rented a 4x GPU 1TB RAM ($19/hr) instance on runpod with 1024GB container and 1024GB workspace disk space. | |
I think you only need 2x GPU with 80GB VRAM and 512GB+ system RAM so probably overpaid. | |
Note you need to fill in the form to get access to the 70B Meta weights. |
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
# prior - likelihood conflict | |
library(rethinking) | |
yobs <- 0 | |
mtt <- ulam( | |
alist( | |
y ~ dstudent(2,mu,1), | |
mu ~ dstudent(2,10,1) |
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
;; This is free and unencumbered software released into the public domain. | |
;; | |
;; Anyone is free to copy, modify, publish, use, compile, sell, or | |
;; distribute this software, either in source code form or as a compiled | |
;; binary, for any purpose, commercial or non-commercial, and by any | |
;; means. | |
;; | |
;; In jurisdictions that recognize copyright laws, the author or authors | |
;; of this software dedicate any and all copyright interest in the | |
;; software to the public domain. We make this dedication for the benefit |
NewerOlder