Files
tiltmeter/pyproject.toml
flan 29afcd00b1 fix: pin embedding inference to one torch thread
torch's multi-threaded CPU forward pass intermittently raised SIGILL under
CPU contention on the deployment host; the collector swallowed it as
non-fatal, so that cycle silently computed no new embeddings. Pinning
inference to a single thread avoids the racy parallel kernel and removes
multi-threaded reduction nondeterminism, so recomputed vectors are
bit-reproducible.

Bump 0.8.2 -> 0.8.3: a vector recomputed after this change can differ from a
pre-0.8.3 one at ~1e-6 and move a borderline article across the cluster
threshold, which may shift a rating.
2026-07-19 18:57:49 +00:00

56 lines
1.3 KiB
TOML

[project]
name = "tiltmeter"
version = "0.8.3"
description = "Auditable, reproducible political-lean ratings for news outlets"
readme = "README.md"
requires-python = ">=3.13"
license = { text = "MIT" }
authors = [{ name = "flan", email = "flan@arch.fyi" }]
dependencies = [
"feedparser>=6.0",
"trafilatura>=1.12",
"pyyaml>=6.0",
"sentence-transformers>=3.0",
# torch is transitive via sentence-transformers, but must be a direct
# dependency for the pytorch-cpu index pin below to apply (uv resolves
# tool.uv.sources for direct dependencies only) — otherwise the lock
# pulls CUDA torch and the Docker image balloons to ~7GB
"torch>=2.6",
"scikit-learn>=1.5",
"numpy>=2.0",
"requests>=2.32",
]
[project.scripts]
tiltmeter = "tiltmeter.cli:main"
[dependency-groups]
dev = [
"pytest>=8.0",
"ruff>=0.8",
"textstat>=0.7",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
# CPU-only torch: reproducibility runs on any machine, no GPU nondeterminism
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
torch = { index = "pytorch-cpu" }
[tool.hatch.build.targets.wheel]
packages = ["src/tiltmeter"]
[tool.ruff]
line-length = 100
target-version = "py313"
[tool.pytest.ini_options]
testpaths = ["tests"]