Skip to content

Instantly share code, notes, and snippets.

View vgel's full-sized avatar

Theia Vogel vgel

View GitHub Profile
@qpwo
qpwo / fastdl.sh
Last active January 26, 2025 23:56
fust download with r2 rclone and huggingface parallel
curl https://rclone.org/install.sh | sudo bash
mkdir ~/.config/rclone
echo "
[r2]
type = s3
provider = Cloudflare
access_key_id = $a
secret_access_key = $b
region = auto
endpoint = https://$c.r2.cloudflarestorage.com
@willccbb
willccbb / grpo_demo.py
Last active April 24, 2025 03:43
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
@LevanKvirkvelia
LevanKvirkvelia / nanoBERT.py
Last active October 3, 2024 17:51
nanoBERT, inspired by @karpathy's nanoGPT
import torch.nn as nn
import torch.nn.functional as F
import math
from typing import Optional, Tuple
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
if config.hidden_size % config.num_attention_heads != 0:
@pachacamac
pachacamac / rtcalarm.rb
Last active January 22, 2016 03:39
Turns Your Laptop into an Alarm Clock While Putting It into Suspend
puts 'Make sure to run this with sudo-rights!' unless Process::UID.eid == 0
parser = begin
require 'chronic'
lambda{|s| Chronic.parse s}
rescue LoadError
STDERR.puts 'Warning: Gem "Chronic" not found. Using Time.parse instead!'
require 'time'
lambda{|s| Time.parse s}
end
@khlmnn
khlmnn / wsj2conll.sh
Created July 3, 2014 12:42
Convert the Wall Street Journal section of the Penn Treebank to CoNLL format
#!/bin/sh
#
# This Gist converts the Wall Street Journal part of the Penn Treebank
# (more specifically, sections 2–24) to CoNLL 2007 format using
# PennConverter. As suggested by the authors of PennConverter, the script
# first applies the NP bracketing patch by David Vadas.
#
# In order to make this script work, you will need the following files:
#
# * treebank-3.tar.gz, containing the standard distribution of the PTB