Feature Extraction
Transformers
ONNX
Safetensors
multilingual
bidirectional_pplx_qwen3
sentence-similarity
conteb
contextual-embeddings
custom_code
text-embeddings-inference
Instructions to use perplexity-ai/pplx-embed-context-v1-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use perplexity-ai/pplx-embed-context-v1-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="perplexity-ai/pplx-embed-context-v1-4b", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("perplexity-ai/pplx-embed-context-v1-4b", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Fix transformers 5.9+ compatibility: create_causal_mask kwargs
#6
by maximilian-schall-ppx - opened
modeling.py built the bidirectional mask with a hardcoded create_causal_mask(input_embeds=..., cache_position=...) call. That signature drifted across transformers 5.x:
input_embedswas renamed toinputs_embeds(~5.2),cache_positionbecame optional (5.6) then was dropped (5.9).
So the old code broke on transformers 5.9+ (unexpected keyword argument 'input_embeds'). Detect the accepted kwargs once at import time and build the call accordingly — the same approach already shipped in pplx-embed-v1-0.6b. 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