alvarobartt HF Staff commited on
Commit
c2c3466
·
verified ·
1 Parent(s): 5e9cbf6

Add Text Embeddings Inference (TEI) tag & snippet

Browse files
Files changed (1) hide show
  1. README.md +41 -0
README.md CHANGED
@@ -10,6 +10,7 @@ library_name: transformers
10
  tags:
11
  - sentence-transformers
12
  - transformers.js
 
13
  ---
14
 
15
  # gte-reranker-modernbert-base
@@ -129,6 +130,46 @@ const { logits } = await model(inputs);
129
  console.log(logits.tolist()); // [[2.138258218765259], [2.4609625339508057], [-1.6775450706481934]]
130
  ```
131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  ## Training Details
133
 
134
  The `gte-modernbert` series of models follows the training scheme of the previous [GTE models](https://huggingface.co/collections/Alibaba-NLP/gte-models-6680f0b13f885cb431e6d469), with the only difference being that the pre-training language model base has been replaced from [GTE-MLM](https://huggingface.co/Alibaba-NLP/gte-en-mlm-base) to [ModernBert](https://huggingface.co/answerdotai/ModernBERT-base). For more training details, please refer to our paper: [mGTE: Generalized Long-Context Text Representation and Reranking Models for Multilingual Text Retrieval](https://aclanthology.org/2024.emnlp-industry.103/)
 
10
  tags:
11
  - sentence-transformers
12
  - transformers.js
13
+ - text-embeddings-inference
14
  ---
15
 
16
  # gte-reranker-modernbert-base
 
130
  console.log(logits.tolist()); // [[2.138258218765259], [2.4609625339508057], [-1.6775450706481934]]
131
  ```
132
 
133
+ Additionally, you can also deploy `Alibaba-NLP/gte-reranker-modernbert-base` with [Text Embeddings Inference (TEI)](https://github.com/huggingface/text-embeddings-inference) as follows:
134
+
135
+ - CPU
136
+
137
+ ```bash
138
+ docker run --platform linux/amd64 \
139
+ -p 8080:80 \
140
+ -v $PWD/data:/data \
141
+ --pull always \
142
+ ghcr.io/huggingface/text-embeddings-inference:cpu-1.7 \
143
+ --model-id Alibaba-NLP/gte-reranker-modernbert-base
144
+ ```
145
+
146
+ - GPU
147
+
148
+ ```bash
149
+ docker run --platform linux/amd64 \
150
+ --gpus all \
151
+ -p 8080:80 \
152
+ -v $PWD/data:/data \
153
+ --pull always \
154
+ ghcr.io/huggingface/text-embeddings-inference:1.7 \
155
+ --model-id Alibaba-NLP/gte-reranker-modernbert-base
156
+ ```
157
+
158
+ Then you can send requests to the deployed API via the `/rerank` route (see the [Text Embeddings Inference OpenAPI Specification](https://huggingface.github.io/text-embeddings-inference/) for more details):
159
+
160
+ ```bash
161
+ curl https://0.0.0.0:8080/rerank \
162
+ -H "Content-Type: application/json" \
163
+ -d '{
164
+ "query": "What is the capital of China?",
165
+ "raw_scores": false,
166
+ "return_text": false,
167
+ "texts": [ "Beijing" ],
168
+ "truncate": true,
169
+ "truncation_direction": "right"
170
+ }'
171
+ ```
172
+
173
  ## Training Details
174
 
175
  The `gte-modernbert` series of models follows the training scheme of the previous [GTE models](https://huggingface.co/collections/Alibaba-NLP/gte-models-6680f0b13f885cb431e6d469), with the only difference being that the pre-training language model base has been replaced from [GTE-MLM](https://huggingface.co/Alibaba-NLP/gte-en-mlm-base) to [ModernBert](https://huggingface.co/answerdotai/ModernBERT-base). For more training details, please refer to our paper: [mGTE: Generalized Long-Context Text Representation and Reranking Models for Multilingual Text Retrieval](https://aclanthology.org/2024.emnlp-industry.103/)