forked from EleutherAI/sae
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
113 lines (102 loc) · 2.92 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "sae"
description = "Sparse autoencoders"
readme = "README.md"
requires-python = ">=3.10"
keywords = ["interpretability", "explainable-ai"]
license = {text = "MIT License"}
dependencies = [
"accelerate", # For device_map in from_pretrained
"datasets",
"einops",
"huggingface-hub",
"natsort", # For sorting module names
"safetensors",
"simple-parsing",
"torch",
"transformers",
]
version = "0.1.0"
[project.scripts]
sae = "sae.__main__:run"
[tool.pyright]
include = ["sae*"]
reportPrivateImportUsage = false
[tool.setuptools.packages.find]
include = ["sae*"]
[tool.ruff]
line-length = 99
# Enable Pyflakes `E` and `F` codes by default.
select = [
"E",
"W", # see: https://pypi.org/project/pycodestyle
"F", # see: https://pypi.org/project/pyflakes
"I"
]
ignore = [
"E731", # Do not assign a lambda expression, use a def
"E402", # Module level import not at top of file
]
# Exclude a variety of commonly ignored directories.
exclude = [".git", "docs", "_notebooks", "examples"]
ignore-init-module-imports = true
# Black formatting
[tool.black]
line_length = 99
include = '\.pyi?$'
exclude = '''
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
# iSort
[tool.isort]
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 99
multi_line_output = 3
include_trailing_comma = true
skip_gitignore = true
[tool.mypy]
# -> Level 1# custom settings
show_error_codes = true
ignore_missing_imports = true
plugins = "numpy.typing.mypy_plugin"
# suggested settings# # https://mypy.readthedocs.io/en/stable/existing_code.html?highlight=no_implicit_optional#introduce-stricter-options
# Start off with these
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
no_implicit_optional = true
# this is for reusing same variable with different types
allow_redefinition = true
# -> Level 2# Getting these passing should be easy
strict_equality = true
strict_concatenate = true
# Strongly recommend enabling this one as soon as you can
check_untyped_defs = true
# -> Level 3# These shouldn't be too much additional work, but may be tricky to get passing if you use a lot of untyped libraries
disallow_subclassing_any = false
disallow_untyped_decorators = false
disallow_any_generics = false
disallow_any_unimported = false
# These next few are various gradations of forcing use of type annotationsdisallow_untyped_calls = false
disallow_incomplete_defs = false
disallow_untyped_defs = false
# -> Level 4# This one isn't too hard to get passing, but return on investment is lower
no_implicit_reexport = false
# This one can be tricky to get passing if you use a lot of untyped libraries
warn_return_any = false