Skip to content

Instantly share code, notes, and snippets.

View eware-godaddy's full-sized avatar

Eugene Ware eware-godaddy

View GitHub Profile
@Artefact2
Artefact2 / README.md
Last active September 29, 2025 11:42
GGUF quantizations overview

Which GGUF is right for me? (Opinionated)

Good question! I am collecting human data on how quantization affects outputs. See here for more information: ggml-org/llama.cpp#5962

In the meantime, use the largest that fully fits in your GPU. If you can comfortably fit Q4_K_S, try using a model with more parameters.

llama.cpp feature matrix

See the wiki upstream: https://github.com/ggerganov/llama.cpp/wiki/Feature-matrix

@jexp
jexp / stackoverflow.md
Last active February 11, 2024 13:31
DuckDB StackOverflow Queries, DuckDB in Action Book: https://manning.com/books/duckdb-in-action – 40% discount: mlneedham 100% for reviewers
@markhng525
markhng525 / ai-engineer-summit-workshop-2023.ipynb
Last active June 25, 2024 00:52
ai-engineer-summit-workshop-2023.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rain-1
rain-1 / llama-home.md
Last active June 24, 2025 11:12
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@ashvardanian
ashvardanian / read_matrix.py
Created April 30, 2023 04:24
Reads a binary matrix from disk, inferring the type of scalars from filename.
def read_matrix(filename: str, start_row: int = 0, count_rows: Optional[int] = None):
"""
Read *.ibin, *.hbin, *.fbin, *.dbin files with matrixes.
Args:
:param filename (str): path to the matrix file
:param start_row (int): start reading vectors from this index
:param count_rows (int): number of vectors to read. If None, read all vectors
Returns:
Parsed matrix (numpy.ndarray)
"""
@svpino
svpino / sample.py
Created March 21, 2023 14:24
Web Scraping using Bright Data Scraping Browser and Playwright
import re
import asyncio
from playwright.async_api import async_playwright
USERNAME = "TYPE YOUR USERNAME HERE"
PASSWORD = "TYPE YOUR PASSWORD HERE"
HOST = "zproxy.lum-superproxy.io:9222"
URL = "https://www.svpino.com/" # USE YOUR URL HERE
#!/usr/bin/env bash
set -e
# pj-append.bash is a timestamped log file for you, a human. Set up a cron job to launch it every
# hour to note what you were working on, or append lines from the terminal whenever you're chewing
# on a hard problem.
#
# Use the data to build a picture of what you worked on during the last week, or grep
# last quarter's log to find out why you decided to use library A instead of library B.
#
@Narsil
Narsil / pure_torch.py
Created November 10, 2022 15:06
Loading a safetensors file with pure torch only
import mmap
import torch
import json
import os
from huggingface_hub import hf_hub_download
def load_file(filename, device):
with open(filename, mode="r", encoding="utf8") as file_obj:
with mmap.mmap(file_obj.fileno(), length=0, access=mmap.ACCESS_READ) as m:
@trygvebw
trygvebw / find_noise.py
Last active March 31, 2025 01:40
A "reverse" version of the k_euler sampler for Stable Diffusion, which finds the noise that will reconstruct the supplied image
import torch
import numpy as np
import k_diffusion as K
from PIL import Image
from torch import autocast
from einops import rearrange, repeat
def pil_img_to_torch(pil_img, half=False):
image = np.array(pil_img).astype(np.float32) / 255.0
@karpathy
karpathy / stablediffusionwalk.py
Last active September 7, 2025 08:12
hacky stablediffusion code for generating videos
"""
stable diffusion dreaming
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry
to stitch together the images, e.g.:
$ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4