---
title: bge-small-zh
canonical_url: "https://www.modelscope.cn/models/Xorbits/bge-small-zh"
md_url: "https://www.modelscope.cn/models/Xorbits/bge-small-zh.md"
repository: Xorbits/bge-small-zh
last_updated: 2023-10-19
license: "Apache License 2.0"
model_type:
  - bert
architectures:
  - BertModel
library_name:
  - xinference
frameworks:
  - xinference
inference_backends:
  - "deploy_task emb"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 2021
stars: 2
---

# bge-small-zh

> bge-small-zh - Xorbits 在 ModelScope 开源的模型。This repo contains embedding model files for bge-small-zh.

Xorbits/bge-small-zh 是 ModelScope 魔搭社区上的机器学习模型，采用 Apache License 2.0 许可，可用 deploy_task emb、sglang 0.5.2、vllm 0.9.2 部署。

- **Repository**: Xorbits/bge-small-zh
- **License**: Apache License 2.0
- **Inference backends**: deploy_task emb, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 2021
- **Stars**: 2
- **Last updated**: 2023-10-19

Source: https://www.modelscope.cn/models/Xorbits/bge-small-zh

---

## bge-small-zh

This repo contains embedding model files for bge-small-zh.

FlagEmbedding can map any text to a low-dimensional dense vector 
which can be used for tasks like retrieval, classification, clustering, or semantic search. 
And it also can be used in vector databases for LLMs.

## Information
- dimensions: 512
- max_tokens: 512
- language: zh

## Usage

###  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-small-zh", model_type="embedding")
model = client.get_model(model_uid)

model.create_embedding("write a poem.")
```
