Repository navigation
Make HF backend compatible with transformers 5.9 - #86
Merged
Merged
Conversation
`transformers.masking_utils.create_causal_mask` changed signature in 5.9.0: the `input_embeds` kwarg was renamed to `inputs_embeds`, and `cache_position` was deprecated and removed (it had been unused). Apply Option B (version-dispatch at the call site) to keep working on 5.5–5.8 while supporting 5.9. The probe is module-level next to the existing transformers imports; the kwargs dict is inline at the single call site in modeling_granite_switch.py. Verified 5.9 still only reads batch/seq-length/dtype/device from `inputs_embeds`, so the existing (B, S, 1) `mask_shape_proxy` stub stays valid — no other adjustments needed. Bump pyproject constraint from `<5.9.0` to `<5.10.0` to allow installs on 5.9.x. Refs #63
barvhaim
marked this pull request as ready for review
June 1, 2026 13:49
barvhaim
requested review from
antonpibm,
freunda and
yairallouche
as code owners
June 1, 2026 13:49
yairallouche
approved these changes
Jun 2, 2026
yairallouche
pushed a commit
that referenced
this pull request
Sep 8, 2026
…admin or maintainer (#86)
vedem1192
pushed a commit
to vedem1192/granite-switch
that referenced
this pull request
Nov 20, 2026
…g#86) `transformers.masking_utils.create_causal_mask` changed signature in 5.9.0: the `input_embeds` kwarg was renamed to `inputs_embeds`, and `cache_position` was deprecated and removed (it had been unused). Apply Option B (version-dispatch at the call site) to keep working on 5.5–5.8 while supporting 5.9. The probe is module-level next to the existing transformers imports; the kwargs dict is inline at the single call site in modeling_granite_switch.py. Verified 5.9 still only reads batch/seq-length/dtype/device from `inputs_embeds`, so the existing (B, S, 1) `mask_shape_proxy` stub stays valid — no other adjustments needed. Bump pyproject constraint from `<5.9.0` to `<5.10.0` to allow installs on 5.9.x. Refs generative-computing#63
vedem1192
pushed a commit
to vedem1192/granite-switch
that referenced
this pull request
Nov 20, 2026
…admin or maintainer (generative-computing#86)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
transformers.masking_utils.create_causal_maskchanged signature in 5.9.0: theinput_embedskwarg was renamed toinputs_embeds, andcache_positionwas deprecated and removed (it had been unused).Apply version-dispatch at the call site to keep working on 5.5–5.8 while supporting 5.9. The probe is module-level next to the existing transformers imports; the kwargs dict is inline at the single call site in modeling_granite_switch.py.
Verified 5.9 still only reads batch/seq-length/dtype/device from
inputs_embeds, so the existing (B, S, 1)mask_shape_proxystub stays valid — no other adjustments needed.Bump pyproject constraint from
<5.9.0to<5.10.0to allow installs on 5.9.x.Refs #63