You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(deps): satisfy huggingface_hub v1 strict validation and mypy on v5
- _bert.py: coerce label2id/id2label keys to str. huggingface_hub 1.x
StrictDataclassFieldValidationError rejects int-keyed label2id; the
v5 AutoModelForSequenceClassification.from_pretrained pipeline now
routes through that validator, so the previous {int: int} mapping
raised on every BertScorer.fit (and cascaded into a fallback
hf_hub_download call that the test guard caught as 'unpinned').
- ranker.py: cast cross_encoder[0] to Any for auto_model.classifier
access (nn.Sequential.__getitem__ is typed Tensor | Module on v5);
add arg-type ignores on CrossEncoder.predict(list[tuple[str,str]])
calls — the v5 stub demands the much wider Sequence type but the
list-of-pairs form is the documented call shape.
- Drop type: ignore comments mypy now reports as unused
(AutoTokenizer.from_pretrained gained a typed stub in transformers
v5; max_length matches TokenizerConfig.max_length cleanly).
- conftest.py: SentenceTransformer's constructor is typed Any on v5,
so add no-any-return ignore at the fixture boundary.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments