# How to deploy a Hugging Face model that requires trust\_remote\_code=True

**URL:** <https://forum.opensearch.org/t/how-to-deploy-a-hugging-face-model-that-requires-trust-remote-code-true/19242>\
**Category:** OpenSearch Client Libraries\
**Tags:** opensearch-py\
**Created:** [May 7, 2024, 2:51pm UTC](https://forum.opensearch.org/t/how-to-deploy-a-hugging-face-model-that-requires-trust-remote-code-true/19242 "2024-05-07T14:51:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![malv007](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@malv007](https://forum.opensearch.org/u/malv007)\
**Post date:** [May 7, 2024, 2:51pm UTC](https://forum.opensearch.org/t/how-to-deploy-a-hugging-face-model-that-requires-trust-remote-code-true/19242/1 "2024-05-07T14:51:43Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
2.13

**Describe the issue** :  
We have followed this tutorial to deploy different Hugging Face models to OpenSearch without problems:  
Demo tracing model torchscript

We would like to use Jina AI’s embedding models in OpenSearch, but they require using the argument trust\_remote\_code=True when loading the model.  
[Trust remote code required](https://huggingface.co/jinaai/jina-embeddings-v2-base-en/discussions/30)

Is there a way to deploy to OpenSearch a Hugging Face model that requires the argument “trust\_remote\_code=True”?

**Configuration** :  
Docker installation with 3 nodes (2xdata+ML)

**Relevant Logs or Screenshots** :  
N/A

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [July 6, 2024, 2:51pm UTC](https://forum.opensearch.org/t/how-to-deploy-a-hugging-face-model-that-requires-trust-remote-code-true/19242/2 "2024-07-06T14:51:44Z")

</div>

Closed on July 6, 2024, 2:51pm UTC

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