# Register HuggingFaceModel on AWS and deploy

**URL:** <https://discuss.huggingface.co/t/register-huggingfacemodel-on-aws-and-deploy/59836>\
**Category:** Beginners\
**Created:** [October 25, 2023, 9:56am UTC](https://discuss.huggingface.co/t/register-huggingfacemodel-on-aws-and-deploy/59836 "2023-10-25T09:56:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sajozsattila](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@sajozsattila](https://discuss.huggingface.co/u/sajozsattila)\
**Post date:** [October 25, 2023, 9:56am UTC](https://discuss.huggingface.co/t/register-huggingfacemodel-on-aws-and-deploy/59836/1 "2023-10-25T09:56:08Z")

</div>

Hello!

I have a finetuned Falcon 7b model on AWS. I need to register this model in the Sagemaker Model Registry. After the registration, I need to load and deploy this registered model. I am wondering what is the correct way to do the above steps:

```auto

from sagemaker.huggingface import HuggingFaceModel

hub = {"HF_MODEL_ID": "tiiuae/falcon-7b", "HF_TASK": "text-generation"}

model = HuggingFaceModel(
    model_data=step_train.properties.ModelArtifacts.S3ModelArtifacts,
    env=hub,
    ...
)

step_model_registration = RegisterModel(
    model=model,
    content_type=["application/json"],
    response_type=["application/json"],
    approval_status="Approved"
)

```

After I run the sagemaker pipeline the model is registered. So I tried to deploy:

```auto
model_inf = sagemaker.ModelPackage(
    ...
)
model_inf.deploy(
   ...
)

```

Unfortunately, I hit the “set trust\_remote\_code to true” error when I would like to inference this model. Any suggestion?
