Skip to content

ToyLLM: Learning LLM from Scratch

快速开始

环境配置

  • 推荐使用 UV 安装依赖
  • 创建虚拟环境:uv venv -p 3.12
  • 激活虚拟环境:source .venv/bin/activate
  • 安装toyllmuv pip install toyllm

拉取项目 & 下载模型文件

运行示例

  • GPT2:python toyllm/cli/run_gpt2.py
  • python toyllm/cli/run_gpt2.py --help 查看参数信息

  • Speculative Sampling GPT2: python toyllm/cli/run_speculative_sampling.py

  • python toyllm/cli/run_speculative_sampling.py --help 查看参数信息

Acknowledgements

The project is highly inspired by the following projects: