Skip to content

Instantly share code, notes, and snippets.

@ddh0
ddh0 / train.py
Created February 6, 2025 19:46
Janky pretraining script for small llama models using HF fineweb - modify according to your needs
import os
import torch
import psutil
import datasets
import glob
from transformers import (
AutoTokenizer, LlamaConfig, LlamaForCausalLM, Trainer, TrainingArguments,
DataCollatorForLanguageModeling
)
@mholt
mholt / macapp.go
Last active April 15, 2025 20:34
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use: