# Saving custom and/or finetuned models without the HUB

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsaving-custom-and-or-finetuned-models-without-the-hub%2F15225%3E%5C
**Category:** Beginners\
**Created:** [March 1, 2022, 1:43pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsaving-custom-and-or-finetuned-models-without-the-hub%2F15225 "2022-03-01T13:43:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![djs](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@djs](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdjs)%5C
**Post date:** [March 1, 2022, 1:43pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsaving-custom-and-or-finetuned-models-without-the-hub%2F15225%2F1 "2022-03-01T13:43:25Z")

</div>

Is there a way to save a custom and/or finetuned model without using the Huggingface Hub? I am unable to use the service at this time for security reasons. When I try to use the Keras or MLFlow native methods to save the model I run into errors associated with custom layers associated with the Huggingface implementation.

Thanks

---

<div class="post-metadata">

**Author:** ![LeonardBongard](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@LeonardBongard](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FLeonardBongard)%5C
**Post date:** [March 2, 2022, 10:17am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsaving-custom-and-or-finetuned-models-without-the-hub%2F15225%2F2 "2022-03-02T10:17:55Z")

</div>

Hey!  
if you are using the huggingface trainer you can simply save a model with the command

`trainer.save_model(<Path>)` where \<Path\> is the path as a string where you want to save your model.  
Maybe you should do the huggingface course to get more information ([Transformer models - Hugging Face Course](https://huggingface.co/course/chapter1/1)) 🙂

---

<div class="post-metadata">

**Author:** ![djs](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@djs](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdjs)%5C
**Post date:** [March 2, 2022, 3:08pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsaving-custom-and-or-finetuned-models-without-the-hub%2F15225%2F3 "2022-03-02T15:08:35Z")

</div>

Hello, I am currently trying to use the mode.save\_pretrained() method using TensorFlow although it doesn’t seem to be working - is this equivalent to the save\_model() method with the trainer?

---

<div class="post-metadata">

**Author:** ![LeonardBongard](https://avatars.discourse-cdn.com/v4/letter/l/f9ae1b/32.png) [@LeonardBongard](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FLeonardBongard)%5C
**Post date:** [March 2, 2022, 4:59pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fsaving-custom-and-or-finetuned-models-without-the-hub%2F15225%2F4 "2022-03-02T16:59:02Z")

</div>

if you have loaded the model via the transformer library and trained the model with the Trainer API then yes it is the equivalent 🙂
