CoolFace
Modelpublic

seansitter/bge-m3-safetensors

sourceHugging Facemitupdated 4mo agoView on Hugging Face
1likes303downloads
Model Card

bge-m3-safetensors

This is a drop-in replacement for `BAAI/bge-m3` that ships the model weights as model.safetensors with bare key names (no model. prefix), suitable for use with vLLM's transformers backend for dense embedding inference.

The upstream BAAI/bge-m3 repo only ships pytorch_model.bin. vLLM's native XLM-RoBERTa pooling implementation has a weight-name mapping bug that leaves LayerNorm and embedding parameters uninitialized — using --model-impl transformers (which calls HF AutoModel directly) works around it, but that path requires safetensors with bare-key names, which the upstream repo doesn't provide. This repo solves that.

All other files (config, tokenizer, sentence-transformers pooling config) are unchanged from the upstream release. The original pytorch_model.bin and auxiliary heads (colbert_linear.pt, sparse_linear.pt) are omitted — dense-embedding inference doesn't need them.

Use with vLLM

bash
vllm serve seansitter/bge-m3-safetensors \
  --runner pooling \
  --load-format safetensors \
  --model-impl transformers \
  --trust-remote-code \
  --max-model-len 8192 \
  --port 8001

Provenance

  • —Base model: `BAAI/bge-m3` (MIT license)
  • —Conversion: pytorch_model.bin → model.safetensors with bare keys (stripped model. prefix from all parameter names)
  • —No re-training or fine-tuning — bit-equivalent weights, just a different on-disk format

Citation

Use the original BAAI/bge-m3 citation:

bibtex
@misc{bge-m3,
  title={BGE M3-Embedding: Multi-Lingual, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation},
  author={Chen, Jianlv and Xiao, Shitao and Zhang, Peitian and Luo, Kun and Lian, Defu and Liu, Zheng},
  year={2024},
  eprint={2402.03216},
  archivePrefix={arXiv}
}