You will set Python up on your own computer, run a script that asks the Hugging Face Hub about a model, turn a stack of pictures into a batch a layer can read, and keep it all in Git with the key's file kept out.

About 45 minutes. You do it on your own computer. You need your own computer, with uv and Git (both free); about 1 GB of disk for PyTorch; a GitHub account only for the last step, which you may skip.

  1. A first runRun it
  2. The licenseYour turn
  3. A batch the layer can readYour turn
  4. Keep the key out, and commitYour turn
  5. On GitHub, if you likeRun it
Terminal
curl -LsSf https://astral.sh/uv/install.sh | sh
cp -R python-for-ai/labs/py-lab-own-computer/starter hub-stats
cd hub-stats
uv sync

See it on GitHub

When you have run it

After step 3, uv run python batch.py prints the shape of what comes out of the layer. Which is it?

Run on macOS on an M1 Max, uv 0.11.15, Python 3.12, PyTorch 2.15.0, requests 2.34.2, Git 2.40. Checked on .