Update Python version and torch dependencies

Updated Python version requirement and adjusted torch dependencies for CPU, GPU, and AMD support.
This commit is contained in:
Lawrence R Kincheloe III 2025-11-22 20:02:59 -06:00 committed by GitHub
parent 1af926205d
commit dd37f29fe4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,7 @@ name = "nanochat"
version = "0.1.0" version = "0.1.0"
description = "the minimal full-stack ChatGPT clone" description = "the minimal full-stack ChatGPT clone"
readme = "README.md" readme = "README.md"
requires-python = ">=3.10" requires-python = ">=3.12"
dependencies = [ dependencies = [
"datasets>=4.0.0", "datasets>=4.0.0",
"fastapi>=0.117.1", "fastapi>=0.117.1",
@ -13,7 +13,7 @@ dependencies = [
"setuptools>=80.9.0", "setuptools>=80.9.0",
"tiktoken>=0.11.0", "tiktoken>=0.11.0",
"tokenizers>=0.22.0", "tokenizers>=0.22.0",
"torch>=2.8.0", "torch>=2.7.0,<2.9.0",
"uvicorn>=0.36.0", "uvicorn>=0.36.0",
"wandb>=0.21.3", "wandb>=0.21.3",
] ]
@ -45,43 +45,62 @@ python_functions = ["test_*"]
# target torch to cuda 12.8 or CPU # target torch to cuda 12.8 or CPU
[tool.uv.sources] [tool.uv.sources]
torch = [ torch = [
{ index = "pytorch-cpu", extra = "cpu" }, { index = "pytorch-cpu", extra = "cpu" },
{ index = "pytorch-cu128", extra = "gpu" }, { index = "pytorch-cu128", extra = "gpu" },
{ index = "pytorch-rocm", extra = "amd" }, { index = "pytorch-rocm", extra = "amd" },
] ]
[[tool.uv.index]] rocm = [
name = "pytorch-cpu" { index = "pytorch-rocm", extra = "amd" },
url = "https://download.pytorch.org/whl/cpu" ]
explicit = true pytorch-triton-rocm = [
{ index = "pytorch-rocm", extra = "amd" },
[[tool.uv.index]] ]
name = "pytorch-cu128" rocm-sdk-core = [
url = "https://download.pytorch.org/whl/cu128" { 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 explicit = true
[[tool.uv.index]] [[tool.uv.index]]
name = "pytorch-rocm" name = "pytorch-rocm"
url = "https://repo.amd.com/rocm/whl/" url = "https://repo.amd.com/rocm/whl/gfx1151"
explicit = true explicit = true
[project.optional-dependencies] [project.optional-dependencies]
cpu = [ cpu = [
"torch>=2.8.0", "torch>=2.7.0,<2.9.0",
]
gpu = [
"torch>=2.8.0",
]
amd = [
"torch>=2.8.0",
] ]
gpu = [
[tool.uv] "torch>=2.7.0,<2.9.0",
conflicts = [ ]
[ amd = [
{ extra = "cpu" }, "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 = "gpu" },
{ extra = "amd" }, { extra = "amd" },
], ],
] ]