Skip to content

Feature/qol labels and save - #3

Merged
jogonba2 merged 9 commits into
mainfrom
feature/qol-labels-and-save
Oct 28, 2026
Merged

jogonba2 merged 9 commits into
mainfrom
feature/qol-labels-and-save

Conversation

@jogonba2

Copy link
Copy Markdown
Owner

This PR changes:

  • Labels as indices or names: Ground-truth labels no longer have to be indices. Both indices and label names are now accepted, and prediction outputs match whichever format was used. This applies to all pipelines.
  • Evaluation: Added evaluation for sequence classification (embedding and encoder pipelines) and span classification.
  • Save/load: Added save and load support for all pipelines. Saving writes the label embeddings to a safetensors file, plus a model.json containing everything needed to rebuild the pipeline (along with evaluation results, hyperparameters, etc.).
  • Logit scale fix: The logit scale was initialized differently in train and in the pipelines, so training started from a value inconsistent with the pipeline. This is now fixed.
  • SigLIP padding fix: Fixed a padding issue with SigLIP that was flattening probabilities in zero-shot mode.
  • Logit scale clamping: The logit scale is now clamped to 100 during training, following the CLIP paper.
  • Label embeddings off-by-one fix: Fixed a bug where the returned label_embeddings were from one update step before the end of training.
  • Post-hoc calibration: Added post-hoc calibration to all pipelines except SpanPipeline. Only Beta calibration is implemented for now. Calibrators are saved in model.json alongside the rest of the pipeline config, and ECE has been added as an evaluation metric.
  • Docs: Expanded the README with more examples and documentation for the new features in this PR.
  • Examples: Refactored the pipeline examples to include calibration and improve readability.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 98.39704% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.01%. Comparing base (30cb0f4) to head (81defbd).

Files with missing lines Patch % Lines
src/delt/pipelines/base.py 94.73% 5 Missing ⚠️
src/delt/calibrators/beta/beta.py 96.87% 2 Missing ⚠️
src/delt/calibrators/utils.py 80.00% 2 Missing ⚠️
src/delt/evaluate.py 93.75% 2 Missing ⚠️
src/delt/calibrators/__init__.py 92.30% 1 Missing ⚠️
src/delt/train.py 93.33% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #3      +/-   ##
==========================================
+ Coverage   82.48%   90.01%   +7.53%     
==========================================
  Files          79       89      +10     
  Lines        1370     2133     +763     
==========================================
+ Hits         1130     1920     +790     
+ Misses        240      213      -27     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jogonba2
jogonba2 merged commit dc08fd1 into main Oct 28, 2026
1 check passed
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.

2 participants