---
title: bge-small-zh-v1.5
canonical_url: "https://www.modelscope.cn/models/chinapkulxh/bge-small-zh-v1.5"
md_url: "https://www.modelscope.cn/models/chinapkulxh/bge-small-zh-v1.5.md"
repository: chinapkulxh/bge-small-zh-v1.5
chinese_name: "bge向量化模型部署演示"
last_updated: 2025-01-05
pipeline_tag: feature-extraction
tasks:
  - feature-extraction
model_type:
  - bert
architectures:
  - BertModel
parameters: 24.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: 127
stars: 1
---

# bge-small-zh-v1.5

> bge-small-zh-v1.5 - chinapkulxh 在 ModelScope 开源的模型。bge-small-zh-v1.5 向量化模型部署演示

chinapkulxh/bge-small-zh-v1.5 是 ModelScope 魔搭社区上的 24.0M 参数feature-extraction模型，可用 deploy_task emb、sglang 0.5.2、vllm 0.9.2 部署。

- **Repository**: chinapkulxh/bge-small-zh-v1.5
- **Tasks**: feature-extraction
- **Parameters**: 24.0M
- **Inference backends**: deploy_task emb, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 127
- **Stars**: 1
- **Last updated**: 2025-01-05

Source: https://www.modelscope.cn/models/chinapkulxh/bge-small-zh-v1.5

---

<div align="center">

# bge-small-zh-v1.5
李晓华 博士

</div>

# 一、模型介绍

bge-small-zh-v1.5 模型来自于 BAAI 向量化模型 bge-small-zh-v1.5 的改造，删掉了没用的其它格式权重及历史版本，大大加快了下载速度。本项目侧重于向量化模型的部署和应用。

- 最大输入：512个token
- 向量维度：512维
- 部署框架：Xinference
- 调用方式：LangChain


# 二、使用方法

1. 部署模型
```bash
# 1. 安装 Xinference
pip install "xinference[transformers]"
# 2. 启动 Xinference
xinference-local --host 0.0.0.0 --port 9997
# 3. 访问可视化界面
http://ip_of_the_server:9997
# 4. 下载模型
git clone https://www.modelscope.cn/chinapkulxh/bge-small-zh-v1.5.git
# 5. 通过界面部署模型
按界面指示操作
```
2. 调用模型
```python
# 1. 引入依赖
from langchain_community.embeddings import XinferenceEmbeddings
# 2. 连接信息
embedding_server_url="http://ip_of_the_server:9997"
embedding_model_uid="bge-small-zh-v1.5"
# 3. 连接模型
embed = XinferenceEmbeddings(server_url=embedding_server_url, model_uid=embedding_model_uid)
# 4. 对输入文本向量化操作
vec = embed.embed_query(text="你好")
# 5. 打印向量和向量长度
print(vec, len(vec))
```

# 三、技术交流

- 姓名：李晓华 博士
- 微信：chinapkulxh
- 邮箱：chinapkulxh(at)pku.edu.cn
