Add `text-embeddings-inference` tag & snippet
Browse files## Description
- Add `text-embeddings-inference` tag to improve discoverability
- Adds a sample snippet on how to run Text Embeddings Inference (TEI) via Docker
⚠️ **This PR has been generated automatically, so please review it before merging.**
README.md
CHANGED
|
@@ -57,6 +57,7 @@ tags:
|
|
| 57 |
- feature-extraction
|
| 58 |
- sentence-similarity
|
| 59 |
- transformers
|
|
|
|
| 60 |
language_bcp47:
|
| 61 |
- fr-ca
|
| 62 |
- pt-br
|
|
@@ -129,6 +130,33 @@ print(sentence_embeddings)
|
|
| 129 |
```
|
| 130 |
|
| 131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
## Full Model Architecture
|
| 134 |
```
|
|
|
|
| 57 |
- feature-extraction
|
| 58 |
- sentence-similarity
|
| 59 |
- transformers
|
| 60 |
+
- text-embeddings-inference
|
| 61 |
language_bcp47:
|
| 62 |
- fr-ca
|
| 63 |
- pt-br
|
|
|
|
| 130 |
```
|
| 131 |
|
| 132 |
|
| 133 |
+
## Usage (Text Embeddings Inference (TEI))
|
| 134 |
+
|
| 135 |
+
[Text Embeddings Inference (TEI)](https://github.com/huggingface/text-embeddings-inference) is a blazing fast inference solution for text embeddings models.
|
| 136 |
+
|
| 137 |
+
- CPU:
|
| 138 |
+
```bash
|
| 139 |
+
docker run -p 8080:80 -v hf_cache:/data --pull always ghcr.io/huggingface/text-embeddings-inference:cpu-latest --model-id sentence-transformers/paraphrase-multilingual-mpnet-base-v2 --pooling mean --dtype float16
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
- NVIDIA GPU:
|
| 143 |
+
```bash
|
| 144 |
+
docker run --gpus all -p 8080:80 -v hf_cache:/data --pull always ghcr.io/huggingface/text-embeddings-inference:cuda-latest --model-id sentence-transformers/paraphrase-multilingual-mpnet-base-v2 --pooling mean --dtype float16
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
Send a request to `/v1/embeddings` to generate embeddings via the [OpenAI Embeddings API](https://platform.openai.com/docs/api-reference/embeddings/create):
|
| 148 |
+
```bash
|
| 149 |
+
curl http://localhost:8080/v1/embeddings \
|
| 150 |
+
-H "Content-Type: application/json" \
|
| 151 |
+
-d '{
|
| 152 |
+
"model": "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
|
| 153 |
+
"input": "This is an example sentence"
|
| 154 |
+
}'
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
Or check the [Text Embeddings Inference API specification](https://huggingface.github.io/text-embeddings-inference/) instead.
|
| 158 |
+
|
| 159 |
+
|
| 160 |
|
| 161 |
## Full Model Architecture
|
| 162 |
```
|