# Push\_to\_hub() from HuggingFaceEstimator in AWS Sagemaker

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpush-to-hub-from-huggingfaceestimator-in-aws-sagemaker%2F12512%3E%5C
**Category:** Amazon SageMaker\
**Created:** [December 3, 2021, 7:34pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpush-to-hub-from-huggingfaceestimator-in-aws-sagemaker%2F12512 "2021-12-03T19:34:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierreguillou](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/pierreguillou/32/19626_2.png) [@pierreguillou](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpierreguillou)%5C
**Post date:** [December 3, 2021, 7:34pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpush-to-hub-from-huggingfaceestimator-in-aws-sagemaker%2F12512%2F1 "2021-12-03T19:34:36Z")

</div>

Hi,

I guess there is an easy answer but I did not find it.

Use case: I did train a model in a HF Training DLC in AWS SageMaker through a `HuggingFaceEstimator.fit()`. Now, I would like to upload this trained model to the model hub of Hugging Face.

What is the equivalent code to the [model.push\_to\_hub()](https://huggingface.co/docs/transformers/master/main_classes/model#transformers.file_utils.PushToHubMixin.push_to_hub) for a HuggingFaceEstimator in AWS Sagemaker?

---

<div class="post-metadata">

**Author:** ![philschmid](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/philschmid/32/38022_2.png) [@philschmid](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fphilschmid)%5C
**Post date:** [December 6, 2021, 7:41am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpush-to-hub-from-huggingfaceestimator-in-aws-sagemaker%2F12512%2F2 "2021-12-06T07:41:04Z")

</div>

Hello,

If you want to push your model to the Hugging Face Hub you can do this directly inside the `train.py` as shown here: [notebooks/sagemaker/14\_train\_and\_push\_to\_hub at master · huggingface/notebooks · GitHub](https://github.com/huggingface/notebooks/tree/master/sagemaker/14_train_and_push_to_hub)  
or you need to download the `model.tar.gz` and push it to hub afterwards [Documentation](https://huggingface.co/docs/hub/adding-a-model). There is currently no method inside the `sagemaker-sdk` to push models to the hub after training.
