Sentence Similarity
sentence-transformers
Safetensors
Transformers
bilingual
feature-extraction
sentence-embedding
mteb
custom_code
Eval Results (legacy)
Instructions to use Lajavaness/bilingual-embedding-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Lajavaness/bilingual-embedding-base with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Lajavaness/bilingual-embedding-base", trust_remote_code=True) 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] - Transformers
How to use Lajavaness/bilingual-embedding-base with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Lajavaness/bilingual-embedding-base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Unable to use the model with text-embeddings-inference
#1
by yco - opened
The model seem to report the variant of the model as 'bilingual' instead of 'xlm-roberta', which causes text-embeddings-inference (https://github.com/huggingface/text-embeddings-inference) to refuse to use the model.
Is this motivated by an architecture change ?
To reproduce
model=Lajavaness/bilingual-embedding-base
volume=$PWD/data
docker run --platform linux/x86_64 -p 8080:80 -v $volume:/data --pull always ghcr.io/huggingface/text-embeddings-inference:cpu-1.4 --model-id $model
Output
2024-07-05T09:55:48.701830Z INFO text_embeddings_router: router/src/lib.rs:250: Starting model backend
Error: Could not create backend
Caused by:
Could not start backend: Model is not supported
Caused by:
unknown variant `bilingual`, expected one of `bert`, `xlm-roberta`, `camembert`, `roberta`, `distilbert`, `nomic_bert`, `mistral`, `new`, `qwen2` at line 6 column 27
Update: changing only "model_type": "xlm-roberta", in config.json makes it compatible with text_emeddings_inference