7,639
社区成员
发帖
与我相关
我的任务
分享《Qwen3-embedding-0.6B 使用指南》 https://www.aidevhome.com/?id=58
我下载文章中的模型
Qwen3-reranker-0.6b 骁龙 X Elite 平台 (8380) 模型下载
下载的demo.py 中,我添加中英文对照测试
queries = [
"What is the capital of China?",
"Explain gravity",
"人工智能应用",
"人工智能应用",
"人工智能应用",
"人工智能应用",
"Application of Artificial Intelligence",
"Application of Artificial Intelligence",
"Application of Artificial Intelligence",
"Application of Artificial Intelligence",
]
documents_relevant = [
"The capital of China is Beijing.",
"Gravity is a force that attracts two bodies towards each other. "
"It gives weight to physical objects and is responsible for the "
"movement of planets around the sun.",
"机器学习在医疗诊断中的应用",
"深度学习在自动驾驶中的最新进展",
"自然语言处理技术发展史",
"人工智能伦理问题探讨",
"The Application of Machine Learning in Medical Diagnosis",
"The Latest Advances of Deep Learning in Autonomous Driving",
"The Development History of Natural Language Processing Technology",
"Discussion on Ethical Issues of Artificial Intelligence",
]
然后运行demo.py 输出:
(C:\workspace\gitee-Omni-note\model_server\venv) PS C:\models\qwen3-reranker-8380-2.38> python .\demo.py
Initializing Qwen3-Reranker-0.6B (GenieContext)...
[INFO] "Using create From Binary"
[INFO] "Allocated total size = 157349632 across 5 buffers"
Model loaded in 1.65s
Params: max_length=10, temp=0.01, top_k=1 (greedy decoding)
Ready.
======================================================================
Testing RELEVANT documents:
======================================================================
Query : What is the capital of China?
Doc : The capital of China is Beijing....
Answer: 'Yes.' → Score: 1.0000 (0.085s)
Query : Explain gravity
Doc : Gravity is a force that attracts two bodies towards each oth...
Answer: 'yes
yes
yes
yes
yes' → Score: 1.0000 (0.188s)
Query : 人工智能应用
Doc : 机器学习在医疗诊断中的应用...
Answer: 'no' → Score: 0.0000 (0.079s)
Query : 人工智能应用
Doc : 深度学习在自动驾驶中的最新进展...
Answer: 'no
Okay, let me check the answer.' → Score: 0.0000 (0.189s)
Query : 人工智能应用
Doc : 自然语言处理技术发展史...
Answer: 'no
aje
aje
aje
aje' → Score: 0.0000 (0.187s)
Query : 人工智能应用
Doc : 人工智能伦理问题探讨...
Answer: 'no
no
no
no
no' → Score: 0.0000 (0.191s)
Query : Application of Artificial Intelligence
Doc : The Application of Machine Learning in Medical Diagnosis...
Answer: 'no
no
no
no
no' → Score: 0.0000 (0.190s)
Query : Application of Artificial Intelligence
Doc : The Latest Advances of Deep Learning in Autonomous Driving...
Answer: 'no
no
no
no
no' → Score: 0.0000 (0.188s)
Query : Application of Artificial Intelligence
Doc : The Development History of Natural Language Processing Techn...
Answer: 'no
* no
* no
* no' → Score: 0.0000 (0.190s)
Query : Application of Artificial Intelligence
Doc : Discussion on Ethical Issues of Artificial Intelligence...
Answer: 'No
Yes
Yes
Yes
Yes' → Score: 0.0000 (0.186s)
======================================================================
Testing IRRELEVANT documents:
======================================================================
Query : What is the capital of China?
Doc : Random nonsense string xyz 123 !!!...
Answer: 'No
No
No
No
No' → Score: 0.0000 (0.190s)
Query : Explain gravity
Doc : The recipe for chocolate cake requires flour, sugar, and coc...
Answer: 'no' → Score: 0.0000 (0.081s)
======================================================================
Summary:
Avg relevant score : 0.2000
Avg irrelevant score: 0.0000
[+] 1.00 Q: What is the capital of China?
D: The capital of China is Beijing.
[+] 1.00 Q: Explain gravity
D: Gravity is a force that attracts two bodies towards each oth
[+] 0.00 Q: 人工智能应用
D: 机器学习在医疗诊断中的应用
[+] 0.00 Q: 人工智能应用
D: 深度学习在自动驾驶中的最新进展
[+] 0.00 Q: 人工智能应用
D: 自然语言处理技术发展史
[+] 0.00 Q: 人工智能应用
D: 人工智能伦理问题探讨
[+] 0.00 Q: Application of Artificial Intelligence
D: The Application of Machine Learning in Medical Diagnosis
[+] 0.00 Q: Application of Artificial Intelligence
D: The Latest Advances of Deep Learning in Autonomous Driving
[+] 0.00 Q: Application of Artificial Intelligence
D: The Development History of Natural Language Processing Techn
[+] 0.00 Q: Application of Artificial Intelligence
D: Discussion on Ethical Issues of Artificial Intelligence
[-] 0.00 Q: What is the capital of China?
D: Random nonsense string xyz 123 !!!
[-] 0.00 Q: Explain gravity
D: The recipe for chocolate cake requires flour, sugar, and coc
✅ VERIFICATION PASSED — relevant docs scored higher than irrelevant
Performance (last inference):
Prompt processing: 2074.7 toks/sec
Token generation: 88.5 toks/sec
Time to first token: 42905.0 ms
Cleaning up GenieContext...
(C:\workspace\gitee-Omni-note\model_server\venv) PS C:\models\qwen3-reranker-8380-2.38>
目前的框架是二值评分。只能区分"相关/不相关",无法在多个相关文档之间排序。先用双编码器(如 BGE embedding + 余弦相似度)粗排 top-K,再用当前 reranker 做二值过滤(剔除不相关)