Feature Extraction
sentence-transformers
ONNX
Safetensors
multilingual
bidirectional_pplx_qwen3
sentence-similarity
mteb
custom_code
text-embeddings-inference
Instructions to use perplexity-ai/pplx-embed-v1-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use perplexity-ai/pplx-embed-v1-4b with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("perplexity-ai/pplx-embed-v1-4b", trust_remote_code=True) sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Commit ·
9238a3b
1
Parent(s): 48b327c
docs: update snippet to not use normalization
Browse files
README.md
CHANGED
|
@@ -93,8 +93,8 @@ embeddings = model.encode(texts, quantization="binary") # Shape: (5, 2560), quan
|
|
| 93 |
> Text Embeddings Inference v1.9.0 will be released stable soon, in the meantime
|
| 94 |
> feel free to use the latest containers or rather via SHA ``.
|
| 95 |
|
| 96 |
-
> [!
|
| 97 |
-
> Currently, only int8-quantized embeddings are available via TEI.
|
| 98 |
|
| 99 |
- CPU w/ Candle:
|
| 100 |
|
|
@@ -124,14 +124,14 @@ And then you can send requests to it via cURL to `v1/embeddings` following the [
|
|
| 124 |
curl http://0.0.0.0:8080/v1/embeddings \
|
| 125 |
-H "Content-Type: application/json" \
|
| 126 |
-d '{
|
| 127 |
-
"
|
| 128 |
"Scientists explore the universe driven by curiosity.",
|
| 129 |
"Children learn through curious exploration.",
|
| 130 |
"Historical discoveries began with curious questions.",
|
| 131 |
"Animals use curiosity to adapt and survive.",
|
| 132 |
"Philosophy examines the nature of curiosity.",
|
| 133 |
],
|
| 134 |
-
"
|
| 135 |
}'
|
| 136 |
```
|
| 137 |
|
|
|
|
| 93 |
> Text Embeddings Inference v1.9.0 will be released stable soon, in the meantime
|
| 94 |
> feel free to use the latest containers or rather via SHA ``.
|
| 95 |
|
| 96 |
+
> [!IMPORTANT]
|
| 97 |
+
> Currently, only int8-quantized embeddings are available via TEI. Remember to use cosine similarity with unnormalized int8 embeddings.
|
| 98 |
|
| 99 |
- CPU w/ Candle:
|
| 100 |
|
|
|
|
| 124 |
curl http://0.0.0.0:8080/v1/embeddings \
|
| 125 |
-H "Content-Type: application/json" \
|
| 126 |
-d '{
|
| 127 |
+
"inputs": [
|
| 128 |
"Scientists explore the universe driven by curiosity.",
|
| 129 |
"Children learn through curious exploration.",
|
| 130 |
"Historical discoveries began with curious questions.",
|
| 131 |
"Animals use curiosity to adapt and survive.",
|
| 132 |
"Philosophy examines the nature of curiosity.",
|
| 133 |
],
|
| 134 |
+
"normalize" false
|
| 135 |
}'
|
| 136 |
```
|
| 137 |
|