logo
0
0
WeChat Login
chore: 更新 docker 镜像为默认开发环境

运行

docker run -d \
    --gpus all \
    --name bge-m3-t4 \
    --restart always \
    --net host \
    --log-opt max-size=100m \
    --log-opt max-file=3 \
    -e MAX_BATCH_SIZE=4 \
    -e MAX_LENGTH=2048 \
    docker.cnb.cool/h_h/docker-sync/bge-m3-t4:offline-v2

embed接口

测试模型
curl -s -X POST http://localhost:8080/embed \
-H "Content-Type: application/json" \
-d '{"inputs":"这是一段测试文本"}' | python3 -m json.tool | head -5

curl -s -X POST http://localhost:8080/embed \
-H "Content-Type: application/json" \
-d '{"inputs":["文本一","文本二","文本三"]}'


curl -s http://localhost:8080/health

V1 接口


单条文本(与 OpenAI SDK 完全兼容):
curl -s -X POST http://localhost:8080/v1/embeddings \
  -H "Content-Type: application/json" \
  -d '{"input":"这是一段测试文本","model":"bge-m3"}' \
  | python3 -m json.tool | head -20


批量文本:
curl -s -X POST http://localhost:8080/v1/embeddings \
  -H "Content-Type: application/json" \
  -d '{"input":["文本一","文本二","文本三"],"model":"bge-m3"}'



OpenAI 标准响应示例:
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [0.123, -0.456, 0.789, ...]
    }
  ],
  "model": "bge-m3",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

About

No description, topics, or website provided.