From 240cc6cbdc07fc1a7c103d71cfe38d5e60e489e4 Mon Sep 17 00:00:00 2001 From: Francesco Saverio Zuppichini Date: Fri, 18 Feb 2022 09:11:18 +0100 Subject: [PATCH] Adding a model, more doc for pushing to the hub (#15690) * doc for adding a model to the hub * run make style * resolved conversation * removed a line * removed ) * Update docs/source/add_new_model.mdx Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com> * Update docs/source/add_new_model.mdx Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * make style Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com> Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> --- docs/source/add_new_model.mdx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/source/add_new_model.mdx b/docs/source/add_new_model.mdx index 08d804c9e3..38e73d9b54 100644 --- a/docs/source/add_new_model.mdx +++ b/docs/source/add_new_model.mdx @@ -793,9 +793,19 @@ You have now finished the coding part, congratulation! 🎉 You are Awesome! **12. Upload the models to the model hub** In this final part, you should convert and upload all checkpoints to the model hub and add a model card for each -uploaded model checkpoint. You should work alongside the Hugging Face team here to decide on a fitting name for each +uploaded model checkpoint. You can get familiar with the hub functionalities by reading our [Model sharing and uploading Page](model_sharing). You should work alongside the Hugging Face team here to decide on a fitting name for each checkpoint and to get the required access rights to be able to upload the model under the author's organization of -*brand_new_bert*. +*brand_new_bert*. The `push_to_hub` method, present in all models in `transformers`, is a quick and efficient way to push your checkpoint to the hub. A little snippet is pasted below: + +```python +brand_new_bert.push_to_hub( + repo_path_or_name="brand_new_bert", + # Uncomment the following line to push to an organization + # organization="", + commit_message="Add model", + use_temp_dir=True, +) +``` It is worth spending some time to create fitting model cards for each checkpoint. The model cards should highlight the specific characteristics of this particular checkpoint, *e.g.* On which dataset was the checkpoint