---
title: bge-reranker-base
canonical_url: "https://www.modelscope.cn/models/Xorbits/bge-reranker-base"
md_url: "https://www.modelscope.cn/models/Xorbits/bge-reranker-base.md"
repository: Xorbits/bge-reranker-base
last_updated: 2023-11-21
license: "Apache License 2.0"
pipeline_tag: sentence-similarity
tasks:
  - sentence-similarity
model_type:
  - xlm-roberta
architectures:
  - XLMRobertaForSequenceClassification
parameters: 278.0M
tensor_type:
  - F32
  - I64
library_name:
  - safetensors
  - pytorch
frameworks:
  - Pytorch
inference_backends:
  - "deploy_task emb"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 22485
stars: 10
---

# bge-reranker-base

> bge-reranker-base - Xorbits 在 ModelScope 开源的模型。bge-reranker-base Mirror of BAAI/bge-reranker-base.

Xorbits/bge-reranker-base 是 ModelScope 魔搭社区上的 278.0M 参数sentence-similarity模型，采用 Apache License 2.0 许可，可用 deploy_task emb、sglang 0.5.2、vllm 0.9.2 部署。

- **Repository**: Xorbits/bge-reranker-base
- **License**: Apache License 2.0
- **Tasks**: sentence-similarity
- **Parameters**: 278.0M
- **Inference backends**: deploy_task emb, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 22485
- **Stars**: 10
- **Last updated**: 2023-11-21

Source: https://www.modelscope.cn/models/Xorbits/bge-reranker-base

---

## bge-reranker-base
Mirror of BAAI/bge-reranker-base.

### Example code

#### Install packages
```bash
pip install -U xinference[embedding]
```

####  Start a local instance of Xinference
```bash
xinference -p 9997
```

#### Launch and inference
```python
from xinference.client import Client

client = Client("http://localhost:9997")
model_uid = client.launch_model(
    model_name="bge-reranker-base",
    model_type="rerank",
    )
model = client.get_model(model_uid)

print(model.rerank(['doc1', 'doc2'], 'query'))
```

### More information

[Xinference](https://github.com/xorbitsai/inference) Replace OpenAI GPT with another LLM in your app 
by changing a single line of code. Xinference gives you the freedom to use any LLM you need. 
With Xinference, you are empowered to run inference with any open-source language models, 
speech recognition models, and multimodal models, whether in the cloud, on-premises, or even on your laptop.

<i><a href="https://join.slack.com/t/xorbitsio/shared_invite/zt-1z3zsm9ep-87yI9YZ_B79HLB2ccTq4WA">👉 Join our Slack community!</a></i>
