Gated Model problem in AWS

I have tried to deploy the Gated Model which is of 7b and 14 gb in size on ml.g5.2x large instance on sagemaker endpoint. I have the access to the model and I am using the same code available on huggingface for deployment on Amazon Sagemaker. But It results into UnexpectedStatusException and on checking the logs it was showing. It is an gated Repo. You must be authenticated to use it.