mirror of
https://github.com/wassname/moral-maps.git
synced 2026-09-01 12:20:59 +08:00
Second external review (gpt-5.5, correctness-focused) on the post-cleanup tree. Found no off-by-one/double-flip in the ordinal canonicalization+keying. Fixed the parts I agreed with and could verify on the path the experiment uses: - read.py: NaN-safe answer-token renorm. p_a/pmass poisons the profile with NaN when pmass underflows to 0 at coherence collapse -- exactly when pmass should just flag it. softmax(logp_allowed) is identical when pmass>0 and stable at collapse. - maps.ipsative_pca: move SVD sign-stabilization INTO the helper so it and plot_ipsative_pca share one orientation (saved coords could otherwise mirror the figure). - instrument: assert ordinal answer_space is ['1'..scale_max] IN ORDER (reduce_ordinal weights by position; a reordered space silently inverts E) -- was length-only. - instrument.per_item_categorical: assert per-item dimension/sign agree across frames and frames are distinct, instead of silently averaging under rows[0]'s metadata. - pyproject: move matplotlib+textalloc to an optional `maps` extra; evals stay headless. - tests: drop imports of the deleted reduce_nominal/expected_value, inline the expectation, remove the now-impossible nominal-reducer test. Deferred (flagged to maintainer): two NaN/window issues in guided.py's forced-choice rollout (nominal evaluate() path) -- not exercised by this experiment, can't smoke-test, and the NaN-as-collapse-signal there is a deliberate design. Verified: experiment smoke green on all 4 instruments (no assert false-fires), 6 pure unit tests pass, headless import clean, 16pf map renders. Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
45 lines
1.0 KiB
TOML
45 lines
1.0 KiB
TOML
[project]
|
|
name = "tiny-mfv"
|
|
version = "0.1.0"
|
|
description = "Tiny moral-foundations vignettes eval (Clifford 2015 classic + paraphrase configs) for steering checkpoints."
|
|
requires-python = ">=3.11"
|
|
dependencies = [
|
|
"transformers>=5.7",
|
|
"torch",
|
|
"accelerate",
|
|
"pandas",
|
|
"loguru",
|
|
"python-dotenv",
|
|
"tyro",
|
|
"openai>=1.40",
|
|
"httpx",
|
|
"tqdm",
|
|
"tabulate",
|
|
"datasets",
|
|
"numpy",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
# tinymfv.maps (culture-map + range viz) only; `import tinymfv` and the evals stay headless,
|
|
# numeric-only consumers (steering-lite) skip this. Install with `pip install tiny-mfv[maps]`.
|
|
maps = [
|
|
"matplotlib>=3.8",
|
|
"textalloc>=1.2.3", # non-overlapping label placement on the maps
|
|
]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"openrouter-wrapper",
|
|
"scipy>=1.17.1",
|
|
]
|
|
|
|
[tool.uv.sources]
|
|
openrouter-wrapper = { git = "https://github.com/wassname/openrouter_wrapper" }
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src/tinymfv"]
|