Skip to content

Instantly share code, notes, and snippets.

View Glavin001's full-sized avatar
💻
Working - I may be slow to respond.

Glavin Wiechert Glavin001

💻
Working - I may be slow to respond.
View GitHub Profile
@veekaybee
veekaybee / normcore-llm.md
Last active July 19, 2024 23:20
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

@fearnworks
fearnworks / falcoln_7b_qlora_axolotl.yml
Created June 2, 2023 20:57
Working falcon 7b qlora w/ Axolotl
base_model: tiiuae/falcon-7b
base_model_config: tiiuae/falcon-7b
trust_remote_code: true
model_type: AutoModelForCausalLM
tokenizer_type: AutoTokenizer
load_in_8bit: false
load_in_4bit: true
gptq: false
strict: false
push_dataset_to_hub:
@hwchase17
hwchase17 / langchain_chat_gpt.py
Last active December 5, 2023 16:10
LangChain ChatGPT API Wrapper
from langchain.llms.base import LLM
from typing import Optional, List, Mapping, Any
import requests
from langchain.llms.utils import enforce_stop_tokens
class CustomLLM(LLM):
def __init__(self, url: str):
self.url = url
@steveruizok
steveruizok / useCursor.ts
Last active May 13, 2022 06:25
Generate a rotated cursor based on a cursor and rotation.
import { GeomUtils, TLCursor } from '@tldraw/core'
import * as React from 'react'
function getCursorCss(svg: string, r: number, f = false) {
return (
`url("data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 35 35' xmlns='http://www.w3.org/2000/svg'><g fill='none' style='transform-origin:center center' transform='rotate(${r})${
f ? ` scale(-1,-1) translate(0, -32)` : ''
}'>` +
svg.replaceAll(`"`, `'`) +
'</g></svg>") 16 16, pointer'
@dvf
dvf / change-codec.md
Last active July 17, 2024 10:16
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@yangshun
yangshun / docusaurus-copy-button.md
Last active April 4, 2023 07:07
How to add the "Copy" button to code blocks in Docusaurus

Adding "Copy" (to Clipboard) Button

If you would like to add a button to your fenced code blocks so that users may copy the code, you can do so in Docusaurus. You will have to add some code to your Docusaurus project, as seen below.

Under static/js, create a file called code-block-buttons.js with the following:

// Turn off ESLint for this file because it's sent down to users as-is.
/* eslint-disable */
window.addEventListener('load', function() {
@jamesporter
jamesporter / openjscad-cheat-sheet.md
Created July 16, 2018 22:09
Openjscad Cheat Sheet

OpenJSCAD Cheat Sheet

James Porter

0. 3D

  • Architecture-style
  • x,y,z

1. main

@robertgonzales
robertgonzales / Frame.js
Created December 12, 2017 03:03
Use React portals to render inside shadow dom and iframes
class Frame extends Component {
componentDidMount() {
this.iframeHead = this.node.contentDocument.head
this.iframeRoot = this.node.contentDocument.body
this.forceUpdate()
}
render() {
const { children, head, ...rest } = this.props
return (
@zackster
zackster / main.py
Created October 19, 2017 04:43
Serverless fasttext implementation. I have a blog post on the Code For Cash blog (blog.codefor.cash) that discusses what else is needed to run fasttext in a serverless AWS lambda environment: compiling fasttext on ec2 for linux, including nltk in the root directory of the zip, etc.
import string
import re
import nltk
def normalize(text):
# remove punctuation
text = re.sub('[%s]' % re.escape(string.punctuation), '', text)
# split into words
# nltk.data.path.append("/nltk_data")
from nltk.tokenize import word_tokenize
anonymous
anonymous / provision.sh
Created August 31, 2017 23:42
function install_faiss() {
pyenv shell rise
pip install numpy
sudo apt-get install -y \
build-essential \
libopenblas-dev \
gfortran \
swig
PREFIX_MAIN=$(pyenv virtualenv-prefix)