Skip to content

Adds constraint-type defaults, partitioner warnings, and model dtype passthrough#11

Open
pkuchmiichuk wants to merge 5 commits into
FACTSlab:mainfrom
pkuchmiichuk:ukr-core
Open

Adds constraint-type defaults, partitioner warnings, and model dtype passthrough#11
pkuchmiichuk wants to merge 5 commits into
FACTSlab:mainfrom
pkuchmiichuk:ukr-core

Conversation

@pkuchmiichuk

Copy link
Copy Markdown
Collaborator

Description

Change Files
ListConstraint subclasses now default constraint_type to their own discriminator value, so constraints no longer have to restate it at construction (UniquenessConstraint(property_expression=...) instead of also passing constraint_type="uniqueness"). bead/lists/constraints.py
ListPartitioner now warns once per expression when a constraint property expression cannot be evaluated, and once per type when a constraint type is not enforced during assignment. Previously a misconfigured constraint scored zero on every iteration and was silently ignored. bead/lists/partitioner.py
Causal LMs load in the checkpoint's own dtype by default (dtype="auto"), rather than being forced to float32. Loading a half-precision checkpoint as float32 doubled its memory. bead/items/adapters/huggingface.py
The requested dtype is threaded from LanguageModelScorer through to the adapter. bead/items/scoring.py

All four are backward compatible. The new dtype parameters are keyword arguments defaulting to "auto", and the constraint defaults only add a value where one previously had to be supplied.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Tests (adding or updating tests)

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's style guidelines
  • I have run uv run ruff check . and uv run ruff format .
  • I have run uv run pyright with no errors
  • I have added tests that prove my fix/feature works
  • All tests pass (uv run pytest tests/)
  • I have updated documentation as needed

Testing

Test file Covers
tests/lists/test_constraints.py Each constraint type constructs without an explicit constraint_type, and the discriminator still round-trips.
tests/lists/test_partitioner.py The unresolved-expression warning fires once per expression.
tests/lists/test_partitioner_batch.py The unenforced-type warning fires once per constraint type.
tests/items/adapters/test_huggingface.py The adapter forwards dtype to from_pretrained and defaults to "auto".
tests/items/test_scoring.py LanguageModelScorer passes its dtype through to the adapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant