Skip to content

Instantly share code, notes, and snippets.

View richinseattle's full-sized avatar

richinseattle

View GitHub Profile
@hathibelagal-dev
hathibelagal-dev / diatest.ipynb
Last active April 23, 2025 23:25
diatest.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cpfiffer
cpfiffer / thinking-cap.py
Created January 22, 2025 18:11
Limit the number of characters DeepSeek R1 can use for thinking.
import outlines
from transformers import AutoTokenizer
model_string = 'deepseek-ai/DeepSeek-R1-Distill-Qwen-7B'
# model_string = 'deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B' # For small machines
model = outlines.models.transformers(
model_string,
device='cuda', # also 'cpu', 'mps','auto'
)
@vgel
vgel / r1.py
Last active March 29, 2025 15:50
script to run deepseek-r1 with a min-thinking-tokens parameter, replacing </think> with a random continuation string to extend the model's chain of thought
import argparse
import random
import sys
from transformers import AutoModelForCausalLM, AutoTokenizer, DynamicCache
import torch
parser = argparse.ArgumentParser()
parser.add_argument("question", type=str)
parser.add_argument(
@stong
stong / cups-browsed.md
Last active January 15, 2025 14:08
CUPS disclosure leaked online. Not my report. The original author is @evilsocket

Original report

  • Affected Vendor: OpenPrinting
  • Affected Product: Several components of the CUPS printing system: cups-browsed, libppd, libcupsfilters and cups-filters.
  • Affected Version: All versions <= 2.0.1 (latest release) and master.
  • Significant ICS/OT impact? no
  • Reporter: Simone Margaritelli [[email protected]]
  • Vendor contacted? yes The vendor has been notified trough Github Advisories and all bugs have been confirmed:
@mtisz
mtisz / llama-3-70B-qlora.yaml
Created May 15, 2024 16:47
Axolotl Config for Llama-3-70B QLoRA
base_model: meta-llama/Meta-Llama-3-70B
model_type: LlamaForCausalLM
tokenizer_type: AutoTokenizer
load_in_8bit: false
load_in_4bit: true
strict: false
datasets:
- path: /home/migel/ai_datasets/tess-v1.5b-chatml.jsonl
@seanchatmangpt
seanchatmangpt / gen_pydantic_instance.py
Last active April 1, 2025 05:41
Create DSPy Signatures from Pydantic Models
import ast
import logging
import inspect
from typing import Type, TypeVar
from dspy import Assert, Module, ChainOfThought, Signature, InputField, OutputField
from pydantic import BaseModel, ValidationError
logger = logging.getLogger(__name__)
logger.setLevel(logging.ERROR)
@veekaybee
veekaybee / normcore-llm.md
Last active April 26, 2025 07:54
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@shinyquagsire23
shinyquagsire23 / gist:ab6f7c0f9b6514b6b54d69b9a57646be
Created July 26, 2023 20:24
Enabling USB device mode on Intel devices (Tweet archive)
https://twitter.com/ShinyQuagsire/status/1536432635643211777 12:37 PM · Jun 13, 2022
-----
I figured out how to enable USB device mode on my XPS 13 (9350) 🎉
Though for some ungodly reason, it uses the right-side full USB port. So a crossover cable is required.
-----
https://twitter.com/ShinyQuagsire/status/1536434057671716864 12:43 PM · Jun 13, 2022
-----
1. I cloned the repo
git clone https://github.com/Blealtan/RWKV-LM-LoRA
2. I download 7B Instruct
wget https://huggingface.co/BlinkDL/rwkv-4-pile-7b/resolve/main/RWKV-4-Pile-7B-Instruct-test2-20230209.pth
(in my home directory /home/shazam )
@milnak
milnak / ubuntu20-hyperv-enhanced-session.md
Last active November 22, 2024 17:28
Enabling enhanced session in Hyper-V for Ubuntu 20: This works for me, although it seems that Hyper-V quick create now supports enhanced session by default. #ubuntu #hyperv

Setup Hyper-V enhanced session for Ubuntu 20

I couldn't find instructions that were 100% complete, so I put this together.

These instructions worked fine for me. Follow each step carefully.

Download Ubuntu 20 desktop

DO NOT create the VM by choosing Quick Create in Hyper-V Manager. Follow these instructions exactly.