Rewrite push_to_hub to use upload_files (#18366)
* Rewrite push_to_hub to use upload_files * Adapt the doc a bit * Address review comments and clean doc
This commit is contained in:
@@ -179,10 +179,10 @@ This creates a repository under your username with the model name `my-awesome-mo
|
||||
>>> model = AutoModel.from_pretrained("your_username/my-awesome-model")
|
||||
```
|
||||
|
||||
If you belong to an organization and want to push your model under the organization name instead, add the `organization` parameter:
|
||||
If you belong to an organization and want to push your model under the organization name instead, just add it to the `repo_id`:
|
||||
|
||||
```py
|
||||
>>> pt_model.push_to_hub("my-awesome-model", organization="my-awesome-org")
|
||||
>>> pt_model.push_to_hub("my-awesome-org/my-awesome-model")
|
||||
```
|
||||
|
||||
The `push_to_hub` function can also be used to add other files to a model repository. For example, add a tokenizer to a model repository:
|
||||
|
||||
Reference in New Issue
Block a user