Model reference · open weights
bge-m3-onnx-o4 is an open-weight embedding model from hooman650. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | hooman650 |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Context | 8194 tokens |
| Runs with | transformers |
| Released | 2024-02-06 |
| Popularity | 8k downloads / month |
| Licence | Open weights |
About
This is bge-m3-onnx-o4 weights of the original BAAI/bge-m3. Why is this model cool?
Please see the instructions below.
# pip install huggingface-hub
from huggingface_hub import snapshot_download
snapshot_download(repo_id="hooman650/bge-m3-onnx-o4",local_dir="bge-m3-onnx")
# for cuda
pip install --upgrade-strategy eager optimum[onnxruntime]
from optimum.onnxruntime import ORTModelForFeatureExtraction
from transformers import AutoTokenizer
import torch
# Make sure that you download the model weights locally to `bge-m3-onnx`
model = ORTModelForFeatureExtraction.from_pretrained("bge-m3-onnx", provider="CUDAExecutionProvider") # omit provider for CPU usage.
tokenizer = AutoTokenizer.from_pretrained("hooman650/bge-m3-onnx-o4")
sentences = [
"English: The quick brown fox jumps over the lazy dog.",
"Spanish: El rápido zorro marrón salta sobre el perro perezoso.",
"French: Le renard brun rapide saute par-dessus le chien paresseux.",
"German: Der schnelle braune Fuchs springt über den faulen Hund.",
"Italian: La volpe marrone veloce salta sopra il cane pigro.",
"Japanese: 速い茶色の狐が怠惰な犬を飛び越える。",
"Chinese (Simplified): 快速的棕色狐狸跳过懒狗。",
"Russian: Быстрая коричневая лиса прыгает через ленивую собаку.",
"Arabic: الثعلب البني السريع يقفز فوق الكلب الكسول.",
"Hindi: तेज़ भूरी लोमड़ी आलसी कुत्ते के ऊपर कूद जाती है।"
]
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt').to("cuda")
# Get the embeddings
out=model(**encoded_input,return_dict=True).last_hidden_state
# normalize the embeddings
dense_vecs = torch.nn.functional.normalize(out[:, 0], dim=-1)
coming soon...
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys bge-m3-onnx-o4 for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (bge-m3-onnx-o4 below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"bge-m3-onnx-o4","input":"text to embed"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.