๐Ÿ› ๏ธ Environment Setup

#6
by burtenshaw - opened
nanochat students org

Objective: break up the speedrun.sh script so that I could work through it in steps and share as much as possible:

1. Setup the environment

This most just works, but I had to open a single pr. If you run this, then the you have a usable env.

# Default intermediate artifacts directory is in ~/.cache/nanochat
export OMP_NUM_THREADS=1
export NANOCHAT_BASE_DIR=".cache/nanochat"
mkdir -p $NANOCHAT_BASE_DIR

# -----------------------------------------------------------------------------
# Python venv setup with uv

# # install uv (if not already installed)
command -v uv &> /dev/null || curl -LsSf https://astral.sh/uv/install.sh | sh
# # create a .venv local virtual environment (if it doesn't exist)
[ -d ".venv" ] || uv venv
# install the repo dependencies
uv sync
# activate venv so that `python` uses the project's venv instead of system python
source .venv/bin/activate

I also opened this PR so that we could use nanochat without relative imports. Which is handy!

Sign up or log in to comment