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-0.6b 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-0.6b 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-0.6b", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("perplexity-ai/pplx-embed-context-v1-0.6b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -41,8 +41,11 @@ curl -X POST https://api.perplexity.ai/v1/embeddings \
|
|
| 41 |
-H "Content-Type: application/json" \
|
| 42 |
-d '{
|
| 43 |
"texts": [
|
| 44 |
-
"
|
| 45 |
-
"
|
|
|
|
|
|
|
|
|
|
| 46 |
],
|
| 47 |
"model": "pplx-embed-1-4B"
|
| 48 |
}'
|
|
@@ -86,11 +89,11 @@ model = AutoModel.from_pretrained(
|
|
| 86 |
trust_remote_code=True
|
| 87 |
)
|
| 88 |
texts = [
|
| 89 |
-
"
|
| 90 |
-
"
|
| 91 |
-
"
|
| 92 |
-
"
|
| 93 |
-
"
|
| 94 |
]
|
| 95 |
|
| 96 |
embeddings = model.encode(texts) # Shape: (5, 1024)
|
|
@@ -130,11 +133,11 @@ model = SentenceTransformer(
|
|
| 130 |
)
|
| 131 |
|
| 132 |
texts = [
|
| 133 |
-
"
|
| 134 |
-
"
|
| 135 |
-
"
|
| 136 |
-
"
|
| 137 |
-
"
|
| 138 |
]
|
| 139 |
|
| 140 |
embeddings = model.encode(texts) # Shape: (5, 1024)
|
|
|
|
| 41 |
-H "Content-Type: application/json" \
|
| 42 |
-d '{
|
| 43 |
"texts": [
|
| 44 |
+
"Scientists explore the universe driven by curiosity.",
|
| 45 |
+
"Children learn through curious exploration.",
|
| 46 |
+
"Historical discoveries began with curious questions.",
|
| 47 |
+
"Animals use curiosity to adapt and survive.",
|
| 48 |
+
"Philosophy examines the nature of curiosity.",
|
| 49 |
],
|
| 50 |
"model": "pplx-embed-1-4B"
|
| 51 |
}'
|
|
|
|
| 89 |
trust_remote_code=True
|
| 90 |
)
|
| 91 |
texts = [
|
| 92 |
+
"Scientists explore the universe driven by curiosity.",
|
| 93 |
+
"Children learn through curious exploration.",
|
| 94 |
+
"Historical discoveries began with curious questions.",
|
| 95 |
+
"Animals use curiosity to adapt and survive.",
|
| 96 |
+
"Philosophy examines the nature of curiosity.",
|
| 97 |
]
|
| 98 |
|
| 99 |
embeddings = model.encode(texts) # Shape: (5, 1024)
|
|
|
|
| 133 |
)
|
| 134 |
|
| 135 |
texts = [
|
| 136 |
+
"Scientists explore the universe driven by curiosity.",
|
| 137 |
+
"Children learn through curious exploration.",
|
| 138 |
+
"Historical discoveries began with curious questions.",
|
| 139 |
+
"Animals use curiosity to adapt and survive.",
|
| 140 |
+
"Philosophy examines the nature of curiosity.",
|
| 141 |
]
|
| 142 |
|
| 143 |
embeddings = model.encode(texts) # Shape: (5, 1024)
|