Embedding Models
Collection
Some embedding models I've trained, finetuned, distilled, converted, or something else entirely β’ 15 items β’ Updated
How to use cnmoro/portuguese-en-bge-m3 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("cnmoro/portuguese-en-bge-m3")
sentences = [
"The weather is lovely today.",
"It's so sunny outside!",
"He drove to the stadium."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]This model is a 36.6% smaller version of BAAI/bge-m3 for Portuguese + English, created using the mtem-pruner space.
This pruned model should perform similarly to the original model for Portuguese language tasks with a much smaller memory footprint. However, it may not perform well for other languages present in the original multilingual model as tokens not commonly used in Portuguese were removed from the original multilingual model's vocabulary.
You can use this model with the Transformers library:
from transformers import AutoModel, AutoTokenizer
model_name = "cnmoro/portuguese-bge-m3"
model = AutoModel.from_pretrained(model_name, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True, use_fast=True)
Or with the sentence-transformers library:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("cnmoro/portuguese-bge-m3")
Credits: cc @antoinelouis
Base model
BAAI/bge-m3