Skip to content

chore: typing on loading should return a T, not a StaticModel - #357

Merged
stephantul merged 3 commits into
mainfrom
fix-load-typing
Aug 31, 2026
Merged

chore: typing on loading should return a T, not a StaticModel#357
stephantul merged 3 commits into
mainfrom
fix-load-typing

Conversation

@stephantul

Copy link
Copy Markdown
Contributor

This PR fixes an issue with the typing on StaticModel.from_pretrained. Subclasses would incorrectly return a StaticModel, which doesn't make sense.

@stephantul
stephantul requested a review from Pringled August 30, 2026 15:08
@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
model2vec/model.py 97.40% <100.00%> (+0.01%) ⬆️
model2vec/train/base.py 97.97% <100.00%> (ø)
model2vec/train/similarity.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stephantul stephantul changed the title fix: loading chore: typing on loading should return a T, not a StaticModel Aug 31, 2026

@Pringled Pringled left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice LGTM

@stephantul
stephantul merged commit dfb8247 into main Aug 31, 2026
11 checks passed
@stephantul
stephantul deleted the fix-load-typing branch August 31, 2026 18:13
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