content: [project]
  name = "lm-saes"
  version = "0.1.0"
  description = "For OpenMOSS Mechanistic Interpretability Team's Sparse Autoencoder (SAE) research. Open-sourced and constantly updated."
  dependencies = [
      "datasets>=3.0.2",
      "transformers>=4.46.0",
      "einops>=0.8.0",
      "fastapi>=0.115.4",
      "matplotlib>=3.9.2",
      "numpy<2.0.0",
      "pandas>=2.2.3",
      "pymongo>=4.10.1",
      "tensorboardX>=2.6.2.2",
      # "torch>=2.5.0",
      # "torchvision>=0.20.1",
      "transformer-lens",
      "uvicorn>=0.32.0",
      "wandb>=0.18.5",
      "msgpack>=1.1.0",
      "plotly>=5.24.1",
      "openai>=1.52.2",
      "tiktoken>=0.8.0",
      "python-dotenv>=1.0.1",
      "jaxtyping>=0.2.34",
      "safetensors>=0.4.5",
      "pydantic>=2.10.6",
      "argparse>=1.4.0",
      "pyyaml>=6.0.2",
      "tomlkit>=0.13.2",
      "pydantic-settings>=2.7.1",
      "typing-extensions>=4.13.2",
      "more-itertools>=10.7.0",
      "json-repair>=0.44.1",
  ]
  requires-python = "==3.11.*"
  readme = "README.md"
  
  [[project.authors]]
  name = "Xuyang Ge"
  email = "xyge20@fudan.edu.cn"
  
  [[project.authors]]
  name = "Zhengfu He"
  email = "zfhe19@fudan.edu.cn"
  
  [[project.authors]]
  name = "Wentao Shu"
  email = "wtshu20@fudan.edu.cn"
  
  [[project.authors]]
  name = "Fukang Zhu"
  email = "fkzhu21@m.fudan.edu.cn"
  
  [[project.authors]]
  name = "Lingjie Chen"
  email = "ljchen21@m.fudan.edu.cn"
  
  [[project.authors]]
  name = "Junxuan Wang"
  email = "junxuanwang21@m.fudan.edu.cn"
  
  [project.license]
  text = "MIT"
  
  [project.scripts]
  lm-saes = "lm_saes.entrypoint:entrypoint"
  
  [dependency-groups]
  dev = [
      "transformer-lens",
      "jupyter>=1.1.1",
      "ipywidgets>=8.1.5",
      "pytest>=8.3.3",
      "ipykernel>=6.29.5",
      "nbformat>=5.10.4",
      "kaleido==0.2.1",
      "pre-commit>=4.0.1",
      "ruff>=0.7.1",
      "basedpyright>=1.21.0",
      "scikit-learn>=1.6.0",
      "plotly>=5.24.1",
      "pandas>=2.2.3",
      "pytest-mock>=3.14.0",
      "typeguard>=4.4.1",
      "pyfakefs>=5.7.3",
      "mongomock>=4.3.0",
      "qwen-vl-utils>=0.0.10",
      "tabulate>=0.9.0",
      "gradio>=5.34.0",
  ]
  flash-attn = [
      "flash-attn>=2.7.4.post1; (sys_platform == 'win32' or sys_platform == 'linux')",
  ]
  
  [project.optional-dependencies]
  # NPU variant of PyTorch (for Huawei Ascend hardware)
  default = ["torch==2.7.1", "torchvision>=0.22.1"]
  
  npu = [
      "torch==2.6.0",
      "torchvision>=0.20.1",
      "torch-npu==2.6.0rc1",
  ]
  
  triton = ["triton"]
  
  [tool.uv.sources]
  torch = [{ index = "torch-cpu", extra = "npu" }]
  torchvision = [{ index = "torch-cpu", extra = "npu" }]
  
  [[tool.uv.index]]
  name = "torch-cpu"
  url = "https://download.pytorch.org/whl/cpu"
  explicit = true
  
  [tool.ruff]
  exclude = [
      ".bzr",
      ".direnv",
      ".eggs",
      ".git",
      ".git-rewrite",
      ".hg",
      ".ipynb_checkpoints",
      ".mypy_cache",
      ".nox",
      ".pants.d",
      ".pyenv",
      ".pytest_cache",
      ".pytype",
      ".ruff_cache",
      ".svn",
      ".tox",
      ".venv",
      ".vscode",
      "__pypackages__",
      "_build",
      "buck-out",
      "build",
      "dist",
      "node_modules",
      "site-packages",
      "venv",
      "TransformerLens",
      "ui",
  ]
  line-length = 120
  indent-width = 4
  target-version = "py311"
  
  [tool.ruff.lint]
  select = ["E4", "E7", "E9", "F", "I"]
  ignore = ["E741", "F722"]
  fixable = ["ALL"]
  unfixable = []
  dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
  
  [tool.ruff.format]
  quote-style = "double"
  indent-style = "space"
  skip-magic-trailing-comma = false
  line-ending = "auto"
  docstring-code-format = false
  docstring-code-line-length = "dynamic"
  
  [tool.pyright]
  ignore = [".venv/", "examples", "TransformerLens", "tests", "exp"]
  typeCheckingMode = "standard"
  reportRedeclaration = false
  reportPrivateImportUsage = false
  
  [tool.uv]
  package = true
  no-build-isolation-package = ["flash-attn"]
  conflicts = [[{ extra = "default" }, { extra = "npu" }], [{ extra = "triton" }, { extra = "npu" }],]
  
  [[tool.uv.dependency-metadata]]
  name = "flash-attn"
  version = "2.7.4.post1"
  requires-dist = ["torch", "einops"]
  
  [tool.uv.sources.transformer-lens]
  path = "./TransformerLens"
  editable = true