nanochat/pyproject.toml
Lawrence R Kincheloe III dd37f29fe4
Update Python version and torch dependencies
Updated Python version requirement and adjusted torch dependencies for CPU, GPU, and AMD support.
2025-11-22 20:02:59 -06:00

107 lines
2.0 KiB
TOML

[project]
name = "nanochat"
version = "0.1.0"
description = "the minimal full-stack ChatGPT clone"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"datasets>=4.0.0",
"fastapi>=0.117.1",
"files-to-prompt>=0.6",
"psutil>=7.1.0",
"regex>=2025.9.1",
"setuptools>=80.9.0",
"tiktoken>=0.11.0",
"tokenizers>=0.22.0",
"torch>=2.7.0,<2.9.0",
"uvicorn>=0.36.0",
"wandb>=0.21.3",
]
[build-system]
requires = ["maturin>=1.7,<2.0"]
build-backend = "maturin"
[tool.maturin]
module-name = "rustbpe"
bindings = "pyo3"
python-source = "."
manifest-path = "rustbpe/Cargo.toml"
[dependency-groups]
dev = [
"maturin>=1.9.4",
"pytest>=8.0.0",
]
[tool.pytest.ini_options]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
# target torch to cuda 12.8 or CPU
[tool.uv.sources]
torch = [
{ index = "pytorch-cpu", extra = "cpu" },
{ index = "pytorch-cu128", extra = "gpu" },
{ index = "pytorch-rocm", extra = "amd" },
]
rocm = [
{ index = "pytorch-rocm", extra = "amd" },
]
pytorch-triton-rocm = [
{ index = "pytorch-rocm", extra = "amd" },
]
rocm-sdk-core = [
{ index = "pytorch-rocm", extra = "amd" },
]
rocm-sdk-libraries-gfx1151 = [
{ index = "pytorch-rocm", extra = "amd" },
]
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[[tool.uv.index]]
name = "pytorch-cu128"
url = "https://download.pytorch.org/whl/cu128"
explicit = true
[[tool.uv.index]]
name = "pytorch-rocm"
url = "https://repo.amd.com/rocm/whl/gfx1151"
explicit = true
[project.optional-dependencies]
cpu = [
"torch>=2.7.0,<2.9.0",
]
gpu = [
"torch>=2.7.0,<2.9.0",
]
amd = [
"torch>=2.7.0,<2.9.0",
"rocm",
"pytorch-triton-rocm",
"rocm-sdk-core",
"rocm-sdk-libraries-gfx1151",
]
[tool.uv]
prerelease = "allow"
conflicts = [
[
{ extra = "cpu" },
{ extra = "gpu" },
{ extra = "amd" },
],
]