# Unable to deploy the custom model in Opensearch

**URL:** <https://forum.opensearch.org/t/unable-to-deploy-the-custom-model-in-opensearch/23618>\
**Category:** OpenSearch\
**Created:** [March 3, 2025, 7:06am UTC](https://forum.opensearch.org/t/unable-to-deploy-the-custom-model-in-opensearch/23618 "2025-03-03T07:06:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamilselvi](https://avatars.discourse-cdn.com/v4/letter/t/76d3ee/32.png) [@Tamilselvi](https://forum.opensearch.org/u/Tamilselvi)\
**Post date:** [March 3, 2025, 7:06am UTC](https://forum.opensearch.org/t/unable-to-deploy-the-custom-model-in-opensearch/23618/1 "2025-03-03T07:06:49Z")

</div>

I am trying to upload the custom model. It is registered successfully, but during deployment, I am getting issue as below  
{  
“model\_id”: “jcyhWpUBiLYOqMKJU5V0”,  
“task\_type”: “DEPLOY\_MODEL”,  
“function\_name”: “TEXT\_EMBEDDING”,  
“state”: “FAILED”,  
“worker\_node”: [  
“kddpRYg9R9-Hj0GkixiUfw”,  
“Gtk83tuLSx-DrYN2I\_wx4w”,  
“tEhaPrkWTGy\_N210nfJBDA”  
],  
“create\_time”: 1740983965882,  
“last\_update\_time”: 1740983968556,  
“error”: “”“{“kddpRYg9R9-Hj0GkixiUfw”:“all-MiniLM-L6-v2.pt file not found in: /home/elastic/data/opensearch/os\_on\_9200/data/ml\_cache/models\_cache/models/jcyhWpUBiLYOqMKJU5V0/1/all-MiniLM-L6-v2”,“Gtk83tuLSx-DrYN2I\_wx4w”:“all-MiniLM-L6-v2.pt file not found in: /home/elastic/data/opensearch/os\_on\_9200/data/ml\_cache/models\_cache/models/jcyhWpUBiLYOqMKJU5V0/1/all-MiniLM-L6-v2”,“tEhaPrkWTGy\_N210nfJBDA”:“all-MiniLM-L6-v2.pt file not found in: /home/elastic/data/opensearch/os\_on\_9200/data/ml\_cache/models\_cache/models/jcyhWpUBiLYOqMKJU5V0/1/all-MiniLM-L6-v2”}”“”,  
“is\_async”: true  
}

I used zip file to upload the model.

# Initialize ML Commons client

ml\_client = MLCommonClient(client)

# Define local model paths

model\_path = “all-MiniLM-L6-v2\_torchscript\_sentence-transformer.zip” # Path to your model file  
model\_config\_path = “all-MiniLM-L6-v2\_torchscript.json” # Path to your config file

# Register model

model\_id\_file\_system = ml\_client.register\_model(model\_path, model\_config\_path, isVerbose=True)

---

<div class="post-metadata">

**Author:** ![Nagpraveen](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@Nagpraveen](https://forum.opensearch.org/u/Nagpraveen)\
**Post date:** [March 4, 2025, 12:25pm UTC](https://forum.opensearch.org/t/unable-to-deploy-the-custom-model-in-opensearch/23618/2 "2025-03-04T12:25:04Z")

</div>

> [@Tamilselvi](#):
>
> all-MiniLM-L6-v2

Mention the same name at all 3 places – your model, and in config.json for model name param and and even zip folder name – and try to deploy again via script.

---

<div class="post-metadata">

**Author:** ![Tamilselvi](https://avatars.discourse-cdn.com/v4/letter/t/76d3ee/32.png) [@Tamilselvi](https://forum.opensearch.org/u/Tamilselvi)\
**Post date:** [March 4, 2025, 2:56pm UTC](https://forum.opensearch.org/t/unable-to-deploy-the-custom-model-in-opensearch/23618/3 "2025-03-04T14:56:21Z")

</div>

Though I give same name for all 3 files, deployment failed

---

<div class="post-metadata">

**Author:** ![Nagpraveen](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@Nagpraveen](https://forum.opensearch.org/u/Nagpraveen)\
**Post date:** [March 5, 2025, 3:45am UTC](https://forum.opensearch.org/t/unable-to-deploy-the-custom-model-in-opensearch/23618/4 "2025-03-05T03:45:00Z")

</div>

Can you please help with what names exactly you gave at all 3 places? please describe with details.

---

<div class="post-metadata">

**Author:** ![Tamilselvi](https://avatars.discourse-cdn.com/v4/letter/t/76d3ee/32.png) [@Tamilselvi](https://forum.opensearch.org/u/Tamilselvi)\
**Post date:** [March 7, 2025, 7:22am UTC](https://forum.opensearch.org/t/unable-to-deploy-the-custom-model-in-opensearch/23618/5 "2025-03-07T07:22:01Z")

</div>

Hi, I can register the model, while deployment getting the issue as

“error”: “”“{“kddpRYg9R9-Hj0GkixiUfw”:”\nUnknown builtin op: aten::scaled\_dot\_product\_attention.\nHere are some suggestions: \n\taten::\_scaled\_dot\_product\_attention\n\nThe original call is:\n File "code/ **torch** /transformers/models/bert/modeling\_bert.py", line 217\n x1 = torch.view(\_52, [\_54, int(\_55), 16, 64])\n value\_layer = torch.permute(x1, [0, 2, 1, 3])\n attn\_output = torch.scaled\_dot\_product\_attention(query\_layer, key\_layer, value\_layer, attention\_mask)\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\<— HERE\n attn\_output0 = torch.transpose(attn\_output, 1, 2)\n input = torch.reshape(attn\_output0, [\_42, \_43, 1024])\n",“Gtk83tuLSx-DrYN2I\_wx4w”:“\nUnknown builtin op: aten::scaled\_dot\_product\_attention.\nHere are some suggestions: \n\taten::\_scaled\_dot\_product\_attention\n\nThe original call is:\n File "code/ **torch** /transformers/models/bert/modeling\_bert.py", line 217\n x1 = torch.view(\_52, [\_54, int(\_55), 16, 64])\n value\_layer = torch.permute(x1, [0, 2, 1, 3])\n attn\_output = torch.scaled\_dot\_product\_attention(query\_layer, key\_layer, value\_layer, attention\_mask)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \<— HERE\n attn\_output0 = torch.transpose(attn\_output, 1, 2)\n input = torch.reshape(attn\_output0, [\_42, \_43, 1024])\n”}“”",

I am using torch script format
