-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor ML section - local and remote models #5609
Conversation
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
ML Commons supports the following model-level APIs: | ||
|
||
- [Register model]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/model-apis/register-model/) | ||
- [Deploy model]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/model-apis/deploy-model/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: move this line after Get model?
- [Undeploy model]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/model-apis/undeploy-model/) | ||
- [Delete model]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/model-apis/delete-model/) | ||
|
||
## Model access control considerations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mainly about model groups, Should we move this to model-group-apis/index.md
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is about model groups but from the perspective of accessing a model. This section gives a brief overview of what models can be accessed by what users and then links to the model access control page for further details. So I think I'll leave this here.
|
||
## Request fields | ||
|
||
All request fields are required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct.
For different model, they need different fields.
For pretrained model, check https://opensearch.org/docs/latest/ml-commons-plugin/pretrained-models/, the mandatory fields are name
, version
, model_format
For uploading model via URL, refer to https://github.com/opensearch-project/ml-commons/blob/2.x/docs/model_serving_framework/text_embedding_model_examples.md, mandatory fields:
name
version
function_name
model_format
model_content_hash_value
model_config
: {model_type
,embedding_dimension
,framework_type
},url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For remote model , refer to https://github.com/opensearch-project/ml-commons/blob/2.x/docs/tutorials/remote_inference.md
} | ||
``` | ||
|
||
## Registering a model containing an internal connector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refer to https://github.com/opensearch-project/ml-commons/blob/2.x/docs/tutorials/remote_inference.md
For Register remote model, user can use internal connector or connector id (standalone connector)
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kolchfa-aws Solid documentation. Edits are minimal. I agree with capitalizing the API sections because they serve as headings.
} | ||
``` | ||
{% include copy-curl.html %} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete extra blank line
"last_update_time": 1689793851101, | ||
"is_async": true | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a blank line between lines 208 and 209?
| `model_type` | String | The model type, such as `bert`. For a Hugging Face model, the model type is specified in `config.json`. For an example, see the [`all-MiniLM-L6-v2` Hugging Face model `config.json`](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/blob/main/config.json#L15). Required. | | ||
| `embedding_dimension` | Integer | The dimension of the model-generated dense vector. For a Hugging Face model, the dimension is specified in the model card. For example, in the [`all-MiniLM-L6-v2` Hugging Face model card](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2), the statement `384 dimensional dense vector space` specifies 384 as the embedding dimension. Required. | | ||
| `framework_type` | String | The framework the model is using. Currently, we support `sentence_transformers` and `huggingface_transformers` frameworks. The `sentence_transformers` model outputs text embeddings directly, so ML Commons does not perform any post processing. For `huggingface_transformers`, ML Commons performs post processing by applying mean pooling to get text embeddings. See the example [`all-MiniLM-L6-v2` Hugging Face model](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) for more details. Required. | | ||
| `all_config` | String | This field is used for reference purposes. You can specify all model configurations in this field. For example, if you are using a Hugging Face model, you can minify the `config.json` file to one line and save its contents in the `all_config` field. Once the model is uploaded, you can use the get model API operation to get all model configurations stored in this field. Optional. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this read "Get Model API?"
|
||
# Profile | ||
|
||
The profile API operation returns runtime information about ML tasks and models. The profile operation can help debug model issues at runtime. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this read "Profile API operation?"
|
||
# Train | ||
|
||
The train API operation trains a model based on a selected algorithm. Training can occur both synchronously and asynchronously. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this read "Train API operation?"
Co-authored-by: Melissa Vagi <vagimeli@amazon.com> Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
* Refactor ML section - local and remote models Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Added command to calculate checksum Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add ONNX format to register API Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add sparse encoding predict example Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add API section Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Refactor the API section Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Typo Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Implemented Vale comments Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add get connector API Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Reword heading Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Addressed 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> --------- 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> (cherry picked from commit 826e677) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Refactor ML section - local and remote models * Added command to calculate checksum * Add ONNX format to register API * Add sparse encoding predict example * Add API section * Refactor the API section * Typo * Implemented Vale comments * Add get connector API * Reword heading * Addressed tech review comments * Apply suggestions from code review --------- (cherry picked from commit 826e677) Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
* Refactor ML section - local and remote models Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Added command to calculate checksum Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add ONNX format to register API Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add sparse encoding predict example Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add API section Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Refactor the API section Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Typo Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Implemented Vale comments Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Add get connector API Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Reword heading Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Addressed 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> --------- 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>
Description
Refactor ML section - local and remote models
Issues Resolved
Fixes #5591
Fixes #4866
Fixes #4966
Fixes #5559
Checklist
For more information on following Developer Certificate of Origin and signing off your commits, please check here.