Skip to content

Instantly share code, notes, and snippets.

@sizzles
sizzles / long_gpt.py
Created March 27, 2023 23:35 — forked from NaxAlpha/long_gpt.py
Training script for LongGPT; Fine-tunes GPT-2 (125M) on The Pile Dataset with a context size of 4k tokens.
import time
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader, IterableDataset
import wandb
from tqdm import tqdm
@sizzles
sizzles / stablediffusionwalk.py
Created January 21, 2023 09:17 — forked from karpathy/stablediffusionwalk.py
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
@sizzles
sizzles / libModSecurity.sh
Created April 2, 2022 15:18 — forked from chetanppatil/libModSecurity.sh
Install and enable libModSecurity for your Nginx
##
# ModSecurity NGINX INSTALLATION SCRIPT
##
# Install Prerequisite Packages
echo "Install Prerequisite Packages";
sudo apt-get install -y apt-utils autoconf automake build-essential git libcurl4-openssl-dev libgeoip-dev liblmdb-dev libpcre++-dev libtool libxml2-dev libyajl-dev pkgconf wget zlib1g-dev
OPT_DIR=/opt
NGINX_DIR=/etc/nginx