[project]
name = "self_critique"
version = "0.1.0"
description = ""
authors = [
    {name = "xxx xxx", email = "xxx@xxx.com"},
]
dependencies = [
    "BLEURT @ git+https://github.com/google-research/bleurt.git@cebe7e6",
    "accelerate>=0.20.3",
    "async_timeout==4.0.3",  # undeclared dependency of aiohttp, via TRL
    "bert-score>=0.3.13",
    "datasets==2.12.0",
    "evaluate==0.4.1",
    "nltk>=3.8.1",
    "numpy>=1.24.3",
    "rouge-score>=0.1.2",
    "scikit-learn>=1.2.2",
    "simple-parsing>=0.1.2.post1",
    "torch>=2.0.0",
    "tqdm>=4.65.0",
    "transformers>=4.33.2",
    "trl>=0.8.6",
    "typer>=0.9.0",
    "tf-keras>=2.16.0"
]
requires-python = ">=3.11,<3.13" # 3.11: assert_never
license = {text = "GPL-3.0-only"}

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"

[tool.pdm]

[tool.pdm.dev-dependencies]
dev = [
    "ruff>=0.4.2",
    "black>=23.3.0",
    "ipykernel>=6.23.1",
    "tensorboard>=2.12.2",
]

[tool.ruff]
extend = "../pyproject.toml"

[tool.ruff.lint]
isort = { known-first-party = ["trainer-seq2seq", "metric"] }
extend-ignore = ["UP007"]  # HF doesn't like T | None

[tool.pyright]
typeCheckingMode = "basic"
useLibraryCodeForTypes = false
reportMissingImports = false
ignore = [
    "self_critique/run_entailment.py",
    "self_critique/predict_entailment.py",
    "self_critique/ensemble.py",
    "self_critique/rl/entailment_eval.py",
]

[tool.mypy]
disallow_untyped_calls = false
warn_unused_ignores = false

[[tool.mypy.overrides]]
module = [
    "torch.*",
    "transformers",
    "datasets",
    "trl",
    "evaluate",
]
ignore_missing_imports = true
