Spoken-English math to Typst math with a small from-scratch Transformer: synthetic data generator, BPE tokenizer, training, constrained/beam decoding, and evaluation against a hand-written test set. The trained model is not tracked; ./run.sh produces it.
19 lines
802 B
Bash
Executable File
19 lines
802 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# One command to build everything: data -> tokenizer -> sanity check -> train -> evaluate.
|
|
# Steps that are already done are skipped, so re-running is cheap.
|
|
# ./run.sh full run (~20-60 min on an M-series Mac)
|
|
# ./run.sh --quick few-minute smoke run with a tiny model
|
|
# ./run.sh --fresh delete data/ and artifacts/ and redo everything
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
if ! command -v uv >/dev/null; then
|
|
echo "Installing uv ..."; curl -LsSf https://astral.sh/uv/install.sh | sh; export PATH="$HOME/.local/bin:$PATH"
|
|
fi
|
|
if ! command -v typst >/dev/null; then
|
|
if command -v brew >/dev/null; then brew install typst; else echo "Please install typst: https://github.com/typst/typst#installation"; exit 1; fi
|
|
fi
|
|
|
|
uv sync -q
|
|
uv run isotope-pipeline "$@"
|