* Add multimodal search documentation Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Text image embedding processor Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add prerequisite Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Change query text Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Added bedrock connector tutorial and renamed ML TOC Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Name changes and rewording Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Change connector link Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Change link Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Implemented tech review comments Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Link fix and field name fix Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add default text embedding preprocessing and post-processing functions Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add sparse search documentation Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Fix links Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Pre/post processing function tech review comments Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Fix link Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Sparse search tech review comments Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Apply suggestions from code review Co-authored-by: Melissa Vagi <vagimeli@amazon.com> Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Implemented doc review comments Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add actual test sparse pipeline response Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Added tested examples Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Added model choice for sparse search Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Remove Bedrock connector Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Implemented tech review feedback Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add that the model must be deployed to neural search Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Apply suggestions from code review Co-authored-by: Nathan Bower <nbower@amazon.com> Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Link fix Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add session token to sagemaker blueprint Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Formatted bullet points the same way Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Specified both model types in neural sparse query Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Added more explanation for default pre/post-processing functions Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Remove framework and extensibility references Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Minor rewording Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> --------- Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Melissa Vagi <vagimeli@amazon.com> Co-authored-by: Nathan Bower <nbower@amazon.com>
9.7 KiB
layout | title | parent | nav_order |
---|---|---|---|
default | Pretrained models | Using custom models within OpenSearch | 120 |
Pretrained models were taken out of experimental status and released to General Availability in OpenSearch 2.9.
{: .warning}
Pretrained models
The ML framework supports a variety of open-source pretrained models that can assist with a range of machine learning (ML) search and analytics use cases.
Uploading pretrained models
To use a pretrained model in your OpenSearch cluster:
- Select the model you want to upload. For a list of pretrained models, see supported pretrained models.
- Upload the model using the upload API. Because a pretrained model originates from the ML Commons model repository, you only need to provide the
name
,version
, andmodel_format
in the upload API request.
POST /_plugins/_ml/models/_upload
{
"name": "huggingface/sentence-transformers/all-MiniLM-L12-v2",
"version": "1.0.1",
"model_format": "TORCH_SCRIPT"
}
For more information about how to upload and use ML models, see Using custom models within OpenSearch.
Supported pretrained models
The ML Framework supports the following models, categorized by type. All models are traced from Hugging Face. Although models with the same type will have similar use cases, each model has a different model size and performs differently depending on your cluster. For a performance comparison of some pretrained models, see the sbert documentation.
Sentence transformers
Sentence transformer models map sentences and paragraphs across a dimensional dense vector space. The number of vectors depends on the model. Use these models for use cases such as clustering and semantic search.
The following table provides a list of sentence transformer models and artifact links you can use to download them. Note that you must prefix the model name with huggingface/
, as shown in the Model name column. As of OpenSearch 2.6, all artifacts are set to version 1.0.1.
| Model name | Vector dimensions | Auto-truncation | TorchScript artifact | ONNX artifact |
|---|---|---|---|
| huggingface/sentence-transformers/all-distilroberta-v1
| 768-dimensional dense vector space. | Yes | - model_url
- config_url | - model_url
- config_url |
| huggingface/sentence-transformers/all-MiniLM-L6-v2
| 384-dimensional dense vector space. | Yes | - model_url
- config_url | - model_url
- config_url |
| huggingface/sentence-transformers/all-MiniLM-L12-v2
| 384-dimensional dense vector space. | Yes | - model_url
- config_url | - model_url
- config_url |
| huggingface/sentence-transformers/all-mpnet-base-v2
| 768-dimensional dense vector space. | Yes | - model_url
- config_url | - model_url
- config_url |
| huggingface/sentence-transformers/msmarco-distilbert-base-tas-b
| 768-dimensional dense vector space. Optimized for semantic search. | No | - model_url
- config_url | - model_url
- config_url |
| huggingface/sentence-transformers/multi-qa-MiniLM-L6-cos-v1
| 384-dimensional dense vector space. Designed for semantic search and trained on 215 million question/answer pairs. | Yes | - model_url
- config_url | - model_url
- config_url |
| huggingface/sentence-transformers/multi-qa-mpnet-base-dot-v1
| 384-dimensional dense vector space. | Yes | - model_url
- config_url | - model_url
- config_url |
| huggingface/sentence-transformers/paraphrase-MiniLM-L3-v2
| 384-dimensional dense vector space. | Yes | - model_url
- config_url | - model_url
- config_url |
| huggingface/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
| 384-dimensional dense vector space. | Yes | - model_url
- config_url | - model_url
- config_url |