smol-course  by huggingface

Practical course for aligning small language models

created 8 months ago
6,050 stars

Top 8.7% on sourcepulse

GitHubView on GitHub
Project Summary

This repository offers a practical, peer-reviewed course on aligning small language models (SLMs) for specific use cases, targeting developers and researchers seeking efficient, customizable AI solutions. It emphasizes local execution with minimal GPU requirements, enabling accessible fine-tuning and deployment of SLMs.

How It Works

The course adopts a hands-on, modular approach, covering the entire lifecycle from instruction tuning and preference alignment (DPO, ORPO) to parameter-efficient fine-tuning (LoRA, prompt tuning). It also delves into evaluation, vision-language models, synthetic dataset creation, efficient inference, and agent development. This methodology allows users to gain practical skills applicable to various small models, promoting a community-driven, continuously improving learning resource.

Quick Start & Requirements

  • Installation: uv venv --python 3.11.0 followed by uv sync (recommended) or python -m venv .venv, source .venv/bin/activate, pip install -r requirements.txt.
  • Prerequisites: Basic ML/NLP understanding, Python, PyTorch, Hugging Face transformers library.
  • Environment: Python 3.11.0 is recommended. Google Colab users can install dependencies with pip install transformers trl datasets huggingface_hub.
  • Resources: Designed to run on most local machines with minimal GPU requirements.
  • Further Info: Course Outline

Highlighted Details

  • Covers advanced alignment techniques like DPO and ORPO.
  • Includes modules on parameter-efficient fine-tuning (PEFT) methods such as LoRA.
  • Features practical guidance on building AI agents.
  • Emphasizes local execution and minimal hardware dependencies.

Maintenance & Community

The course is open and peer-reviewed, encouraging contributions via pull requests to the december_2024 branch. Discussions can be found in the discussion thread.

Licensing & Compatibility

The repository's license is not explicitly stated in the provided README text.

Limitations & Caveats

The course focuses specifically on small language models; while skills are transferable, direct application to very large models may require adjustments. The content is actively being developed, with some modules scheduled for release in early 2025.

Health Check
Last commit

1 month ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
2
Star History
299 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.