Skip to content

Instantly share code, notes, and snippets.

@Artefact2
Artefact2 / README.md
Last active June 25, 2024 19:00
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: ggerganov/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

@NaxAlpha
NaxAlpha / long_gpt.py
Last active October 15, 2023 11:21
Training script for LongGPT; Fine-tunes GPT-2 (335M) on The Pile Dataset with a context size of 8k tokens. (requires > 16GB RAM)
import time
from contextlib import suppress
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cuda as cuda
from torch.utils.data import DataLoader, IterableDataset
@atyachin
atyachin / Android_Emulator_AWS_EC2_ARM64_2022.txt
Last active June 21, 2024 22:09
Running headless android emulator on AWS EC2 Ubuntu instance (ARM64 / aarch64) - 2022
Android Emulator (ARM64) on EC2 - 2022
---------------------------------------
1. Launch EC2 ARM based Instance (a1.metal / a1.2xlarge): (16 Gb RAM, 32Gb Disk), Ubuntu Server 22.04 LTS (HVM) ARM x64
2. sudo apt update && sudo apt upgrade
3. sudo apt install default-jdk python3-pip repo python-is-python3 unzip libpcre2-dev adb
4. wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
5. unzip commandlinetools-linux-8512546_latest.zip -d android-sdk
6. sudo mv android-sdk /opt/
7. mkdir /opt/android-sdk/cmdline-tools/latest
8. mv /opt/android-sdk/cmdline-tools/* /opt/android-sdk/cmdline-tools/latest (ignore the error)
@ritchiecarroll
ritchiecarroll / README.md
Last active February 22, 2024 02:14
Manual Windows Partitions Recovery and Restore from Windows Image Backup

Manual Windows Partitions Recovery and Restore from Windows Image Backup

Steps below iterate how to manually recreate the disk partitions required by Windows and restore a Windows installation from a system image backup created with the "Backup and Restore (Windows 7)" feature, especially when the official steps fail.

These steps were tested with Windows 11, but should work with prior versions of Windows as well:

@in03
in03 / encode_resolve_proxies.py
Last active October 5, 2023 17:08
Encode proxies for DaVinci Resolve using FFMpeg
# Windows: Create a shortcut to a .bat file in 'shell:sendto' to call this script with files passed as arguments
# Use with 'save_proxy_clip_list.py' gist to quickly pull used timeline clips into FFMPEG.
# Use 'link_proxies.py' gist to relink proxies correctly.
# Bug in current Resolve release links clips wrongly to one or two proxies only.
# This assumes FFMPEG is on path.
import os, sys, shutil
import subprocess
import argparse
import pathlib
@sebsto
sebsto / gist:6af5bf3acaf25c00dd938c3bbe722cc1
Last active May 17, 2024 12:40
Start VNCServer on Mac1 EC2 Instance
# YouTube (english) : https://www.youtube.com/watch?v=FtU2_bBfSgM
# YouTube (french) : https://www.youtube.com/watch?v=VjnaVBnERDU
#
# On your laptop, connect to the Mac instance with SSH (similar to Linux instances)
#
ssh -i <your private key.pem> ec2-user@<your public ip address>
#
# On the Mac
@gullyn
gullyn / flappy.html
Last active May 4, 2024 15:35
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@carylee
carylee / stith_virtual_choir.sh
Created November 8, 2020 18:50
Virtual Choir ffmpeg script: 1000 Reasons
#!/bin/bash
ffmpeg -y \
-ss 16.02 -i "10kReasons-DanaB.mp4" \
-ss 24.3 -i "John La Fond - 20201025_150703[1].mp4" \
-ss 28.40 -i "Isaac - 2020-10-26 18.36.32 - FullSizeRender.mp4" \
-ss 6.65 -i "tess.mp4" \
-ss 26.7 -i "Jackie - JNC 10000.mp4" \
-ss 24.28 -i "Claire Gebben - 20201027_165558.mp4" \
-ss 23.85 -i "mike.mp4" \
-ss 27.03 -i "Joe Frost - IMG_0742.mp4" \
@carylee
carylee / crop.py
Created November 8, 2020 18:47
Face-aware video cropping
#!/usr/bin/env python3
import click
import ffmpeg
from matplotlib import pyplot as plt
import matplotlib
import face_recognition
from PIL import Image
import numpy as np
def face_location(filename):