Instructions to use AnhNguyen6688/Vietnamese_Reranker_F16_GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use AnhNguyen6688/Vietnamese_Reranker_F16_GGUF with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("AnhNguyen6688/Vietnamese_Reranker_F16_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] - llama-cpp-python
How to use AnhNguyen6688/Vietnamese_Reranker_F16_GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="AnhNguyen6688/Vietnamese_Reranker_F16_GGUF", filename="Vietnamese_Reranker_F16_GGUF.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 AnhNguyen6688/Vietnamese_Reranker_F16_GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf AnhNguyen6688/Vietnamese_Reranker_F16_GGUF:F16_GGUF # Run inference directly in the terminal: llama-cli -hf AnhNguyen6688/Vietnamese_Reranker_F16_GGUF:F16_GGUF
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf AnhNguyen6688/Vietnamese_Reranker_F16_GGUF:F16_GGUF # Run inference directly in the terminal: llama-cli -hf AnhNguyen6688/Vietnamese_Reranker_F16_GGUF:F16_GGUF
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 AnhNguyen6688/Vietnamese_Reranker_F16_GGUF:F16_GGUF # Run inference directly in the terminal: ./llama-cli -hf AnhNguyen6688/Vietnamese_Reranker_F16_GGUF:F16_GGUF
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 AnhNguyen6688/Vietnamese_Reranker_F16_GGUF:F16_GGUF # Run inference directly in the terminal: ./build/bin/llama-cli -hf AnhNguyen6688/Vietnamese_Reranker_F16_GGUF:F16_GGUF
Use Docker
docker model run hf.co/AnhNguyen6688/Vietnamese_Reranker_F16_GGUF:F16_GGUF
- LM Studio
- Jan
- Ollama
How to use AnhNguyen6688/Vietnamese_Reranker_F16_GGUF with Ollama:
ollama run hf.co/AnhNguyen6688/Vietnamese_Reranker_F16_GGUF:F16_GGUF
- Unsloth Studio
How to use AnhNguyen6688/Vietnamese_Reranker_F16_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 AnhNguyen6688/Vietnamese_Reranker_F16_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 AnhNguyen6688/Vietnamese_Reranker_F16_GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for AnhNguyen6688/Vietnamese_Reranker_F16_GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use AnhNguyen6688/Vietnamese_Reranker_F16_GGUF with Docker Model Runner:
docker model run hf.co/AnhNguyen6688/Vietnamese_Reranker_F16_GGUF:F16_GGUF
- Lemonade
How to use AnhNguyen6688/Vietnamese_Reranker_F16_GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AnhNguyen6688/Vietnamese_Reranker_F16_GGUF:F16_GGUF
Run and chat with the model
lemonade run user.Vietnamese_Reranker_F16_GGUF-F16_GGUF
List all available models
lemonade list
Model Card: Vietnamese_Reranker
Vietnamese_Reranker is an reranker model fine-tuned from the bge-reranker-v2-m3 model (https://huggingface.co/BAAI/bge-reranker-v2-m3) to enhance retrieval capabilities for Vietnamese.
- The model was trained on approximately 1,100,000 triplets of queries, positive documents, and negative documents for Vietnamese.
- The model was trained with a maximum sequence length of 2304 (256 for query and 2048 for passages).
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: BAAI/bge-reranker-v2-m3
- Maximum Sequence Length: 2304 tokens (256 for query and 2048 for passages)
- Output Dimensionality: 1024 dimensions
- Similarity Function: Dot product Similarity
- Language: Vietnamese
- Licence: Apache 2.0
Usage
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('AITeamVN/Vietnamese_Reranker')
model = AutoModelForSequenceClassification.from_pretrained('AITeamVN/Vietnamese_Reranker')
model.eval()
MAX_LENGTH = 2304
pairs = [['Trí tuệ nhân tạo là gì?', 'Trí tuệ nhân tạo là công nghệ giúp máy móc suy nghĩ và học hỏi như con người. Nó hoạt động bằng cách thu thập dữ liệu, nhận diện mẫu và đưa ra quyết định.'],
['Trí tuệ nhân tạo là gì?', 'Giấc ngủ giúp cơ thể và não bộ nghỉ ngơi, hồi phục năng lượng và cải thiện trí nhớ. Ngủ đủ giấc giúp tinh thần tỉnh táo và làm việc hiệu quả hơn.']]
with torch.no_grad():
inputs = tokenizer(pairs, padding=True, truncation=True, return_tensors='pt', max_length=MAX_LENGTH)
scores = model(**inputs, return_dict=True).logits.view(-1, ).float()
print(scores)
'''
# tensor([ 7.5590, -9.0743])
'''
Evaluation:
- Dataset: Entire training dataset of Legal Zalo 2021. Our model was not trained on this dataset.
| Model | Accuracy@1 | Accuracy@3 | Accuracy@5 | Accuracy@10 | MRR@10 |
|---|---|---|---|---|---|
| Vietnamese_Reranker | 0.7944 | 0.9324 | 0.9537 | 0.9740 | 0.8672 |
| Vietnamese_Embedding_v2 | 0.7262 | 0.8927 | 0.9268 | 0.9578 | 0.8149 |
| Vietnamese_Embedding | 0.7274 | 0.8992 | 0.9305 | 0.9568 | 0.8181 |
| Vietnamese-bi-encoder (BKAI) | 0.7109 | 0.8680 | 0.9014 | 0.9299 | 0.7951 |
| BGE-M3 | 0.5682 | 0.7728 | 0.8382 | 0.8921 | 0.6822 |
Vietnamese_Reranker and Vietnamese_Embedding_v2 was trained on 1,100,000 triplets.
Although the score on the legal domain drops a bit on Vietnamese_Embedding_v2 (Phase 2), since this phase data is much larger, it is good for other domains.
Contact
Email: nguyennhotrung3004@gmail.com
Developer
Member: Nguyễn Nho Trung, Nguyễn Nhật Quang, Nguyễn Văn Huy.
Citation
@misc{Vietnamese_Embedding,
title={Vietnamese_Embedding: Embedding model in Vietnamese language.},
author={Nguyen Nho Trung, Nguyen Nhat Quang, Nguyễn Văn Huy},
year={2025},
publisher={Huggingface},
}
- Downloads last month
- 10
16-bit
Model tree for AnhNguyen6688/Vietnamese_Reranker_F16_GGUF
Base model
BAAI/bge-reranker-v2-m3