Instructions to use BAAI/bge-reranker-v2.5-gemma2-lightweight with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use BAAI/bge-reranker-v2.5-gemma2-lightweight with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("BAAI/bge-reranker-v2.5-gemma2-lightweight", trust_remote_code=True) 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-reranker-v2.5-gemma2-lightweight with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="BAAI/bge-reranker-v2.5-gemma2-lightweight", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("BAAI/bge-reranker-v2.5-gemma2-lightweight", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
How to setting the parameter to save flops? 如何设置节省flops的参数?
Hello! bge-reranker-v2.5-gemma2-lightweight is a surprising model. How do we set the parameters like cutoff_layers to reproduce the results in the table?
你好!bge-reranker-v2.5-gemma2-轻量级是一个令人惊讶的模型。我们如何设置像cutoff_layers这样的参数来在表中重现结果呢?
Thanks for your attention. You just need to set compress_ratio as 2, compress_layer as [8] and cutoff_layers as [25].
Many Thanks
Hi, I want to ask if I don't set cutoff_layers and compression_{ratio, layer}, I will use the full model with 0% flops saving. Is that right?
Hi, I want to ask if I don't set
cutoff_layersandcompression_{ratio, layer}, I will use the full model with 0% flops saving. Is that right?
Yes.