Feature Extraction
sentence-transformers
Safetensors
Transformers
gemma2
sentence-similarity
mteb
Eval Results (legacy)
Instructions to use BAAI/bge-multilingual-gemma2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use BAAI/bge-multilingual-gemma2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("BAAI/bge-multilingual-gemma2") 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] - Transformers
How to use BAAI/bge-multilingual-gemma2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="BAAI/bge-multilingual-gemma2")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("BAAI/bge-multilingual-gemma2") model = AutoModel.from_pretrained("BAAI/bge-multilingual-gemma2") - Inference
- Notebooks
- Google Colab
- Kaggle
Update instructions for usage with infinity
#13
by michaelfeil - opened
README.md
CHANGED
|
@@ -8924,6 +8924,14 @@ print(scores.tolist())
|
|
| 8924 |
# [[55.92064666748047, 1.6549524068832397], [-0.2698777914047241, 49.95653533935547]]
|
| 8925 |
```
|
| 8926 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8927 |
|
| 8928 |
## Evaluation
|
| 8929 |
|
|
|
|
| 8924 |
# [[55.92064666748047, 1.6549524068832397], [-0.2698777914047241, 49.95653533935547]]
|
| 8925 |
```
|
| 8926 |
|
| 8927 |
+
### Usage with infinity
|
| 8928 |
+
|
| 8929 |
+
Instructions for usage with [Infinity](https://github.com/michaelfeil/infinity)
|
| 8930 |
+
```bash
|
| 8931 |
+
docker run --gpus all -v $PWD/data:/app/.cache -e HF_TOKEN=$HF_TOKEN -p "7997":"7997" \
|
| 8932 |
+
michaelf34/infinity:0.0.68 \
|
| 8933 |
+
v2 --model-id BAAI/bge-multilingual-gemma2 --revision "b67c20b19cabf41f74b2aa1469047dade1f42738" --dtype bfloat16 --batch-size 4 --device cuda --engine torch --port 7997 --no-bettertransformer
|
| 8934 |
+
```
|
| 8935 |
|
| 8936 |
## Evaluation
|
| 8937 |
|