bge-m3-567m

PyTorch

1 versions

BGE-M3 is a new model from BAAI distinguished for its versatility in Multi-Functionality, Multi-Linguality, and Multi-Granularity.

Run this model

  1. Install our magic package manager:

    curl -ssL https://magic.modular.com/ | bash

    Then run the source command that's printed in your terminal.

  2. Install Max Pipelines in order to run this model.

    magic global install max-pipelines
  3. Start a local endpoint for bge-m3/567m:

    max-serve serve --huggingface-repo-id BAAI/bge-m3

    The endpoint is ready when you see the URI printed in your terminal:

    Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
  4. Now open another terminal to send a request using curl:

    curl -N http://0.0.0.0:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
        "model": "bge-m3/567m",
        "stream": true,
        "messages": [
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": "Who won the World Series in 2020?"}
        ]
    }' | grep -o '"content":"[^"]*"' | sed 's/"content":"//g' | sed 's/"//g' | tr -d '
    ' | sed 's/\n/
    /g'
  5. 🎉 Hooray! You’re running Generative AI. Our goal is to make this as easy as possible.

About

BGE-M3 is a cutting-edge model based on the XLM-RoBERTa architecture, designed for unparalleled versatility across three key dimensions: Multi-Functionality, Multi-Linguality, and Multi-Granularity.

  • Multi-Functionality: BGE-M3 excels in three core retrieval tasks seamlessly: dense retrieval, multi-vector retrieval, and sparse retrieval, making it highly adaptable for diverse retrieval scenarios.
  • Multi-Linguality: The model supports over 100 languages, ensuring robust performance across a wide range of linguistic contexts.
  • Multi-Granularity: It effectively processes inputs from short sentences to extended documents containing up to 8192 tokens, demonstrating flexibility across different input granularities.

BGE-M3 achieves these capabilities through self-knowledge distillation, efficiently leveraging the underlying strength of XLM-RoBERTa while enhancing flexibility and performance. The model’s exceptional benchmarks demonstrate its impact as a powerful solution for multi-dimensional text representation, catering to various retrieval tasks and languages with high precision.

Benchmarks from the open-source community
image.png

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

DETAILS

MODEL CLASS
PyTorch

MODULAR GITHUB

Modular

CREATED BY

BAAI

MODEL

BAAI/bge-m3

TAGS

arxiv:2004.04906
arxiv:2004.12832
arxiv:2106.14807
arxiv:2107.05720
arxiv:2402.03216
autotrain_compatible
endpoints_compatible
feature-extraction
license:mit
onnx
pytorch
region:us
sentence-similarity
sentence-transformers
text-embeddings-inference
xlm-roberta

@ Copyright - Modular Inc - 2024