embedding models with vietnamese support
Collection
12 items • Updated • 3
How to use doof-ferb/halong-embedding-gguf with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("doof-ferb/halong-embedding-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]How to use doof-ferb/halong-embedding-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="doof-ferb/halong-embedding-gguf", filename="model-bf16.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
How to use doof-ferb/halong-embedding-gguf with llama.cpp:
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf doof-ferb/halong-embedding-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf doof-ferb/halong-embedding-gguf:Q4_K_M
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf doof-ferb/halong-embedding-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf doof-ferb/halong-embedding-gguf:Q4_K_M
# 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/halong-embedding-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf doof-ferb/halong-embedding-gguf:Q4_K_M
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/halong-embedding-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf doof-ferb/halong-embedding-gguf:Q4_K_M
docker model run hf.co/doof-ferb/halong-embedding-gguf:Q4_K_M
How to use doof-ferb/halong-embedding-gguf with Ollama:
ollama run hf.co/doof-ferb/halong-embedding-gguf:Q4_K_M
How to use doof-ferb/halong-embedding-gguf with Unsloth Studio:
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/halong-embedding-gguf to start chatting
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/halong-embedding-gguf to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for doof-ferb/halong-embedding-gguf to start chatting
How to use doof-ferb/halong-embedding-gguf with Docker Model Runner:
docker model run hf.co/doof-ferb/halong-embedding-gguf:Q4_K_M
How to use doof-ferb/halong-embedding-gguf with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull doof-ferb/halong-embedding-gguf:Q4_K_M
lemonade run user.halong-embedding-gguf-Q4_K_M
lemonade list
output = llm(
"Once upon a time,",
max_tokens=512,
echo=True
)
print(output)hiieu/halong_embedding in GGUF format
original: https://huggingface.co/hiieu/halong_embedding
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/hiieu/halong_embedding models/tmp
huggingface-cli download intfloat/multilingual-e5-base sentencepiece.bpe.model --local-dir 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 halong-embedding-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 512 -m model-q5_k_m.gguf
4-bit
5-bit
6-bit
8-bit
16-bit
32-bit
Base model
intfloat/multilingual-e5-base
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="doof-ferb/halong-embedding-gguf", filename="", )