Not able to Register the model even after following documentation

Versions (relevant - OpenSearch/Plugins/Machine Learning):

Describe the issue:
I am trying to load a pre-trained ML model in my opensearch. I am following these steps

1. Upload ML model

POST /_plugins/_ml/models/_upload

Body:

{
  "name": "huggingface/sentence-transformers/all-MiniLM-L6-v2",
  "version": "1.0.1",
  "model_format": "TORCH_SCRIPT"
}

Response:

{
    "task_id": "dkAg0IoBo4Hnb_CVX",
    "status": "CREATED"
}

2. Get Model status/ID with Task ID

GET /_plugins/_ml/tasks/<task_id>

Response:

{
    "model_id": "e0Au0IoBoHnbDCUc",
    "task_type": "REGISTER_MODEL",
    "function_name": "TEXT_EMBEDDING",
    "state": "COMPLETED",
    "worker_node": [
        "rsVhXDc2QHWMfAjxwOCefA"
    ],
    "create_time": 1695709792789,
    "last_update_time": 1695709802600,
    "is_async": true
}

Based on the task type now i am registering the model

3. Get Model Info by model ID

GET /_plugins/_ml/models/<model_id>

Response:

{
    "name": "huggingface/sentence-transformers/all-MiniLM-L6-v2",
    "model_group_id": "dUAg0IoBo4wA2Hnb-yXb",
    "algorithm": "TEXT_EMBEDDING",
    "model_version": "1",
    "model_format": "TORCH_SCRIPT",
    "model_state": "REGISTERED",
    "model_content_size_in_bytes": 91790008,
    "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}"
    },
    "created_time": 1695708937376,
    "last_updated_time": 1695708941453,
    "last_registered_time": 1695708941453,
    "total_chunks": 10
}

With the model info i got in response I am using it as a body in my register model API

4. Register Model by Model INFO

POST /_plugins/_ml/models/_register

Body:

{
    "name": "huggingface/sentence-transformers/all-MiniLM-L6-v2",
    "model_group_id": "dUAg0IoBo4wA2Hnb-yXb",
    "algorithm": "TEXT_EMBEDDING",
    "model_version": "1",
    "model_format": "TORCH_SCRIPT",
    "model_state": "REGISTERED",
    "model_content_size_in_bytes": 91790008,
    "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}"
    },
    "created_time": 1695708937376,
    "last_updated_time": 1695708941453,
    "last_registered_time": 1695708941453,
    "total_chunks": 10
}

Response:

{
    "task_id": "fEAz0IoBo4nbNCUM",
    "status": "CREATED"
}

Now with this task_id when i am checking the status or trying to get the model_id with this task_id then in response I am getting state as “FAILED”

5. Get model status/ID with task_id

GET /_plugins/_ml/tasks/<task_id>

Response:

{
    "task_type": "REGISTER_MODEL",
    "function_name": "TEXT_EMBEDDING",
    "state": "FAILED",
    "worker_node": [
        "rsVhXDc2QHWMfAjxwOCefA"
    ],
    "create_time": 1695710131211,
    "last_update_time": 1695710131226,
    "error": "Model group not found",
    "is_async": true
}

Relevant Logs or Screenshots:

Screenshot 2023-09-26 at 12.08.17 PM

Please provide necessary feedback or the extra step which i need to follow or where i am going wrong so that i can troubleshoot this issue and move forward with my work.

Thank you.

Why do you need to register again after Step 3?

You model is already registered. After registering model you can deploy your model with the _deploy api and then you can generate embedding using _predict api.

To register a model, you need to provide a torchscript/onnx file which you didn’t provide in your 4th Step: API - OpenSearch documentation

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.