2023-12-08 11:26:50 +00:00
|
|
|
[project]
|
2023-08-04 13:28:41 +00:00
|
|
|
name = "refiners"
|
2024-02-26 13:54:53 +00:00
|
|
|
version = "0.4.0"
|
2024-02-01 17:31:50 +00:00
|
|
|
description = "The simplest way to train and run adapters on top of foundation models"
|
2023-12-08 11:26:50 +00:00
|
|
|
authors = [{ name = "The Finegrain Team", email = "bonjour@lagon.tech" }]
|
2023-08-04 13:28:41 +00:00
|
|
|
license = "MIT"
|
2023-12-08 11:26:50 +00:00
|
|
|
dependencies = [
|
|
|
|
"torch>=2.1.1",
|
|
|
|
"safetensors>=0.4.0",
|
|
|
|
"pillow>=10.1.0",
|
|
|
|
"jaxtyping>=0.2.23",
|
2023-12-08 17:55:59 +00:00
|
|
|
"packaging>=23.2",
|
2024-04-02 15:59:03 +00:00
|
|
|
"numpy>=1.26.4",
|
2023-12-08 11:26:50 +00:00
|
|
|
]
|
2023-08-04 13:28:41 +00:00
|
|
|
readme = "README.md"
|
2023-12-08 11:26:50 +00:00
|
|
|
requires-python = ">= 3.10"
|
2024-02-06 09:57:26 +00:00
|
|
|
classifiers = [
|
2024-02-09 09:28:14 +00:00
|
|
|
"Typing :: Typed",
|
|
|
|
"Intended Audience :: Developers",
|
|
|
|
"Intended Audience :: Science/Research",
|
|
|
|
"Programming Language :: Python :: 3.10",
|
|
|
|
"Programming Language :: Python :: 3.11",
|
|
|
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
|
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
|
|
"License :: OSI Approved :: MIT License",
|
2024-02-06 09:57:26 +00:00
|
|
|
]
|
2023-08-04 13:28:41 +00:00
|
|
|
|
2023-12-08 11:26:50 +00:00
|
|
|
[project.optional-dependencies]
|
|
|
|
training = [
|
|
|
|
"bitsandbytes>=0.41.2.post2",
|
|
|
|
"pydantic>=2.5.2",
|
|
|
|
"prodigyopt>=1.0",
|
|
|
|
"torchvision>=0.16.1",
|
|
|
|
"loguru>=0.7.2",
|
|
|
|
"wandb>=0.16.0",
|
|
|
|
"datasets>=2.15.0",
|
2023-12-15 17:02:32 +00:00
|
|
|
"tomli>=2.0.1",
|
2023-12-08 11:26:50 +00:00
|
|
|
]
|
|
|
|
test = [
|
2024-02-04 06:55:31 +00:00
|
|
|
"diffusers>=0.26.1",
|
2023-12-08 11:26:50 +00:00
|
|
|
"transformers>=4.35.2",
|
|
|
|
"piq>=0.8.0",
|
|
|
|
"invisible-watermark>=0.2.0",
|
|
|
|
"torchvision>=0.16.1",
|
|
|
|
# An unofficial Python package for Meta AI's Segment Anything Model:
|
|
|
|
# https://github.com/opengeos/segment-anything
|
|
|
|
"segment-anything-py>=1.0",
|
2024-03-21 13:59:36 +00:00
|
|
|
# Official Python package for HQ-SAM
|
|
|
|
"segment-anything-hq>=0.3",
|
|
|
|
# HQ-SAM missing dependency:
|
|
|
|
# https://github.com/SysCV/sam-hq/pull/59
|
|
|
|
"timm>=0.5.0",
|
2023-12-08 11:26:50 +00:00
|
|
|
]
|
|
|
|
conversion = [
|
2024-02-04 06:55:31 +00:00
|
|
|
"diffusers>=0.26.1",
|
2023-12-08 11:26:50 +00:00
|
|
|
"transformers>=4.35.2",
|
|
|
|
"segment-anything-py>=1.0",
|
2023-12-14 03:53:06 +00:00
|
|
|
"requests>=2.26.0",
|
|
|
|
"tqdm>=4.62.3",
|
2023-12-08 11:26:50 +00:00
|
|
|
]
|
2024-02-02 09:10:00 +00:00
|
|
|
doc = [
|
2024-02-02 09:50:15 +00:00
|
|
|
# required by mkdocs to format the signatures
|
|
|
|
"black>=24.1.1",
|
2024-02-02 09:10:00 +00:00
|
|
|
"mkdocs-material>=9.5.6",
|
|
|
|
"mkdocstrings[python]>=0.24.0",
|
|
|
|
"mkdocs-literate-nav>=0.6.1",
|
|
|
|
]
|
2023-08-04 13:28:41 +00:00
|
|
|
|
2023-12-08 11:26:50 +00:00
|
|
|
[build-system]
|
|
|
|
requires = ["hatchling"]
|
|
|
|
build-backend = "hatchling.build"
|
2023-08-04 13:28:41 +00:00
|
|
|
|
|
|
|
|
2023-12-08 11:26:50 +00:00
|
|
|
[tool.rye]
|
|
|
|
managed = true
|
|
|
|
dev-dependencies = [
|
2024-04-02 15:30:57 +00:00
|
|
|
"pyright==1.1.356",
|
2023-12-08 11:26:50 +00:00
|
|
|
"docformatter>=1.7.5",
|
2024-01-31 11:15:46 +00:00
|
|
|
"pytest>=8.0.0",
|
2024-01-27 15:10:31 +00:00
|
|
|
"coverage>=7.4.1",
|
2024-02-09 09:28:14 +00:00
|
|
|
"typos>=1.18.2",
|
2023-12-08 11:26:50 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
[tool.hatch.metadata]
|
|
|
|
allow-direct-references = true
|
|
|
|
|
|
|
|
[tool.rye.scripts]
|
2024-01-08 15:54:03 +00:00
|
|
|
serve-docs = "mkdocs serve"
|
2024-01-27 18:32:40 +00:00
|
|
|
test-cov = "coverage run -m pytest"
|
|
|
|
# Work around for "Couldn't parse" errors due to e.g. opencv-python:
|
|
|
|
# https://github.com/nedbat/coveragepy/issues/1653
|
|
|
|
build-html-cov = { cmd = "coverage html", env = { PYTHONWARNINGS = "ignore:Couldn't parse::coverage.report_core" } }
|
2024-01-31 18:11:34 +00:00
|
|
|
serve-cov-report = { chain = [
|
|
|
|
"build-html-cov",
|
|
|
|
"python -m http.server 8080 -b 127.0.0.1 -d htmlcov",
|
|
|
|
] }
|
2023-08-04 13:28:41 +00:00
|
|
|
|
|
|
|
[tool.black]
|
|
|
|
line-length = 120
|
|
|
|
|
|
|
|
[tool.ruff]
|
2023-12-11 10:40:27 +00:00
|
|
|
src = ["src"] # see https://docs.astral.sh/ruff/settings/#src
|
2024-02-02 13:17:28 +00:00
|
|
|
line-length = 120
|
|
|
|
|
|
|
|
[tool.ruff.lint]
|
2023-12-11 10:40:27 +00:00
|
|
|
select = [
|
2024-01-27 18:33:55 +00:00
|
|
|
"I", # isort
|
2023-12-11 10:40:27 +00:00
|
|
|
]
|
2023-08-04 13:28:41 +00:00
|
|
|
ignore = [
|
2023-12-08 11:26:50 +00:00
|
|
|
"F722", # forward-annotation-syntax-error, because of Jaxtyping
|
|
|
|
"E731", # do-not-assign-lambda
|
2023-08-04 13:28:41 +00:00
|
|
|
]
|
|
|
|
|
2023-12-11 10:40:27 +00:00
|
|
|
[tool.ruff.lint.isort]
|
2023-12-11 12:50:27 +00:00
|
|
|
# Allow this kind of import on a single line:
|
|
|
|
#
|
|
|
|
# from torch import device as Device, dtype as DType
|
|
|
|
#
|
2023-12-11 10:40:27 +00:00
|
|
|
combine-as-imports = true
|
|
|
|
|
2023-12-08 11:26:50 +00:00
|
|
|
[tool.docformatter]
|
|
|
|
black = true
|
|
|
|
|
2023-08-04 13:28:41 +00:00
|
|
|
[tool.pyright]
|
2023-08-15 16:06:50 +00:00
|
|
|
include = ["src/refiners", "tests", "scripts"]
|
2023-08-16 09:17:55 +00:00
|
|
|
strict = ["*"]
|
2024-01-20 17:37:49 +00:00
|
|
|
exclude = ["**/__pycache__", "tests/weights"]
|
2023-08-04 13:28:41 +00:00
|
|
|
reportMissingTypeStubs = "warning"
|
2024-01-27 18:32:40 +00:00
|
|
|
|
|
|
|
[tool.coverage.run]
|
|
|
|
branch = true
|
2024-01-29 17:35:02 +00:00
|
|
|
source = ["src/refiners"]
|
2024-01-27 18:32:40 +00:00
|
|
|
|
|
|
|
# Also apply to HTML output, where appropriate
|
|
|
|
[tool.coverage.report]
|
|
|
|
ignore_errors = true # see `build-html-cov` for details
|
2024-01-29 17:35:02 +00:00
|
|
|
exclude_also = [
|
|
|
|
"def __repr__",
|
|
|
|
"raise NotImplementedError",
|
|
|
|
"if TYPE_CHECKING:",
|
|
|
|
"class .*\\bProtocol\\):",
|
|
|
|
"@(abc\\.)?abstractmethod",
|
|
|
|
]
|
2024-02-07 16:25:29 +00:00
|
|
|
|
|
|
|
[tool.typos.default]
|
2024-03-29 17:42:08 +00:00
|
|
|
extend-ignore-identifiers-re = ["NDArray*", "interm", "af000ded"]
|
2024-03-21 13:59:36 +00:00
|
|
|
|
2024-04-02 13:16:28 +00:00
|
|
|
[tool.typos.default.extend-words]
|
|
|
|
adaptee = "adaptee" # Common name for an adapter's target
|
|
|
|
|
2024-03-21 13:59:36 +00:00
|
|
|
[tool.pytest.ini_options]
|
|
|
|
filterwarnings = [
|
|
|
|
"ignore::UserWarning:segment_anything_hq.modeling.tiny_vit_sam.*",
|
|
|
|
"ignore::DeprecationWarning:timm.models.layers.*",
|
|
|
|
"ignore::DeprecationWarning:timm.models.registry.*"
|
|
|
|
]
|