Downloads · 30 days
89
22% of all-time downloads
cicaba/Qwen3-Reranker-0.6B-GGUF-llamacpp-fixed
Qwen3-Reranker-0.6B-GGUF-llamacpp-fixed is a text ranking model from cicaba. Use it for the text ranking task on the model card, and read the license before you ship it in a product. It is set up for gguf. The card lists the license as apache-2.0.
这是从官方 Qwen/Qwen3-Reranker-0.6B 重新转换的 llama.cpp GGUF。
Downloads · 30 days
89
22% of all-time downloads
All-time downloads
406
Public
Repo size
1.8 GB
Likes
0
Public
Click a slice to open those files.
.gguf1.8 GB · 100%
From the Hugging Face model README
这是从官方 Qwen/Qwen3-Reranker-0.6B 重新转换的 llama.cpp GGUF。
本仓库解决了部分早期或通用 GGUF 转换在 llama.cpp /v1/rerank 中无法正确评分的问题:接口虽然能够调用,但所有文档的分数都接近零,显示为 0.0000,甚至产生错误排序。
This repository contains freshly converted llama.cpp GGUF files for Qwen/Qwen3-Reranker-0.6B. It fixes a failure found in some older or generic conversions where /v1/rerank returned near-zero scores and incorrect rankings.
| 文件 | 格式 | 大小 | SHA-256 |
|---|---|---|---|
Qwen3-Reranker-0.6B-fixed-f16.gguf | F16 | 1,197,634,272 bytes | 15e38d12462f56791bed44d97bad3880028d6fccebe99db0498c9e613f4aaf1f |
Qwen3-Reranker-0.6B-fixed-Q8_0.gguf | Q8_0 | 639,153,312 bytes | 99bcc225f0a38b73059b31627d28131cbea9c11b7ca894e56b95621aac878d65 |
Q8_0 由本仓库的 F16 GGUF 使用同一份 llama.cpp 构建中的 llama-quantize 生成。
Qwen3-Reranker 不是普通的文本生成模型。它需要把 Query 与 Document 按 reranker 格式组成输入,并在最后位置比较 yes / no 分类输出,得到 0~1 的相关性分数。
部分较早的 GGUF 或通用转换没有正确保留或生成 llama.cpp reranking 所需的分类输出头与元数据。典型症状包括:
/v1/rerank 可以返回 HTTP 200,但全部分数接近 0;0.0000;旧转换的实际测试示例:
| 文档 | 原始分数 | 排名 |
|---|---|---|
| 显卡用于图形和并行计算(不相关) | 2.5976477777611348e-14 | 1 |
| 熊猫生活在中国并以竹子为食(相关) | 1.755434294906939e-19 | 2 |
| 法国首都是巴黎(不相关) | 5.623200945999332e-20 | 3 |
虽然这些值并非数学意义上的精确零,但对实际检索完全失效,而且排序错误。
重新转换的目的,是使用较新的 llama.cpp 转换逻辑,正确处理 reranker 所需的分类输出和 rank pooling 元数据,包括 llama.cpp 用于计算相关性分数的分类头。
测试环境:
b9879 / commit 72874f559Qwen3-Reranker-0.6B-fixed-Q8_0.gguf/v1/rerank测试 Query:
什么是熊猫?
结果:
| 文档 | relevance_score | 排名 |
|---|---|---|
| 熊猫是一种生活在中国、主要吃竹子的熊科动物。 | 0.9938316345 | 1 |
| 显卡用于计算机图形和并行计算。 | 0.0017781574 | 2 |
| 法国的首都是巴黎。 | 0.0003044957 | 3 |
修复后的模型能够给相关文档高分、给不相关文档低分,并产生正确排序。
llama-server \
-m ./Qwen3-Reranker-0.6B-fixed-Q8_0.gguf \
--alias Qwen3-Reranker-0.6B \
--host 0.0.0.0 \
--port 8092 \
-ngl 999 \
-c 20480 \
-np 1 \
-b 2048 \
-ub 1024 \
--embedding \
--pooling rank \
--reranking \
--flash-attn on
三个关键参数:
--reranking:启用 /rerank、/v1/rerank 等 reranking API;--embedding:启用内部特征输出,而不是普通文本生成;--pooling rank:使用分类输出计算每个 Query/Document 对的相关性分数。curl http://127.0.0.1:8092/v1/rerank \
-H 'Content-Type: application/json' \
-d '{
"model": "Qwen3-Reranker-0.6B",
"query": "什么是熊猫?",
"top_n": 3,
"documents": [
"熊猫是一种生活在中国、主要吃竹子的熊科动物。",
"法国的首都是巴黎。",
"显卡用于计算机图形和并行计算。"
]
}'
请使用 /v1/rerank,不要把该模型当作普通 embedding 模型调用 /v1/embeddings。
原始 Transformers 权重来自:
转换过程:
python3 convert_hf_to_gguf.py \
/path/to/Qwen3-Reranker-0.6B \
--outtype f16 \
--outfile Qwen3-Reranker-0.6B-fixed-f16.gguf
llama-quantize \
Qwen3-Reranker-0.6B-fixed-f16.gguf \
Qwen3-Reranker-0.6B-fixed-Q8_0.gguf \
Q8_0
--ctx-size 和模型上下文限制;The original model is released under the Apache License 2.0. This conversion keeps the same license and is not an official release by the Qwen team.
感谢 Qwen 团队与 llama.cpp 社区。本仓库仅发布格式转换与验证结果,不修改原模型训练权重所表达的能力。