Instructions to use doof-ferb/bge-m3-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use doof-ferb/bge-m3-gguf with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("doof-ferb/bge-m3-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] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use doof-ferb/bge-m3-gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf doof-ferb/bge-m3-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf doof-ferb/bge-m3-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf doof-ferb/bge-m3-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf doof-ferb/bge-m3-gguf:Q4_K_M
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 doof-ferb/bge-m3-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf doof-ferb/bge-m3-gguf:Q4_K_M
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 doof-ferb/bge-m3-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf doof-ferb/bge-m3-gguf:Q4_K_M
Use Docker
docker model run hf.co/doof-ferb/bge-m3-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use doof-ferb/bge-m3-gguf with Ollama:
ollama run hf.co/doof-ferb/bge-m3-gguf:Q4_K_M
- Unsloth Studio
How to use doof-ferb/bge-m3-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 doof-ferb/bge-m3-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 doof-ferb/bge-m3-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for doof-ferb/bge-m3-gguf to start chatting
- Docker Model Runner
How to use doof-ferb/bge-m3-gguf with Docker Model Runner:
docker model run hf.co/doof-ferb/bge-m3-gguf:Q4_K_M
- Lemonade
How to use doof-ferb/bge-m3-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull doof-ferb/bge-m3-gguf:Q4_K_M
Run and chat with the model
lemonade run user.bge-m3-gguf-Q4_K_M
List all available models
lemonade list
- Atomic Chat
metadata
license: cc-by-4.0
base_model: BAAI/bge-m3
language:
- vi
library_name: sentence-transformers
pipeline_tag: sentence-similarity
inference: false
BAAI/bge-m3 in GGUF format
original: https://huggingface.co/BAAI/bge-m3
quantization:
REL=b3827 # can change to a later release
wget https://github.com/ggerganov/llama.cpp/releases/download/$REL/llama-$REL-bin-ubuntu-x64.zip --content-disposition --continue &> /dev/null
wget https://github.com/ggerganov/llama.cpp/archive/refs/tags/$REL.zip --content-disposition --continue &> /dev/null
unzip -q llama-$REL-bin-ubuntu-x64.zip
unzip -q llama.cpp-$REL.zip
mv llama.cpp-$REL/* .
rm -r llama.cpp-$REL/ llama-$REL-bin-ubuntu-x64.zip llama.cpp-$REL.zip
pip install -q -r requirements.txt
rm -rf models/tmp/
git clone --depth=1 --single-branch https://huggingface.co/BAAI/bge-m3 models/tmp
python convert_hf_to_gguf.py models/tmp/ --outfile model-f32.gguf --outtype f32
build/bin/llama-quantize model-f32.gguf model-f16.gguf f16 2> /dev/null
build/bin/llama-quantize model-f32.gguf model-bf16.gguf bf16 2> /dev/null
build/bin/llama-quantize model-f32.gguf model-q8_0.gguf q8_0 2> /dev/null
build/bin/llama-quantize model-f32.gguf model-q6_k.gguf q6_k 2> /dev/null
build/bin/llama-quantize model-f32.gguf model-q5_k_m.gguf q5_k_m 2> /dev/null
build/bin/llama-quantize model-f32.gguf model-q5_k_s.gguf q5_k_s 2> /dev/null
build/bin/llama-quantize model-f32.gguf model-q4_k_m.gguf q4_k_m 2> /dev/null
build/bin/llama-quantize model-f32.gguf model-q4_k_s.gguf q4_k_s 2> /dev/null
rm -rf models/yolo/
mkdir -p models/yolo
mv model-*.gguf models/yolo/
touch models/yolo/README.md
huggingface-cli upload bge-m3-gguf models/yolo .
usage:
build/bin/llama-embedding -m model-q5_k_m.gguf -p "Cô ấy cười nói suốt cả ngày" --embd-output-format array 2> /dev/null
# OR
build/bin/llama-server --embedding -c 128 -m model-q5_k_m.gguf