ONNX 模型库
返回模型

说明文档

ONNX 移植版

sentence-transformers/all-MiniLM-L6-v2 的 ONNX 移植版,经过调整后可返回注意力权重。

此模型用于 BM42 搜索

使用方法

以下是通过 FastEmbed 使用该模型进行推理的示例。

注意: 此模型需配合 Qdrant 使用。向量必须配置 Modifier.IDF

from fastembed import SparseTextEmbedding

documents = [
    "You should stay, study and sprint.",
    "History can only prepare us to be surprised yet again.",
]

model = SparseTextEmbedding(model_name="Qdrant/bm42-all-minilm-l6-v2-attentions")
embeddings = list(model.embed(documents))

# [
#     SparseEmbedding(values=array([0.26399775, 0.24662513, 0.47077307]),
#                     indices=array([1881538586, 150760872, 1932363795])),
#     SparseEmbedding(values=array(
#         [0.38320042, 0.25453135, 0.18017513, 0.30432631, 0.1373556]),
#                     indices=array([
#                         733618285, 1849833631, 1008800696, 2090661150,
#                         1117393019
#                     ]))
# ]

Qdrant/all_miniLM_L6_v2_with_attentions

作者 Qdrant

sentence-similarity transformers
↓ 343.8K ♥ 13

创建时间: 2024-05-09 09:03:18+00:00

更新时间: 2025-06-09 14:12:57+00:00

在 Hugging Face 上查看

文件 (9)

.gitattributes
README.md
config.json
model.onnx ONNX
special_tokens_map.json
stopwords.txt
tokenizer.json
tokenizer_config.json
vocab.txt