spring2024-lectures  by stanford-cs336

Executable Python lectures for Stanford CS336: Language Models from Scratch

Created 1 year ago
363 stars

Top 77.3% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides executable Python lectures for Stanford's CS336: Language Models from Scratch course. It allows students to step through lecture content as code, inspect variables, and run code samples directly within an IDE like VSCode, offering a more interactive and debuggable learning experience than traditional slide decks.

How It Works

Lectures are implemented as Python scripts. Each script is designed to be executed line-by-line or in segments, mirroring the progression of a lecture. This approach enables users to interactively explore code, debug logic, and inspect intermediate states of variables, providing a deeper understanding of the underlying concepts in language models.

Quick Start & Requirements

  • Install: pip install -r requirements.txt
  • Prerequisites: Python 3.12, git clone the repository.
  • Optional Configuration: OPENAI_API_KEY, TOGETHER_API_KEY, WANDB_API_KEY environment variables.
  • GPU: While code runs on CPU, many parts depend on GPU (A100, H100 tested).
  • Usage: Run python lecture_XX.py or step through in VSCode (F5, F11, F10). View logs in view.html.

Highlighted Details

  • Executable lectures offer interactive code execution and debugging.
  • Supports stepping through code, inspecting variables, and running samples.
  • Tested on Python 3.12, CPUs, A100s, and H100s.
  • Includes an execution log viewer (view.html) for non-renderable images.

Maintenance & Community

No specific community links or maintenance details are provided in the README.

Licensing & Compatibility

The repository's license is not specified in the README.

Limitations & Caveats

The view.html component for viewing logs and images is described as "a bit clunky." While core functionality runs on CPU, many lecture components require GPU access.

Health Check
Last Commit

8 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
18 stars in the last 30 days

Explore Similar Projects

Starred by Vincent Weisser Vincent Weisser(Cofounder of Prime Intellect), Ross Taylor Ross Taylor(Cofounder of General Reasoning; Cocreator of Papers with Code), and
11 more.

open-instruct by allenai

0.7%
3k
Training codebase for instruction-following language models
Created 2 years ago
Updated 17 hours ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Vincent Weisser Vincent Weisser(Cofounder of Prime Intellect), and
15 more.

codellama by meta-llama

0.0%
16k
Inference code for CodeLlama models
Created 2 years ago
Updated 1 year ago
Feedback? Help us improve.