Skip to content

Fix DistilBERT prediction output shape and model loading configuration#495

Merged
cristian-tamblay merged 2 commits intodevelopfrom
fix/distilbert-binary
Mar 25, 2026
Merged

Fix DistilBERT prediction output shape and model loading configuration#495
cristian-tamblay merged 2 commits intodevelopfrom
fix/distilbert-binary

Conversation

@Irozuku
Copy link
Collaborator

@Irozuku Irozuku commented Mar 23, 2026

Summary

Fixes issues in the DistilBERT transformer model affecting binary classification predictions and model loading. Ensures prediction probabilities have a consistent shape and restores missing logging parameters when loading a model, preventing misconfiguration.


Type of Change

Check all that apply like this [x]:

  • Backend change
  • Frontend change
  • CI / Workflow change
  • Build / Packaging change
  • Bug fix
  • Documentation

Changes (by file)

Briefly list the important modified files and what was done.

  • distilbert_transformer.py:
    • Fixed probability collection in predict by appending batch outputs and stacking with np.vstack to ensure consistent shapes.
    • Fixed load method to properly restore logging-related parameters, preventing loss of configuration when reloading models.

Testing (optional)

  • Verify that training the model runs successfully without errors.
  • Verify that the trained model can be used to generate predictions correctly (especially for binary classification).

Update probability aggregation by stacking arrays for consistent output shape, addressing issues with downstream processing.
Add missing logging-related parameters to model loading.
@Irozuku Irozuku added bug Something isn't working back Backend work labels Mar 23, 2026
@cristian-tamblay cristian-tamblay added the conflict This PR has merge conflicts label Mar 24, 2026
@Irozuku Irozuku removed the conflict This PR has merge conflicts label Mar 25, 2026
@cristian-tamblay cristian-tamblay merged commit 5834100 into develop Mar 25, 2026
19 checks passed
@cristian-tamblay cristian-tamblay deleted the fix/distilbert-binary branch March 25, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

back Backend work bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants