[Frontend] Score entrypoint support data_1 & data_2 and queries & documents as inputs (#32577)

Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
This commit is contained in:
wang.yuqi
2026-01-19 22:07:46 +08:00
committed by GitHub
parent 758df5afe7
commit c88860d759
17 changed files with 277 additions and 137 deletions

View File

@@ -694,7 +694,7 @@ Example template file: [examples/pooling/score/template/nemotron-rerank.jinja](.
#### Single inference
You can pass a string to both `text_1` and `text_2`, forming a single sentence pair.
You can pass a string to both `queries` and `documents`, forming a single sentence pair.
```bash
curl -X 'POST' \
@@ -704,8 +704,8 @@ curl -X 'POST' \
-d '{
"model": "BAAI/bge-reranker-v2-m3",
"encoding_format": "float",
"text_1": "What is the capital of France?",
"text_2": "The capital of France is Paris."
"queries": "What is the capital of France?",
"documents": "The capital of France is Paris."
}'
```
@@ -730,9 +730,9 @@ curl -X 'POST' \
#### Batch inference
You can pass a string to `text_1` and a list to `text_2`, forming multiple sentence pairs
where each pair is built from `text_1` and a string in `text_2`.
The total number of pairs is `len(text_2)`.
You can pass a string to `queries` and a list to `documents`, forming multiple sentence pairs
where each pair is built from `queries` and a string in `documents`.
The total number of pairs is `len(documents)`.
??? console "Request"
@@ -743,8 +743,8 @@ The total number of pairs is `len(text_2)`.
-H 'Content-Type: application/json' \
-d '{
"model": "BAAI/bge-reranker-v2-m3",
"text_1": "What is the capital of France?",
"text_2": [
"queries": "What is the capital of France?",
"documents": [
"The capital of Brazil is Brasilia.",
"The capital of France is Paris."
]
@@ -775,9 +775,9 @@ The total number of pairs is `len(text_2)`.
}
```
You can pass a list to both `text_1` and `text_2`, forming multiple sentence pairs
where each pair is built from a string in `text_1` and the corresponding string in `text_2` (similar to `zip()`).
The total number of pairs is `len(text_2)`.
You can pass a list to both `queries` and `documents`, forming multiple sentence pairs
where each pair is built from a string in `queries` and the corresponding string in `documents` (similar to `zip()`).
The total number of pairs is `len(documents)`.
??? console "Request"
@@ -789,11 +789,11 @@ The total number of pairs is `len(text_2)`.
-d '{
"model": "BAAI/bge-reranker-v2-m3",
"encoding_format": "float",
"text_1": [
"queries": [
"What is the capital of Brazil?",
"What is the capital of France?"
],
"text_2": [
"documents": [
"The capital of Brazil is Brasilia.",
"The capital of France is Paris."
]
@@ -847,8 +847,8 @@ You can pass multi-modal inputs to scoring models by passing `content` including
"http://localhost:8000/v1/score",
json={
"model": "jinaai/jina-reranker-m0",
"text_1": "slm markdown",
"text_2": {
"queries": "slm markdown",
"documents": {
"content": [
{
"type": "image_url",