# Register HuggingFaceModel on AWS and deploy

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fregister-huggingfacemodel-on-aws-and-deploy%2F59836%3E%5C
**Category:** Beginners\
**Created:** [October 25, 2023, 9:56am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fregister-huggingfacemodel-on-aws-and-deploy%2F59836 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsajozsattila)%5C
**Post date:** [October 25, 2023, 9:56am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fregister-huggingfacemodel-on-aws-and-deploy%2F59836%2F1 "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?
