Fix transformers <5.9 compatibility: create_causal_mask kwargs

#1

modeling.py built the bidirectional mask with a hardcoded create_causal_mask(inputs_embeds=...) call and no cache_position. That matches transformers 5.9+ but breaks on earlier 5.x, where the kwarg is input_embeds and cache_position is required. Detect the accepted kwargs once at import time and build the call accordingly (same approach as pplx-embed-v1-0.6b), so it works on all of 5.0–5.12. PPLXQwen3ContextualModel / encode() are unchanged.

Validated by loading the model across transformers 5.0.0, 5.8.1, 5.9.0 and 5.12.0 — it loads, runs a forward pass, and produces identical output on all of them. Scope: transformers 5.x.

seslami-pplx changed pull request status to merged

Sign up or log in to comment