Sentence Similarity
sentence-transformers
PyTorch
ONNX
xlm-roberta
feature-extraction
Eval Results
text-embeddings-inference
Instructions to use BAAI/bge-m3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use BAAI/bge-m3 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("BAAI/bge-m3") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Inference
- Notebooks
- Google Colab
- Kaggle
The model is now added to WebAI.js. Try it in your browser with no code required.
#132
by AxolsWebAI - opened
Hi there,
We've packaged this model inside our open-source library WebAI.js, so you can now integrate it into your project with just a few lines of code:
import { WebAI } from '@axols/webai-js';
const webai = await WebAI.create({
modelId: "bge-m3"
});
await webai.init({
mode: "webai",
precision: "fp16",
device: "webgpu"
});
const generation = await webai.generate({
userInput: {
texts: [
"Artificial intelligence is transforming the way we interact with technology.",
"人工智能是一个构建能够推理、学习和行动的计算机和机器的科学领域,这种推理、学习和行动通常需要人类智力,或者涉及超出人类分析能力的数据规模。",
"La IA es la columna vertebral de la innovación en la computación moderna, lo que genera valor para las personas y las empresas."
]
},
modelConfig: {
normalize: true,
pooling: "mean"
},
generateConfig: {}
});
🔬 Try Flag Embedding M3 Instantly (No Code Required)
You can benchmark and test the model directly here:
https://www.webai-js.com/models/clip-vit-base-patch32/playground
📘 Full API Reference
Detailed parameter explanations can be found here:
https://www.webai-js.com/models/bge-m3/api-reference/v1/class-api/methods/webai-generate
🧡 Fully Open Source
WebAI.js is completely open source and free to use.
Star or contribute on GitHub:
https://github.com/axolsai/webai-js
Thanks

