Skip to content
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

updating docs for model group id #980

Merged
merged 2 commits into from
Jun 20, 2023
Merged

Conversation

dhrubo-os
Copy link
Collaborator

fixing the text

updated docs

Description

[Describe what this change achieves]

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Dhrubo Saha <[email protected]>

fixing the text

updated docs

Signed-off-by: Dhrubo Saha <[email protected]>
@dhrubo-os dhrubo-os requested review from ylwu-amzn and rbhavna June 12, 2023 23:26
@codecov
Copy link

codecov bot commented Jun 12, 2023

Codecov Report

Merging #980 (9729151) into 2.x (e6dabc0) will decrease coverage by 0.06%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##                2.x     #980      +/-   ##
============================================
- Coverage     82.32%   82.26%   -0.06%     
+ Complexity     1918     1916       -2     
============================================
  Files           149      149              
  Lines          7506     7506              
  Branches        750      750              
============================================
- Hits           6179     6175       -4     
- Misses          987      990       +3     
- Partials        340      341       +1     
Flag Coverage Δ
ml-commons 82.26% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

We can also register model from URL. To do that we need to update the following cluster settings:

```
PUT _cluster/settings
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reformat this part by adding indent, also the response

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed.

"all_config": "{\"_name_or_path\":\"nreimers/MiniLM-L6-H384-uncased\",\"architectures\":[\"BertModel\"],\"attention_probs_dropout_prob\":0.1,\"gradient_checkpointing\":false,\"hidden_act\":\"gelu\",\"hidden_dropout_prob\":0.1,\"hidden_size\":384,\"initializer_range\":0.02,\"intermediate_size\":1536,\"layer_norm_eps\":1e-12,\"max_position_embeddings\":512,\"model_type\":\"bert\",\"num_attention_heads\":12,\"num_hidden_layers\":6,\"pad_token_id\":0,\"position_embedding_type\":\"absolute\",\"transformers_version\":\"4.8.2\",\"type_vocab_size\":2,\"use_cache\":true,\"vocab_size\":30522}"
},
"model_group_id": "7IjOsYgBFp6IJxCceZ1-"
"url": "https://github.com/opensearch-project/ml-commons/raw/2.x/ml-algorithms/src/test/resources/org/opensearch/ml/engine/algorithms/text_embedding/all-MiniLM-L6-v2_torchscript_sentence-transformer.zip?raw=true"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use this github url , this is in our code, we may change this anytime. Suggest change to model repo URL

I tried this , it can work.

PUT _cluster/settings
{
  "persistent": {
    "plugins.ml_commons.allow_registering_model_via_url": true
  }
}

POST /_plugins/_ml/models/_register
{
	"name": "sentence-transformers/all-MiniLM-L6-v2",
	"model_group_id": "JJUhsogBJU22rYFeKH5L",
	"description": "This is a sentence-transformers model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search.",
	"model_task_type": "TEXT_EMBEDDING",
	"model_format": "TORCH_SCRIPT",
	"model_content_hash_value": "c15f0d2e62d872be5b5bc6c84d2e0f4921541e29fefbef51d59cc10a8ae30e0f",
	"model_config": {
		"model_type": "bert",
		"embedding_dimension": 384,
		"framework_type": "sentence_transformers",
		"all_config": "{\"_name_or_path\":\"nreimers/MiniLM-L6-H384-uncased\",\"architectures\":[\"BertModel\"],\"attention_probs_dropout_prob\":0.1,\"gradient_checkpointing\":false,\"hidden_act\":\"gelu\",\"hidden_dropout_prob\":0.1,\"hidden_size\":384,\"initializer_range\":0.02,\"intermediate_size\":1536,\"layer_norm_eps\":1e-12,\"max_position_embeddings\":512,\"model_type\":\"bert\",\"num_attention_heads\":12,\"num_hidden_layers\":6,\"pad_token_id\":0,\"position_embedding_type\":\"absolute\",\"transformers_version\":\"4.8.2\",\"type_vocab_size\":2,\"use_cache\":true,\"vocab_size\":30522}"
	},
	"url": "https://artifacts.opensearch.org/models/ml-models/huggingface/sentence-transformers/all-MiniLM-L6-v2/1.0.1/torch_script/sentence-transformers_all-MiniLM-L6-v2-1.0.1-torch_script.zip"
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

Signed-off-by: Dhrubo Saha <[email protected]>
@dhrubo-os dhrubo-os merged commit 466d575 into opensearch-project:2.x Jun 20, 2023
zane-neo pushed a commit to zane-neo/ml-commons that referenced this pull request Aug 29, 2023
* updating docs for model group id

Signed-off-by: Dhrubo Saha <[email protected]>

fixing the text

updated docs

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

---------

Signed-off-by: Dhrubo Saha <[email protected]>
zane-neo added a commit that referenced this pull request Aug 29, 2023
* updating docs for model group id



fixing the text

updated docs



* addressing comments



---------

Signed-off-by: Dhrubo Saha <[email protected]>
Co-authored-by: Dhrubo Saha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants