返回模型
说明文档
Typesense 内置嵌入模型
此仓库包含 Typesense 目前支持的用于语义搜索的所有内置机器学习模型。
如果您有想要添加到我们支持列表中的模型,可以将其转换为 ONNX 格式并创建拉取请求 (PR) 来包含它。(说明见下文)。
使用方法
以下是在 Typesense 中创建集合时,指定用于自动生成嵌入向量的模型的示例:
curl -X POST \
'http://localhost:8108/collections' \
-H 'Content-Type: application/json' \
-H \"X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}\" \
-d '{
\"name\": \"products\",
\"fields\": [
{
\"name\": \"product_name\",
\"type\": \"string\"
},
{
\"name\": \"embedding\",
\"type\": \"float[]\",
\"embed\": {
\"from\": [
\"product_name\"
],
\"model_config\": {
\"model_name\": \"ts/all-MiniLM-L12-v2\"
}
}
}
]
}'
将 all-MiniLM-L12-v2 替换为此仓库中的任意模型名称。
这里有更详细的分步指南文章:https://typesense.org/docs/guide/semantic-search.html
贡献指南
如果您有想要添加到我们支持列表中的模型,可以将其转换为 ONNX 格式并创建拉取请求 (PR) 来包含它。(说明见下文)。
将模型转换为 ONNX 格式
转换 Hugging Face Transformers 模型
要将 Hugging Face 中的任意模型转换为 ONNX 格式,您可以按照此链接中的说明,使用 optimum-cli 工具。
转换 PyTorch 模型
如果您有 PyTorch 模型,可以使用 torch.onnx API 将其转换为 ONNX 格式。有关转换过程的更多信息,请参阅这里。
转换 TensorFlow 模型
对于 TensorFlow 模型,您可以使用 tf2onnx 工具将其转换为 ONNX 格式。有关此转换的详细指南可以在这里找到。
创建模型配置
在通过 PR 提交您的 ONNX 模型之前,您需要将必要的文件组织在以模型名称命名的文件夹下。请确保您的模型配置符合以下结构:
- 模型文件:ONNX 模型文件。
- 词表文件:模型所需的词汇表文件。
- 模型配置文件:命名为 config.json,该文件应包含以下键:
| 键 | 描述 | 可选 |
|-----|-------------|----------|
|model_md5| 模型文件的 MD5 校验和(字符串格式)| 否 |
|vocab_md5| 词表文件的 MD5 校验和(字符串格式)| 否 |
|model_type| 模型类型(目前仅支持
bert和xlm_roberta)| 否 | |vocab_file_name| 词表文件的文件名| 否 | |indexing_prefix| 在嵌入文档前添加的前缀| 是 | |query_prefix| 在嵌入查询前添加的前缀| 是 |
在提交 PR 之前,请确保配置文件中的信息准确且完整。
感谢您为扩展我们支持的嵌入模型集合所做出的贡献!
typesense/models-moved
作者 typesense
↓ 0
♥ 26
创建时间: 2023-03-03 07:05:30+00:00
更新时间: 2026-02-25 03:14:13+00:00
在 Hugging Face 上查看文件 (104)
.gitattributes
GATE-AraBert-v1/config.json
GATE-AraBert-v1/model.onnx
ONNX
GATE-AraBert-v1/vocab.txt
README.md
all-MiniLM-L12-v2/config.json
all-MiniLM-L12-v2/model.onnx
ONNX
all-MiniLM-L12-v2/vocab.txt
audio_query/models.json
audio_query/whisper/base-q5_1.bin
audio_query/whisper/base.bin
audio_query/whisper/base.en-q5_1.bin
audio_query/whisper/base.en.bin
audio_query/whisper/ggml-large-v2-q5_0.bin
audio_query/whisper/large-v1.bin
audio_query/whisper/large-v2.bin
audio_query/whisper/tiny.en.bin
clip-ViT-B-32-multilingual-v1/clip_image_processor.onnx
ONNX
clip-ViT-B-32-multilingual-v1/config.json
clip-ViT-B-32-multilingual-v1/model.onnx
ONNX
clip-ViT-B-32-multilingual-v1/vocab.txt
clip-vit-b-p32/clip_image_processor.onnx
ONNX
clip-vit-b-p32/clip_tokenizer.onnx
ONNX
clip-vit-b-p32/config.json
clip-vit-b-p32/model.onnx
ONNX
clip-vit-b-p32/vocab.txt
distilbert-base-uncased/config.json
distilbert-base-uncased/model.onnx
ONNX
distilbert-base-uncased/vocab.txt
distiluse-base-multilingual-cased-v2/config.json
distiluse-base-multilingual-cased-v2/model.onnx
ONNX
distiluse-base-multilingual-cased-v2/vocab.txt
e5-large-v2/config.json
e5-large-v2/model.onnx
ONNX
e5-large-v2/vocab.txt
e5-large/config.json
e5-large/model.onnx
ONNX
e5-large/vocab.txt
e5-small-v2/config.json
e5-small-v2/model.onnx
ONNX
e5-small-v2/vocab.txt
e5-small/config.json
e5-small/model.onnx
ONNX
e5-small/vocab.txt
finbert/config.json
finbert/model.onnx
ONNX
finbert/vocab.txt
gte-large/config.json
gte-large/model.onnx
ONNX
gte-large/vocab.txt
gte-small/config.json
gte-small/model.onnx
ONNX
gte-small/vocab.txt
jina-embeddings-v2-base-en/config.json
jina-embeddings-v2-base-en/model.onnx
ONNX
jina-embeddings-v2-base-en/vocab.txt
multilingual-e5-base/config.json
multilingual-e5-base/model.onnx
ONNX
multilingual-e5-base/sentencepiece.bpe.model
multilingual-e5-large/config.json
multilingual-e5-large/model.onnx
ONNX
multilingual-e5-large/model.onnx_data
multilingual-e5-large/sentencepiece.bpe.model
multilingual-e5-small/config.json
multilingual-e5-small/model.onnx
ONNX
multilingual-e5-small/sentencepiece.bpe.model
nomic-embed-text-v1.5/config.json
nomic-embed-text-v1.5/model.onnx
ONNX
nomic-embed-text-v1.5/vocab.txt
paraphrase-MiniLM-L6-v2/config.json
paraphrase-MiniLM-L6-v2/model.onnx
ONNX
paraphrase-MiniLM-L6-v2/vocab.txt
paraphrase-multilingual-mpnet-base-v2/config.json
paraphrase-multilingual-mpnet-base-v2/model.onnx
ONNX
paraphrase-multilingual-mpnet-base-v2/sentencepiece.bpe.model
siglip-base-patch16-224/config.json
siglip-base-patch16-224/model.onnx
ONNX
siglip-base-patch16-224/siglip_image_processor.onnx
ONNX
siglip-base-patch16-224/spiece.model
snowflake-arctic-embed-m/config.json
snowflake-arctic-embed-m/model.onnx
ONNX
snowflake-arctic-embed-m/vocab.txt
voice_query/models.json
voice_query/whisper/base-q5_1.bin
voice_query/whisper/base.bin
voice_query/whisper/base.en-q5_1.bin
voice_query/whisper/base.en.bin
voice_query/whisper/large-v1.bin
voice_query/whisper/large-v2-q5_0.bin
voice_query/whisper/large-v2.bin
voice_query/whisper/large-v3-q5_0.bin
voice_query/whisper/medium-q5_0.bin
voice_query/whisper/medium.bin
voice_query/whisper/medium.en-q5_0.bin
voice_query/whisper/medium.en.bin
voice_query/whisper/small-q5_1.bin
voice_query/whisper/small.bin
voice_query/whisper/small.en-q5_1.bin
voice_query/whisper/small.en.bin
voice_query/whisper/tiny-q5_1.bin
voice_query/whisper/tiny.bin
voice_query/whisper/tiny.en-q5_1.bin
voice_query/whisper/tiny.en-q8_0.bin
voice_query/whisper/tiny.en.bin