Text Classification
sentence-transformers
GGUF
Transformers
multilingual
text-embeddings-inference
llama-cpp
gguf-my-repo
feature-extraction
Instructions to use TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF") 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 TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF", dtype="auto") - llama-cpp-python
How to use TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF", filename="bge-reranker-v2-m3-q2_k.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF:Q2_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF:Q2_K # Run inference directly in the terminal: llama-cli -hf TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF:Q2_K
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF:Q2_K # Run inference directly in the terminal: ./llama-cli -hf TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF:Q2_K
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF:Q2_K
Use Docker
docker model run hf.co/TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF:Q2_K
- LM Studio
- Jan
- Ollama
How to use TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF with Ollama:
ollama run hf.co/TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF:Q2_K
- Unsloth Studio
How to use TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF with Docker Model Runner:
docker model run hf.co/TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF:Q2_K
- Lemonade
How to use TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF:Q2_K
Run and chat with the model
lemonade run user.bge-reranker-v2-m3-Q2_K-GGUF-Q2_K
List all available models
lemonade list
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
pipeline_tag: text-classification
|
| 4 |
+
tags:
|
| 5 |
+
- transformers
|
| 6 |
+
- sentence-transformers
|
| 7 |
+
- text-embeddings-inference
|
| 8 |
+
- llama-cpp
|
| 9 |
+
- gguf-my-repo
|
| 10 |
+
language:
|
| 11 |
+
- multilingual
|
| 12 |
+
base_model: BAAI/bge-reranker-v2-m3
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF
|
| 16 |
+
This model was converted to GGUF format from [`BAAI/bge-reranker-v2-m3`](https://huggingface.co/BAAI/bge-reranker-v2-m3) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
|
| 17 |
+
Refer to the [original model card](https://huggingface.co/BAAI/bge-reranker-v2-m3) for more details on the model.
|
| 18 |
+
|
| 19 |
+
## Use with llama.cpp
|
| 20 |
+
Install llama.cpp through brew (works on Mac and Linux)
|
| 21 |
+
|
| 22 |
+
```bash
|
| 23 |
+
brew install llama.cpp
|
| 24 |
+
|
| 25 |
+
```
|
| 26 |
+
Invoke the llama.cpp server or the CLI.
|
| 27 |
+
|
| 28 |
+
### CLI:
|
| 29 |
+
```bash
|
| 30 |
+
llama-cli --hf-repo TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF --hf-file bge-reranker-v2-m3-q2_k.gguf -p "The meaning to life and the universe is"
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
### Server:
|
| 34 |
+
```bash
|
| 35 |
+
llama-server --hf-repo TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF --hf-file bge-reranker-v2-m3-q2_k.gguf -c 2048
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
Note: You can also use this checkpoint directly through the [usage steps](https://github.com/ggerganov/llama.cpp?tab=readme-ov-file#usage) listed in the Llama.cpp repo as well.
|
| 39 |
+
|
| 40 |
+
Step 1: Clone llama.cpp from GitHub.
|
| 41 |
+
```
|
| 42 |
+
git clone https://github.com/ggerganov/llama.cpp
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
Step 2: Move into the llama.cpp folder and build it with `LLAMA_CURL=1` flag along with other hardware-specific flags (for ex: LLAMA_CUDA=1 for Nvidia GPUs on Linux).
|
| 46 |
+
```
|
| 47 |
+
cd llama.cpp && LLAMA_CURL=1 make
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
Step 3: Run inference through the main binary.
|
| 51 |
+
```
|
| 52 |
+
./llama-cli --hf-repo TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF --hf-file bge-reranker-v2-m3-q2_k.gguf -p "The meaning to life and the universe is"
|
| 53 |
+
```
|
| 54 |
+
or
|
| 55 |
+
```
|
| 56 |
+
./llama-server --hf-repo TheOSExplorer/bge-reranker-v2-m3-Q2_K-GGUF --hf-file bge-reranker-v2-m3-q2_k.gguf -c 2048
|
| 57 |
+
```
|