ml-commons icon indicating copy to clipboard operation
ml-commons copied to clipboard

Fine tune error message for model content changed

Open ylwu-amzn opened this issue 2 years ago • 4 comments

When user upload model via URL and didn't provide model hash value, it will throw "model content changed" error, which is hard to understand. We should clearly tell user that model content has value not set.

POST /_plugins/_ml/models/_upload
{
  "name": "all-MiniLM-L6-v2",
  "version": "1.0.0",
  "description": "test model",
  "model_format": "TORCH_SCRIPT",
  "model_config": {
    "model_type": "bert",
    "embedding_dimension": 384,
    "framework_type": "sentence_transformers"
  },
  "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"
}

Task

{
  "task_type": "REGISTER_MODEL",
  "function_name": "TEXT_EMBEDDING",
  "state": "FAILED",
  "worker_node": [
    "_QJb--HRS2-7lfq5DCWMiQ"
  ],
  "create_time": 1693505198395,
  "last_update_time": 1693505199947,
  "error": "model content changed",
  "is_async": true
}

Need to calcuate sha256 first

shasum -a 256 all-MiniLM-L6-v2_torchscript_sentence-transformer.zip

Then upload

POST /_plugins/_ml/models/_register
{
    "name": "all-MiniLM-L6-v2",
    "version": "1.0.0",
    "description": "test model",
    "model_format": "TORCH_SCRIPT",
    "model_group_id": "FTNlQ4gBYW0Qyy5ZoxfR",
    "model_content_hash_value": "c15f0d2e62d872be5b5bc6c84d2e0f4921541e29fefbef51d59cc10a8ae30e0f",
    "model_config": {
        "model_type": "bert",
        "embedding_dimension": 384,
        "framework_type": "sentence_transformers"
    },
    "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"
}

ylwu-amzn avatar Nov 14 '23 19:11 ylwu-amzn

@ylwu-amzn can you assign me to this issue? Thank you

TrungBui59 avatar Nov 22 '23 11:11 TrungBui59

Sure, thanks @TrungBui59, assigned to you

ylwu-amzn avatar Nov 22 '23 16:11 ylwu-amzn

@TrungBui59 , any update ? We plan to fix this in 2.12, if you don't have enough bandwidth, will ask someone else to help.

ylwu-amzn avatar Jan 30 '24 19:01 ylwu-amzn

@ylwu-amzn sorry for the delayed response, I was having some personal issues, so I wasn't checking frequently, I am still working on it but it seems like others have posted a PR for this issue

TrungBui59 avatar Feb 13 '24 13:02 TrungBui59