mandarjoshi/trivia_qa
Viewer • Updated • 914k • 74.6k • 216
How to use leliuga/all-MiniLM-L12-v2-GGUF with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("leliuga/all-MiniLM-L12-v2-GGUF")
sentences = [
"That is a happy person",
"That is a happy dog",
"That is a very happy person",
"Today is a sunny day"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]How to use leliuga/all-MiniLM-L12-v2-GGUF with Transformers:
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("leliuga/all-MiniLM-L12-v2-GGUF")
model = AutoModel.from_pretrained("leliuga/all-MiniLM-L12-v2-GGUF", device_map="auto")How to use leliuga/all-MiniLM-L12-v2-GGUF with llama.cpp:
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible embeddings server: llama serve -hf leliuga/all-MiniLM-L12-v2-GGUF:Q4_K_M --embeddings
winget install llama.cpp # Start a local OpenAI-compatible embeddings server: llama serve -hf leliuga/all-MiniLM-L12-v2-GGUF:Q4_K_M --embeddings
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible embeddings server: ./build/bin/llama serve -hf leliuga/all-MiniLM-L12-v2-GGUF:Q4_K_M --embeddings
How to use leliuga/all-MiniLM-L12-v2-GGUF with Ollama:
ollama run hf.co/leliuga/all-MiniLM-L12-v2-GGUF:Q4_K_M
How to use leliuga/all-MiniLM-L12-v2-GGUF with Docker Model Runner:
docker model run hf.co/leliuga/all-MiniLM-L12-v2-GGUF:Q4_K_M
How to use leliuga/all-MiniLM-L12-v2-GGUF with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull leliuga/all-MiniLM-L12-v2-GGUF:Q4_K_M
lemonade run user.all-MiniLM-L12-v2-GGUF-Q4_K_M
lemonade list
This repo contains GGUF format model files for all-MiniLM-L12-v2.
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
16-bit
32-bit
Base model
microsoft/MiniLM-L12-H384-uncased