Files
Fam Zheng 7939990181 patch: CN mirrors for pytorch-wheels and HF datasets
- pyproject.toml + uv.lock: pytorch-cu128/cpu indexes → mirror.sjtu.edu.cn
  (aliyun lacks 2.9.1, sjtu has it)
- nanochat/dataset.py: climbmix BASE_URL → hf-mirror.com

For ailab (CN, RTX 5090) where direct pytorch.org and huggingface.co
are unreachable. Override at uv-sync time with UV_DEFAULT_INDEX env.
2026-05-05 22:21:21 +01:00

72 lines
1.4 KiB
TOML

[project]
name = "nanochat"
version = "0.1.0"
description = "the minimal full-stack ChatGPT clone"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"datasets>=4.0.0",
"fastapi>=0.117.1",
"kernels>=0.11.7",
"psutil>=7.1.0",
"rustbpe>=0.1.0",
"tiktoken>=0.11.0",
"tokenizers>=0.22.0",
"torch==2.9.1",
"uvicorn>=0.36.0",
"wandb>=0.21.3",
]
[dependency-groups]
dev = [
"ipykernel>=7.1.0",
"matplotlib>=3.10.8",
"pytest>=8.0.0",
"python-dotenv>=1.2.1",
"transformers>=4.57.3",
]
[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" },
]
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://mirror.sjtu.edu.cn/pytorch-wheels/cpu"
explicit = true
[[tool.uv.index]]
name = "pytorch-cu128"
url = "https://mirror.sjtu.edu.cn/pytorch-wheels/cu128"
explicit = true
[project.optional-dependencies]
cpu = [
"setuptools>=65.0.0",
"torch==2.9.1",
]
gpu = [
"torch==2.9.1",
]
[tool.uv]
default-groups = []
conflicts = [
[
{ extra = "cpu" },
{ extra = "gpu" },
],
]