-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
177 lines (160 loc) · 4.33 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
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
[build-system]
requires = ["setuptools >= 61.0.0"]
build-backend = "setuptools.build_meta"
[project]
name = "sheeprlhf"
description = "RLHF accelerated by Lightning Fabric"
authors = [
{ name = "Refik Can Malli", email = "[email protected]" },
{ name = "Federico Belotti", email = "[email protected]" },
{ name = "Davide Angioni", email = "[email protected]" },
{ name = "Michele Milesi", email = "[email protected]" },
]
keywords = [
"reinforcement",
"machine",
"learning",
"distributed",
"production",
"RLHF",
"LLM",
]
license = { file = "LICENSE" }
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.8,<3.11"
classifiers = ["Programming Language :: Python"]
dependencies = [
"tensordict==0.2.*",
"tensorboard>=2.10",
"python-dotenv==1.0.0",
"lightning@git+https://github.com/Lightning-AI/lightning@2b6b594dabe668752183f5ab8a1d93d0904c4d32",
"hydra-core==1.3.2",
"torchmetrics==1.2.0",
"rich==13.5.*",
"torch==2.1.*",
"tqdm==4.65.0",
"datasets==2.14.5",
"transformers==4.35.0",
"einops==0.6.1",
"matplotlib==3.8.1",
"psutil==5.9.6",
]
dynamic = ["version"]
[tool.setuptools]
include-package-data = true
[tool.setuptools.packages.find]
include = ["sheeprlhf", "sheeprlhf.*"]
exclude = ["tests*", "build*", "dist*", "notebooks*", "scripts"]
[project.scripts]
sheeprlhf = "sheeprlhf.cli:run"
[project.urls]
homepage = "https://eclecticsheep.ai"
repository = "https://github.com/Eclectic-Sheep/sheeprlhf"
[project.optional-dependencies]
lit = [
"lit-gpt@git+https://github.com/Lightning-AI/lit-gpt@96666c3850741f7182f5c826e1528469d884829a",
"jsonargparse==4.27.0",
]
test = ["pytest==7.4.3", "pytest-timeout==2.2.0", "pytest-cov==4.1.0"]
dev = [
"pre-commit==3.5.0",
"mypy==1.6.1",
"isort==5.12.0",
"ruff==0.1.6",
"bumpver==2023.1124",
]
eval = [
"gradio==3.47.1",
"nltk==3.8.1",
"rouge-score==0.1.2",
"evaluate==0.4.0",
]
[tool.ruff]
# ruff already excludes many settings by default
# exclude = [
# "..."
# ]
extend-include = ["*.ipynb"]
target-version = "py310"
# Same as Black.
line-length = 120
indent-width = 4
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# pycodestyle
"W",
# Pyflakes
"F",
# pyupgrade
# "UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
# docstrings
"D",
]
ignore = [
"E731", # Do not assign a lambda expression, use a def
"E402", # Module level import not at top of file
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D105", # Missing docstring for magic method (def _*)
"D107", # Missing docstring in __init__
]
[tool.ruff.pydocstyle]
convention = "google"
# 4. Ignore `E402` (import violations) in all `__init__.py` files, and in select subdirectories.
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
"**/{tests,docs,tools,howto}/*" = ["E402"]
# Adapted from https://realpython.com/pypi-publish-python-package/#version-your-package
[tool.bumpver]
current_version = "0.1.0"
version_pattern = "MAJOR.MINOR.PATCH[-PYTAGNUM]"
commit_message = "build: Bump version {old_version} -> {new_version}"
commit = true
tag = false
push = false
[tool.bumpver.file_patterns]
"pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"']
"sheeprlhf/__init__.py" = ["{version}"]
[tool.ruff.format]
# Black like options
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# Pytest
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"
addopts = "--strict-markers --disable-pytest-warnings"
markers = ["benchmark: mark test as a benchmark"]
[tool.mypy]
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
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
no_implicit_optional = true
allow_redefinition = true
strict_equality = true
strict_concatenate = true
check_untyped_defs = true
# skipped settings
disallow_subclassing_any = false
disallow_untyped_decorators = false
disallow_any_generics = false
disallow_any_unimported = false
disallow_incomplete_defs = false
disallow_untyped_defs = false
no_implicit_reexport = false
warn_return_any = false