-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
148 lines (134 loc) · 3.79 KB
/
pyproject.toml
File metadata and controls
148 lines (134 loc) · 3.79 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "t2i-interp-toolkit"
version = "0.1.0"
description = "Text-to-Image Interpretation Toolkit with SAE-based analysis and steering"
readme = "README.md"
requires-python = ">=3.10"
license = {text = "MIT"}
authors = [
{name = "Luka", email = "luka@example.com"}
]
keywords = ["diffusion", "interpretability", "SAE", "steering", "text-to-image", "sparse-autoencoders"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"diffusers>=0.34.0",
"transformers>=4.55.0",
"torch>=2.0.0",
"accelerate>=1.10.0",
"pillow>=10.0.0",
"numpy>=1.24.0",
"tqdm>=4.65.0",
"loguru>=0.7.0",
"pydantic>=2.0.0",
"wandb>=0.15.0",
"datasets>=2.14.0",
"zstandard>=0.21.0",
"pyyaml>=6.0",
"hydra-core>=1.3.0",
"omegaconf>=2.3.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"ruff>=0.8.0",
"mypy>=1.5.0",
"pre-commit>=3.5.0",
]
ray = [
"ray>=2.7.0",
]
notebook = [
"jupyter>=1.0.0",
"ipywidgets>=8.0.0",
"matplotlib>=3.7.0",
]
[project.scripts]
t2i = "t2i_interp.cli:main"
t2i-steer = "t2i_interp.scripts.run_steer:main"
t2i-stitch = "t2i_interp.scripts.run_stitch:main"
t2i-sae = "t2i_interp.scripts.run_sae:main"
t2i-localise = "t2i_interp.scripts.run_localisation:main"
[project.urls]
Homepage = "https://github.com/Social-AI-Studio/T2I_Interp_toolkit"
Repository = "https://github.com/Social-AI-Studio/T2I_Interp_toolkit"
Issues = "https://github.com/Social-AI-Studio/T2I_Interp_toolkit/issues"
[tool.hatch.build.targets.wheel]
packages = ["t2i_interp", "dictionary_learning"]
[tool.hatch.build.targets.wheel.force-include]
# Ensure __init__.py stubs are included in config subpackages
"t2i_interp/config/__init__.py" = "t2i_interp/config/__init__.py"
"t2i_interp/scripts/__init__.py" = "t2i_interp/scripts/__init__.py"
[tool.ruff]
line-length = 100
target-version = "py310"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"N", # pep8-naming
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # do not perform function calls in argument defaults
"C901", # too complex
"E741", # ambiguous variable name
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"]
"tests/**/*.py" = ["B011", "N802"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = false
disallow_untyped_decorators = false
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "dictionary_learning.*"
ignore_errors = true
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--strict-markers",
"--tb=short",
"--cov=t2i_interp",
"--cov-report=term-missing",
"--cov-report=html",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
]