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", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Update config.json
#16
by michaelfeil - opened
- config.json +4 -4
- sentence_bert_config.json +1 -1
config.json
CHANGED
|
@@ -6,17 +6,17 @@
|
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
"attn_logit_softcapping": 50.0,
|
|
|
|
| 9 |
"bos_token_id": 2,
|
| 10 |
"cache_implementation": "hybrid",
|
| 11 |
"eos_token_id": 1,
|
| 12 |
-
"final_logit_softcapping": 30.0,
|
| 13 |
"head_dim": 256,
|
| 14 |
-
"hidden_act": "
|
| 15 |
-
"hidden_activation": "
|
| 16 |
"hidden_size": 3584,
|
| 17 |
"initializer_range": 0.02,
|
| 18 |
"intermediate_size": 14336,
|
| 19 |
-
"max_position_embeddings":
|
| 20 |
"model_type": "gemma2",
|
| 21 |
"num_attention_heads": 16,
|
| 22 |
"num_hidden_layers": 42,
|
|
|
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
"attn_logit_softcapping": 50.0,
|
| 9 |
+
"final_logit_softcapping": 30.0,
|
| 10 |
"bos_token_id": 2,
|
| 11 |
"cache_implementation": "hybrid",
|
| 12 |
"eos_token_id": 1,
|
|
|
|
| 13 |
"head_dim": 256,
|
| 14 |
+
"hidden_act": "gelu",
|
| 15 |
+
"hidden_activation": "gelu",
|
| 16 |
"hidden_size": 3584,
|
| 17 |
"initializer_range": 0.02,
|
| 18 |
"intermediate_size": 14336,
|
| 19 |
+
"max_position_embeddings": 4096,
|
| 20 |
"model_type": "gemma2",
|
| 21 |
"num_attention_heads": 16,
|
| 22 |
"num_hidden_layers": 42,
|
sentence_bert_config.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"max_seq_length":
|
| 3 |
"do_lower_case": false
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"max_seq_length": 4096,
|
| 3 |
"do_lower_case": false
|
| 4 |
}
|