Repository: huggingface/huggingface_hub
Pull request #731 (2022-03-02 13:59:28)

DOC API docstring improvements
This PR improves the docstrings for a few functions under `huggingface_hub`.

adrinjalali: Hope this looks better. If there aren't anything I've missed @LysandreJik please feel free to merge :) 

Patch:
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..3f0d7d67
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,129 @@
+
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, religion, or sexual identity
+and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our
+community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+  and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the
+  overall community
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or
+  advances of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or email
+  address, without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+  professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the community leaders responsible for enforcement at
+feedback@huggingface.co.
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series
+of actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or
+permanent ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior,  harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within
+the community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.0, available at
+https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
+
+Community Impact Guidelines were inspired by [Mozilla's code of conduct
+enforcement ladder](https://github.com/mozilla/diversity).
+
+[homepage]: https://www.contributor-covenant.org
+
+For answers to common questions about this code of conduct, see the FAQ at
+https://www.contributor-covenant.org/faq. Translations are available at
+https://www.contributor-covenant.org/translations.
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..18f1bd3e
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,299 @@
+<!---
+Copyright 2020 The HuggingFace Team. All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# How to contribute to huggingface_hub, the GitHub repository?
+
+Everyone is welcome to contribute, and we value everybody's contribution. Code
+is thus not the only way to help the community. Answering questions, helping
+others, reaching out and improving the documentations are immensely valuable to
+the community.
+
+It also helps us if you spread the word: reference the library from blog posts
+on the awesome projects it made possible, shout out on Twitter every time it has
+helped you, or simply star the repo to say "thank you".
+
+Whichever way you choose to contribute, please be mindful to respect our
+[code of conduct](https://github.com/huggingface/huggingface_hub/blob/master/CODE_OF_CONDUCT.md).
+
+## You can contribute in so many ways!
+
+The repository is split into different parts, where we welcome contributions.
+
+What can you find in this repo?
+
+* [`huggingface_hub`](https://github.com/huggingface/huggingface_hub/tree/main/src/huggingface_hub), a client library to download and publish on the Hugging Face Hub as well as extracting useful information from there.
+* [`api-inference-community`](https://github.com/huggingface/huggingface_hub/tree/main/api-inference-community), the Inference API for open source machine learning libraries.
+* [`js`](https://github.com/huggingface/huggingface_hub/tree/main/js), the open sourced widgets that allow people to try out the models in the browser.
+  * [`interfaces`](https://github.com/huggingface/huggingface_hub/tree/main/js/src/lib/interfaces), Typescript definition files for the Hugging Face Hub.
+* [`docs`](https://github.com/huggingface/huggingface_hub/tree/main/docs), containing the official [Hugging Face Hub documentation](https://hf.co/docs).
+
+
+### The client library, `huggingface_hub`
+
+This repository hosts the client library `huggingface_hub`, which is a frontend to the Hugging Face Hub.
+this part lives in `src/huggingface_hub` and `tests`.
+
+There are many ways you can contribute to this client library:
+* Fixing outstanding issues with the existing code;
+* Contributing to the examples or to the documentation;
+* Submitting issues related to bugs or desired new features.
+
+### The community inference API
+
+The `api-inference-community` folder contains a tool to enable third-party library support integrated with the Hugging
+Face Hub.
+
+We welcome contributions to [add new containers](https://huggingface.co/docs/hub/adding-a-library#set-up-the-inference-api) for new libraries, to update the existing ones, and to provide help
+fixing bugs and adding features. This folder contains an additional README
+file explaining how you may test your code.
+
+## JavaScript content
+
+The `js` folder contains the JavaScript code of the Hub. It includes:
+* The widgets ([code](https://github.com/huggingface/huggingface_hub/tree/main/js/src/lib/components/InferenceWidget)
+* Code snippets to make inference calls ([code](https://github.com/huggingface/huggingface_hub/tree/main/js/src/lib/inferenceSnippets)
+* Code snippets to load models ([code](https://github.com/huggingface/huggingface_hub/blob/main/js/src/lib/interfaces/Libraries.ts))
+
+Here too, we welcome any logic and documentation contributions. This folder contains an additional README
+file explaining how you may test your code.
+
+## Documentation
+
+The content in the `docs` folder is the official [Hugging Face Hub documentation]. It is not limited to the 
+Python package `huggingface_hub`, as it includes guides on using the frontend, ho to build Spaces, how to search
+efficiently, and others.
+
+Here too, we welcome contribution, may it be for syntactic changes or typos.
+
+*All contributions are equally valuable to the community.*
+
+## Submitting a new issue or feature request
+
+Do your best to follow these guidelines when submitting an issue or a feature
+request. It will make it easier for us to come back to you quickly and with good
+feedback.
+
+### Did you find a bug?
+
+The 🤗 Hugging Face Hub library is robust and reliable thanks to the users who notify us of
+the problems they encounter. So thank you for reporting an issue.
+
+First, we would really appreciate it if you could **make sure the bug was not
+already reported** (use the search bar on Github under Issues).
+
+Did not find it? :( So we can act quickly on it, please follow these steps:
+
+* Include your **OS type and version**, the versions of **Python**, **PyTorch** and
+  **Tensorflow** when applicable;
+* A short, self-contained, code snippet that allows us to reproduce the bug in
+  less than 30s;
+* Provide the *full* traceback if an exception is raised by copying the text from your terminal 
+  in the issue description.
+
+### Do you want a new feature?
+
+A good feature request addresses the following points:
+
+1. Motivation first:
+* Is it related to a problem/frustration with the library? If so, please explain
+  why and provide a code snippet that demonstrates the problem best.
+* Is it related to something you would need for a project? We'd love to hear
+  about it!
+* Is it something you worked on and think could benefit the community?
+  Awesome! Tell us what problem it solved for you.
+2. Write a *full paragraph* describing the feature;
+3. Provide a **code snippet** that demonstrates its future use;
+4. In case this is related to a paper, please attach a link;
+5. Attach any additional information (drawings, screenshots, etc.) you think may help.
+
+If your issue is well written we're already 80% of the way there by the time you
+post it.
+
+## Submitting a pull request (PR)
+
+Before writing code, we strongly advise you to search through the existing PRs or
+issues to make sure that nobody is already working on the same thing. If you are
+unsure, it is always a good idea to open an issue to get some feedback.
+
+You will need basic `git` proficiency to be able to contribute to
+`huggingface_hub`. `git` is not the easiest tool to use but it has the greatest
+manual. Type `git --help` in a shell and enjoy. If you prefer books, [Pro
+Git](https://git-scm.com/book/en/v2) is a very good reference.
+
+Follow these steps to start contributing:
+
+1. Fork the [repository](https://github.com/huggingface/huggingface_hub) by
+   clicking on the 'Fork' button on the repository's page. This creates a copy of the code
+   under your GitHub user account.
+
+2. Clone your fork to your local disk, and add the base repository as a remote. The following command
+   assumes you have your public SSH key uploaded to GitHub. See the following guide for more
+   [information](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository).
+
+   ```bash
+   $ git clone git@github.com:<your Github handle>/huggingface_hub.git
+   $ cd huggingface_hub
+   $ git remote add upstream https://github.com/huggingface/huggingface_hub.git
+   ```
+
+3. Create a new branch to hold your development changes, and do this for every new PR you work on.
+
+   Start by synchronizing your `main` branch with the `upstream/main` branch (ore details in the [GitHub Docs](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork)):
+
+   ```bash
+   $ git checkout main
+   $ git fetch upstream
+   $ git merge upstream/main
+   ```
+
+   Once your `main` branch is synchronized, create a new branch from it:
+
+   ```bash
+   $ git checkout -b a-descriptive-name-for-my-changes
+   ```
+
+   **Do not** work on the `master` branch.
+
+4. Set up a development environment by running the following command in a virtual environment a conda or a 
+   virtual environment you've created for working on this library:
+
+   ```bash
+   $ pip install -e ".[dev]"
+   ```
+
+   (If huggingface_hub was already installed in the virtual environment, remove
+   it with `pip uninstall huggingface_hub` before reinstalling it in editable
+   mode with the `-e` flag.)
+
+5. Develop the features on your branch.
+
+   As you work on the features, you should make sure that the test suite
+   passes. You should run the tests impacted by your changes like this (see 
+   below an explanation regarding the environment variable):
+
+   ```bash
+   $ HUGGINGFACE_CO_STAGING=1 pytest tests/<TEST_TO_RUN>.py
+   ```
+   
+   > For the following commands leveraging the `make` utility, we recommend using the WSL system when running on
+   > Windows. More information [here](https://docs.microsoft.com/en-us/windows/wsl/about).
+
+   You can also run the full suite with the following command.
+
+   ```bash
+   $ make test
+   ```
+
+   `hugginface_hub` relies on `black` and `isort` to format its source code
+   consistently. After you make changes, apply automatic style corrections and code verifications
+   that can't be automated:
+
+   ```bash
+   $ make style
+   ```
+
+   `huggingface_hub` also uses `flake8` and a few custom scripts to check for coding mistakes. Quality
+   control runs in CI, however you can also run the same checks with:
+
+   ```bash
+   $ make quality
+   ```
+
+   Once you're happy with your changes, add changed files using `git add` and
+   make a commit with `git commit` to record your changes locally:
+
+   ```bash
+   $ git add modified_file.py
+   $ git commit
+   ```
+
+   Please write [good commit messages](https://chris.beams.io/posts/git-commit/).
+
+   It is a good idea to sync your copy of the code with the original
+   repository regularly. The following document covers it in length: [github documentation](
+   https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork)
+ 
+   And here's how you can do it quickly from your `git` commandline:
+
+   ```bash
+   $ git fetch upstream
+   $ git rebase upstream/master
+   ```
+
+   Push the changes to your account using:
+
+   ```bash
+   $ git push -u origin a-descriptive-name-for-my-changes
+   ```
+
+7. Once you are satisfied (**and the checklist below is happy too**), go to the
+   webpage of your fork on GitHub. Click on 'Pull request' to send your changes
+   to the project maintainers for review.
+
+8. It's ok if maintainers ask you for changes. It happens to core contributors
+   too! So everyone can see the changes in the Pull request, work in your local
+   branch and push the changes to your fork. They will automatically appear in
+   the pull request.
+
+
+### Checklist
+
+1. The title of your pull request should be a summary of its contribution;
+2. If your pull request addresses an issue, please mention the issue number in
+   the pull request description to make sure they are linked (and people
+   consulting the issue know you are working on it);
+3. To indicate a work in progress please prefix the title with `[WIP]`, or mark 
+   the PR as a draft PR. These are useful to avoid duplicated work, and to differentiate 
+   it from PRs ready to be merged;
+4. Make sure existing tests pass;
+5. Add high-coverage tests. No quality testing = no merge.
+6. Due to the rapidly growing repository, it is important to make sure that no files that would significantly weigh down the repository are added. This includes images, videos and other non-text files. We prefer to leverage a hf.co hosted `dataset` like
+   the ones hosted on [`hf-internal-testing`](https://huggingface.co/hf-internal-testing) in which to place these files and reference
+   them by URL. We recommend putting them in the following dataset: [huggingface/documentation-images](https://huggingface.co/datasets/huggingface/documentation-images).
+   If an external contribution, feel free to add the images to your PR and ask a Hugging Face member to migrate your images
+   to this dataset.
+
+### Tests
+
+An extensive test suite is included to test the library behavior and several examples. Library tests can be found in
+the [tests folder](https://github.com/huggingface/huggingface_hub/tree/main/tests).
+
+The `huggingface_hub` library's normal behavior is to work with the production Hugging Face Hub. However,
+for tests, we prefer to run on a staging version. In order to do this, it's important to set the 
+`HUGGINGFACE_CO_STAGING` environment variable to `1` when running tests. It is preferred to pass this in when running the tests, than setting a permanent environmental variable, as shown below.
+
+We use `pytest` in order to run the tests for the library . From the root of the
+repository they can be run with the following:
+
+```bash
+$ HUGGINGFACE_CO_STAGING=1 python -m pytest -sv ./tests
+
+In fact, that's how `make test` is implemented (sans the `pip install` line)!
+
+You can specify a smaller set of tests in order to test only the feature
+you're working on.
+
+For example, the following will only run the tests hel in the `test_repository.py` file:
+
+```bash
+$ HUGGINGFACE_CO_STAGING=1 python -m pytest -sv ./tests/test_repository.py
+```
+
+And the following will only run the tests that include `tag` in their name:
+
+```bash
+$ HUGGINGFACE_CO_STAGING=1 python -m pytest -sv ./tests -k tag
+```
diff --git a/Makefile b/Makefile
index 99edd4c2..4d6ac076 100644
--- a/Makefile
+++ b/Makefile
@@ -14,5 +14,5 @@ style:
 	isort $(check_dirs)
 
 test:
-	pytest -sv ./tests/
+	HUGGINGFACE_CO_STAGING=1 pytest -sv ./tests/
 
diff --git a/docs/hub/adding-a-library.md b/docs/hub/adding-a-library.md
index d21b299c..92684ca0 100644
--- a/docs/hub/adding-a-library.md
+++ b/docs/hub/adding-a-library.md
@@ -115,7 +115,7 @@ The `create_repo` method creates a repository on the Hub. Use the `name` paramet
 
 ```python
 >>> from huggingface_hub import create_repo
->>> create_repo(name="test-model")
+>>> create_repo(repo_id="test-model")
 'https://huggingface.co/lysandre/test-model'
 ```
 
diff --git a/docs/hub/adding-a-model.md b/docs/hub/adding-a-model.md
index 62c342bc..d82d6883 100644
--- a/docs/hub/adding-a-model.md
+++ b/docs/hub/adding-a-model.md
@@ -215,8 +215,7 @@ First we need to instantiate the `HfApi` class, which holds all of the magic:
 Afterwards we can run the `create_repo` function, specifying a number of settings and options for our new repository:
 ```python
 >>> api.create_repo(
->>>   name = "dummy", # The name of our repository
->>>   organization = None, # The namespace of the expected repository. Automatically grabs your logged-in profile name
+>>>   repo_id = "dummy", # The name of our repository, by default under your user
 >>>   private = False, # Whether the repo should be public or private
 >>>   repo_type = "model" # The type of repository, such as "model", "space", "dataset"
 >>> )
diff --git a/docs/hub/endpoints.md b/docs/hub/endpoints.md
index 2b315749..960eca45 100644
--- a/docs/hub/endpoints.md
+++ b/docs/hub/endpoints.md
@@ -21,8 +21,8 @@ We have open endpoints that you can use to retrieve information from the Hub as
 | /api/spaces     GET                                                          	| Get information from all Spaces in the Hub. You can specify additional parameters to have more specific results.   - `search`: Filter based on substrings for repos and their usernames, such as `resnet` or `microsoft` - `author`: Filter models by an author or organization, such as `huggingface` or `microsoft` - `filter`: Filter based on tags, such as `text-classification` or `spacy`. - `sort`: Property to use when sorting, such as `downloads` or `author`.  - `direction`: Direction in which to sort, such as `-1` for descending, and anything else for ascending. - `limit`: Limit the number of models fetched.  - `full`: Whether to fetch most model data, such as all tags, the files, etc.  - `config`: Whether to also fetch the repo config. 	| `list_models()`                   	| ```params= {   "search":"search", "author":"author", "filter":"filter", "sort":"sort", "direction":"direction", "limit":"limit", "full":"full", "config":"config"}``` 	|   	|
 | /api/spaces/{repo_id}   /api/spaces/{repo_id}/revision/{revision}    GET     	| Get all information for a specific model.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              	| `model_info(repo_id, revision)`   	| ```headers = { "authorization" :  "Bearer $token" }```                                                                                                                	|   	|
 | /api/metrics     GET                                                         	| Get information from all metrics in the Hub.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           	| `list_metrics()`                  	|                                                                                                                                                                       	|   	|
-| /api/repos/create     POST                                                   	| Create a repository. It's a model repo by default.   -         type: Type of repo (datasets or spaces; model by default).   - name: Name of repo.   - organization: Name of organization. -   - private: Whether the repo is private.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  	| `create_repo()`                   	| ```headers = { authorization :  "Bearer $token" }```  ```json= {"type":"type", "name":"name", "organization":"organization", "private":"private"}```                  	|   	|
-| /api/repos/delete    DELETE                                                  	| Delete a repository. It's a model repo by default.   -         type: Type of repo (datasets or spaces; model by default).   - name: Name of repo.   - organization: Name of organization.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              	| `delete_repo()`                   	| ```headers = { "authorization" :  "Bearer $token" }```  ```json= {"type":"type", "name":"name", "organization":"organization"}```                                     	|   	|
+| /api/repos/create     POST                                                   	| Create a repository. It's a model repo by default.   -         type: Type of repo (datasets or spaces; model by default).   - name: Name of repo.   - organization: Name of organization. -   - private: Whether the repo is private.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  	| `create_repo()`                   	| ```headers = { authorization :  "Bearer $token" }```  ```json= {"type":"type", "repo_id":"repo_id", "private":"private"}```                  	|   	|
+| /api/repos/delete    DELETE                                                  	| Delete a repository. It's a model repo by default.   -         type: Type of repo (datasets or spaces; model by default).   - name: Name of repo.   - organization: Name of organization.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              	| `delete_repo()`                   	| ```headers = { "authorization" :  "Bearer $token" }```  ```json= {"type":"type", "repo_id":"repo_id"}```                                     	|   	|
 | /api/repos/{type}/{repo_id}/settings   PUT                                   	| Update repo visibility.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	| `update_repo_visibility()`        	| ```headers = { "authorization" :  "Bearer $token" }```  ```json= {"private":"private"}```                                                                             	|   	|
 | /api/repos/move POST                                                         	| Move a repository (rename within same namespace or transfer from user to organization).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 	| `move_repo()`                     	| ```headers = { "authorization" :  "Bearer $token" }```    ```json= {"fromRepo" : "namespace/repo_name", "toRepo" : "namespace2/repo_name2"}```                        	|   	|
 | /api/{type}/{repo_id}/upload/{revision}/{path_in_repo}    POST               	| Upload a file to a specific repository.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                	| `upload_file()`                   	| ```headers = { "authorization" :  "Bearer $token" }```  ```"data"="bytestream"```                                                                                     	|   	|
diff --git a/docs/hub/how-to-upstream.md b/docs/hub/how-to-upstream.md
index 965919ad..c9a6d883 100644
--- a/docs/hub/how-to-upstream.md
+++ b/docs/hub/how-to-upstream.md
@@ -89,13 +89,13 @@ Pass the full repository ID to `delete_repo`. The full repository ID looks like
 ```python
 >>> from huggingface_hub import get_full_repo_name, delete_repo
 >>> name = get_full_repo_name(repo_name)
->>> delete_repo(name=name)
+>>> delete_repo(repo_id=name)
 ```
 
 Delete a dataset repository by adding the `repo_type` parameter:
 
 ```python
->>> delete_repo(name=REPO_NAME, repo_type="dataset")
+>>> delete_repo(repo_id=REPO_NAME, repo_type="dataset")
 ```
 
 ### Change repository visibility
@@ -128,7 +128,7 @@ The `clone_from` parameter clones a repository from a Hugging Face model ID to a
 Easily combine the `clone_from` parameter with `create_repo` to create and clone a repository:
 
 ```python
->>> repo_url = create_repo(name="repo_name")
+>>> repo_url = create_repo(repo_id="repo_name")
 >>> repo = Repository(local_dir="repo_local_path", clone_from=repo_url)
 ```
 
diff --git a/docs/hub/libraries.md b/docs/hub/libraries.md
index 237eee18..f828e0d5 100644
--- a/docs/hub/libraries.md
+++ b/docs/hub/libraries.md
@@ -17,6 +17,7 @@ The table below summarizes the supported libraries and how they are integrated.
 | [Adapter Transformers](https://github.com/Adapter-Hub/adapter-transformers)  | Extends 🤗Transformers with Adapters.                                          |       ❌       | ❌      |         ✅         |      ✅      |
 | [AllenNLP](https://github.com/allenai/allennlp)              | An open-source NLP research library, built on PyTorch.                        |       ✅       |    ✅   |         ✅         |      ❌      |
 | [Asteroid](https://github.com/asteroid-team/asteroid)              | Pytorch-based audio source separation toolkit                                 |       ✅       | ✅     |         ✅         |      ❌      |
+| [docTR](https://github.com/mindee/doctr) | Models and datasets for OCR-related tasks in PyTorch & TensorFlow | ✅ | ✅ | ✅ | ❌ |
 | [ESPnet](https://github.com/espnet/espnet)                | End-to-end speech processing toolkit (e.g. TTS)                               |       ✅       | ✅      |         ✅         |      ❌      |
 | [Flair](https://github.com/flairNLP/flair)                 | Very simple framework for state-of-the-art NLP. |       ✅       |    ✅   |         ✅         |      ❌      |
 | [Pyannote](https://github.com/pyannote/pyannote-audio)              | Neural building blocks for speaker diarization.                               |       ❌       |    ❌   |         ✅         |      ❌      |
diff --git a/docs/hub/org-cards.md b/docs/hub/org-cards.md
index c1aab884..1c0c295e 100644
--- a/docs/hub/org-cards.md
+++ b/docs/hub/org-cards.md
@@ -11,7 +11,7 @@ On your profile, an org card looks like this:
 ![/docs/assets/hub/org-card.png](/docs/assets/hub/org-card.png)
 
 
-**By convention, they take the form of a `README.md` static file, inside a Space repo named `README`.**
+**By convention, they take the form of a `README.md` static file, inside a Space repo named `README`.** The org card can be as simple as Markdown text or you can create a more customized appearance with HTML.
 
 As an example, take a look at:
 
diff --git a/docs/hub/spaces.md b/docs/hub/spaces.md
index c2df98f2..f39f9adb 100644
--- a/docs/hub/spaces.md
+++ b/docs/hub/spaces.md
@@ -28,7 +28,7 @@ Each Spaces environment is limited to 16GB RAM and 8 CPU cores. Organization [su
 
 ## Streamlit and Gradio
 
-Spaces support [Streamlit](https://streamlit.io/) and [Gradio](https://gradio.app/) for quickly building apps in Python. The default environment runs version `"1.0.0"` of Streamlit and the latest version of Gradio. We recommend you try both because they're really awesome! Here are some of our thoughts on Streamlit and Gradio:
+Spaces support [Streamlit](https://streamlit.io/) and [Gradio](https://gradio.app/) for quickly building apps in Python. The default environment runs the latest version of Streamlit and Gradio at the time the Space repo is created. We recommend you try both because they're really awesome! Here are some of our thoughts on Streamlit and Gradio:
 
 * **Gradio** provides an easy and intuitive interface for running a model from a list of inputs, and displaying the outputs. For more details, take a look at this [tutorial](https://huggingface.co/blog/gradio) from the Gradio team about building GUIs for Hugging Face models.
 
@@ -195,8 +195,9 @@ Any valid Python `3.x` or `3.x.x` version.
 Defaults to `3.8.9`.
 
 **`sdk_version`** : _string_
-Only applicable for `streamlit` SDK. Currently available versions are :  
-`0.79.0, 0.80.0, 0.81.1, 0.82.0, 0.83.0, 0.84.2, 0.85.0, 0.86.0, 0.87.0, 0.88.0, 0.89.0, 1.0.0, 1.1.0, 1.2.0`.
+Specify the version of the selected SDK (Streamlit or Gradio).
+All versions of Gradio are supported.
+Streamlit versions are supported from `0.79.0` to `1.2.0`.
 
 **`app_file`** : _string_
 Path to your main application file (which contains either `gradio` or `streamlit` Python code, or `static` html code).
diff --git a/docs/hub/tutorial-add-library.md b/docs/hub/tutorial-add-library.md
index c2bb0e6d..af9f3ed2 100644
--- a/docs/hub/tutorial-add-library.md
+++ b/docs/hub/tutorial-add-library.md
@@ -115,7 +115,7 @@ The `create_repo` method creates a repository on the Hub. Use the `name` paramet
 
 ```python
 >>> from huggingface_hub import create_repo
->>> create_repo(name="test-model")
+>>> create_repo(repo_id="test-model")
 'https://huggingface.co/lysandre/test-model'
 ```
 
diff --git a/js/src/lib/components/Dropdown/Dropdown.svelte b/js/src/lib/components/Dropdown/Dropdown.svelte
index dc44b56f..e00e4dd9 100644
--- a/js/src/lib/components/Dropdown/Dropdown.svelte
+++ b/js/src/lib/components/Dropdown/Dropdown.svelte
@@ -48,9 +48,9 @@
 				/>
 			{/if}
 			{btnLabel}
-			{#if withBtnCaret}
-				<IconCaretDown classNames="-mr-1 text-gray-500" />
-			{/if}
+		{/if}
+		{#if withBtnCaret}
+			<IconCaretDown classNames="-mr-1 text-gray-500" />
 		{/if}
 	</button>
 	<!-- /Button -->
diff --git a/src/huggingface_hub/commands/user.py b/src/huggingface_hub/commands/user.py
index 806176c3..2ef666a4 100644
--- a/src/huggingface_hub/commands/user.py
+++ b/src/huggingface_hub/commands/user.py
@@ -244,9 +244,11 @@ class RepoCreateCommand(BaseUserCommand):
             exit(1)
 
         if self.args.type in REPO_TYPES_URL_PREFIXES:
-            repo_id = REPO_TYPES_URL_PREFIXES[self.args.type] + repo_id
+            prefixed_repo_id = REPO_TYPES_URL_PREFIXES[self.args.type] + repo_id
+        else:
+            prefixed_repo_id = repo_id
 
-        print(f"You are about to create {ANSI.bold(repo_id)}")
+        print(f"You are about to create {ANSI.bold(prefixed_repo_id)}")
 
         if not self.args.yes:
             choice = input("Proceed? [Y/n] ").lower()
@@ -254,10 +256,10 @@ class RepoCreateCommand(BaseUserCommand):
                 print("Abort")
                 exit()
         try:
+
             url = self._api.create_repo(
-                self.args.name,
+                repo_id=repo_id,
                 token=token,
-                organization=self.args.organization,
                 repo_type=self.args.type,
                 space_sdk=self.args.space_sdk,
             )
diff --git a/src/huggingface_hub/file_download.py b/src/huggingface_hub/file_download.py
index 9b27903c..6317c740 100644
--- a/src/huggingface_hub/file_download.py
+++ b/src/huggingface_hub/file_download.py
@@ -112,20 +112,53 @@ def hf_hub_url(
     repo_type: Optional[str] = None,
     revision: Optional[str] = None,
 ) -> str:
-    """
-    Resolve a model identifier, a file name, and an optional revision id, to a huggingface.co-hosted url, redirecting
-    to Cloudfront (a Content Delivery Network, or CDN) for large files (more than a few MBs).
-
-    Cloudfront is replicated over the globe so downloads are way faster for the end user (and it also lowers our
-    bandwidth costs).
+    """Construct the URL of a file from the given information.
 
-    Cloudfront aggressively caches files by default (default TTL is 24 hours), however this is not an issue here
-    because we implement a git-based versioning system on huggingface.co, which means that we store the files on S3/Cloudfront
-    in a content-addressable way (i.e., the file name is its hash). Using content-addressable filenames means cache
-    can't ever be stale.
+    The resolved address can either be a huggingface.co-hosted url, or a link
+    to Cloudfront (a Content Delivery Network, or CDN) for large files which
+    are more than a few MBs.
 
-    In terms of client-side caching from this library, we base our caching on the objects' ETag. An object's ETag is:
-    its git-sha1 if stored in git, or its sha256 if stored in git-lfs.
+    Args:
+        repo_id (``str``):
+            A namespace (user or an organization) name and a repo name
+            seperated by a ``/``.
+        filename (``str``):
+            The name of the file in the repo.
+        subfolder (``str``, `optional`):
+            An optional value corresponding to a folder inside the repo.
+        repo_type (``str``, `optional`):
+            Set to :obj:`"dataset"` or :obj:`"space"` if uploading to a dataset
+            or space, :obj:`None` or :obj:`"model"` if uploading to a model.
+            Default is :obj:`None`.
+        revision (``str``, `optional`):
+            An optional Git revision id which can be a branch name, a tag, or a
+            commit hash.
+
+    Example:
+        >>> from huggingface_hub import hf_hub_url
+        >>> hf_hub_url(
+        ...    repo_id="julien-c/EsperBERTo-small", filename="pytorch_model.bin"
+        ... )
+        'https://huggingface.co/julien-c/EsperBERTo-small/resolve/main/pytorch_model.bin'
+
+    Notes:
+        Cloudfront is replicated over the globe so downloads are way faster for
+        the end user (and it also lowers our bandwidth costs).
+
+        Cloudfront aggressively caches files by default (default TTL is 24
+        hours), however this is not an issue here because we implement a
+        git-based versioning system on huggingface.co, which means that we
+        store the files on S3/Cloudfront in a content-addressable way (i.e.,
+        the file name is its hash). Using content-addressable filenames means
+        cache can't ever be stale.
+
+        In terms of client-side caching from this library, we base our caching
+        on the objects' entity tag (`ETag`), which is an identifier of a
+        specific version of a resource [1]_. An object's ETag is: its git-sha1
+        if stored in git, or its sha256 if stored in git-lfs.
+
+    References:
+        .. [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag
     """
     if subfolder is not None:
         filename = f"{subfolder}/{filename}"
@@ -144,11 +177,22 @@ def hf_hub_url(
 
 
 def url_to_filename(url: str, etag: Optional[str] = None) -> str:
-    """
-    Convert `url` into a hashed filename in a repeatable way. If `etag` is specified, append its hash to the url's,
-    delimited by a period. If the url ends with .h5 (Keras HDF5 weights) adds '.h5' to the name so that TF 2.0 can
-    identify it as a HDF5 file (see
+    """Generate a local filename from a url.
+
+    Convert `url` into a hashed filename in a reproducible way. If `etag` is
+    specified, append its hash to the url's, delimited by a period. If the url
+    ends with .h5 (Keras HDF5 weights) adds '.h5' to the name so that TF 2.0
+    can identify it as a HDF5 file (see
     https://github.com/tensorflow/tensorflow/blob/00fad90125b18b80fe054de1055770cfb8fe4ba3/tensorflow/python/keras/engine/network.py#L1380)
+
+    Args:
+        url (``str``):
+            The address to the file.
+        etag (``str``, `optional`):
+            The ETag of the file.
+
+    Returns:
+        The generated filename.
     """
     url_bytes = url.encode("utf-8")
     filename = sha256(url_bytes).hexdigest()
@@ -194,8 +238,18 @@ def http_user_agent(
     library_version: Optional[str] = None,
     user_agent: Union[Dict, str, None] = None,
 ) -> str:
-    """
-    Formats a user-agent string with basic info about a request.
+    """Formats a user-agent string with basic info about a request.
+
+    Args:
+        library_name (``str``, `optional`):
+            The name of the library to which the object corresponds.
+        library_version (``str``, `optional`):
+            The version of the library.
+        user_agent (``str``, ``dict``, `optional`):
+            The user agent info in the form of a dictionary or a single string.
+
+    Returns:
+        The formated user-agent string.
     """
     if library_name is not None:
         ua = f"{library_name}/{library_version}"
@@ -237,18 +291,30 @@ def _request_with_retry(
     timeout: float = 10.0,
     **params,
 ) -> requests.Response:
-    """Wrapper around requests to retry in case it fails with a ConnectTimeout, with exponential backoff.
+    """Wrapper around requests to retry in case it fails with a ``ConnectTimeout`` \
+        , with exponential backoff.
 
-    Note that if the environment variable HF_HUB_OFFLINE is set to 1, then a OfflineModeIsEnabled error is raised.
+    Note that if the environment variable HF_HUB_OFFLINE is set to 1, then a
+    ``OfflineModeIsEnabled`` error is raised.
 
     Args:
-        method (str): HTTP method, such as 'GET' or 'HEAD'
-        url (str): The URL of the ressource to fetch
-        max_retries (int): Maximum number of retries, defaults to 0 (no retries)
-        base_wait_time (float): Duration (in seconds) to wait before retrying the first time. Wait time between
-            retries then grows exponentially, capped by max_wait_time.
-        max_wait_time (float): Maximum amount of time between two retries, in seconds
-        **params: Params to pass to `requests.request`
+        method (``str``):
+            HTTP method, such as 'GET' or 'HEAD'.
+        url (``str``):
+            The URL of the ressource to fetch.
+        max_retries (``int``, `optional`, defaults to ``0``):
+            Maximum number of retries, defaults to 0 (no retries).
+        base_wait_time (``float``, `optional`, defaults to ``0.5``):
+            Duration (in seconds) to wait before retrying the first time. Wait
+            time between retries then grows exponentially, capped by
+            ``max_wait_time``.
+        max_wait_time (``float``, `optional`, defaults to ``2``):
+            Maximum amount of time between two retries, in seconds.
+        timeout (``float``, `optional`, defaults to ``10``):
+            How many seconds to wait for the server to send data before giving
+            up which is passed to ``requests.request``.
+        **params (``dict``, `optional`):
+            Params to pass to `requests.request`.
     """
     _raise_if_offline_mode_is_enabled(f"Tried to reach {url}")
     tries, success = 0, False
@@ -321,23 +387,66 @@ def cached_download(
     library_version: Optional[str] = None,
     cache_dir: Union[str, Path, None] = None,
     user_agent: Union[Dict, str, None] = None,
-    force_download=False,
+    force_download: Optional[bool] = False,
     force_filename: Optional[str] = None,
-    proxies=None,
-    etag_timeout=10,
-    resume_download=False,
+    proxies: Optional[Dict] = None,
+    etag_timeout: Optional[float] = 10,
+    resume_download: Optional[bool] = False,
     use_auth_token: Union[bool, str, None] = None,
-    local_files_only=False,
+    local_files_only: Optional[bool] = False,
 ) -> Optional[str]:  # pragma: no cover
-    """
-    Given a URL, look for the corresponding file in the local cache. If it's not there, download it. Then return the
-    path to the cached file.
+    """Download from a given URL and cache it if it's not already present in \
+        the local cache.
+
+    Given a URL, this function looks for the corresponding file in the local
+    cache. If it's not there, download it. Then return the path to the cached
+    file.
+
+    Args:
+        url (``str``):
+            The path to the file to be downloaded.
+        library_name (``str``, `optional`):
+            The name of the library to which the object corresponds.
+        library_version (``str``, `optional`):
+            The version of the library.
+        cache_dir (``str``, ``Path``, `optional`):
+            Path to the folder where cached files are stored.
+        user_agent (``dict``, ``str``, `optional`):
+            The user-agent info in the form of a dictionary or a string.
+        force_download (``bool``, `optional`, defaults to ``False``):
+            Whether the file should be downloaded even if it already exists in
+            the local cache.
+        force_filename (``str``, `optional`):
+            Use this name instead of a generated file name.
+        proxies (``dict``, `optional`):
+            Dictionary mapping protocol to the URL of the proxy passed to
+            ``requests.request``.
+        etag_timeout (``float``, `optional` defaults to ``10``):
+            When fetching ETag, how many seconds to wait for the server to send
+            data before giving up which is passed to ``requests.request``.
+        resume_download (``bool``, `optional`, defaults to ``False``):
+            If ``True``, resume a previously interrupted download.
+        use_auth_token (``bool``, ``str``, `optional`):
+            A token to be used for the download.
+                - If ``True``, the token is read from the HuggingFace config
+                  folder.
+                - If a string, it's used as the authentication token.
+        local_files_only (``bool``, `optional`, defaults to ``False``):
+            If ``True``, avoid downloading the file and return the path to the
+            local cached file if it exists.
 
     Return:
-        Local path (string) of file or if networking is off, last version of file cached on disk.
+        Local path (string) of file or if networking is off, last version of
+        file cached on disk.
 
     Raises:
-        In case of non-recoverable file (non-existent or inaccessible url + no cache on disk).
+        - ``EnvironmentError`` if ``use_auth_token=True`` and the token cannot
+            be found.
+
+        - ``OSError`` if ETag cannot be determined.
+
+        - ``ValueError`` if the file cannot be downloaded and cannot be found
+            locally.
     """
     if cache_dir is None:
         cache_dir = HUGGINGFACE_HUB_CACHE
@@ -521,36 +630,73 @@ def hf_hub_download(
     library_version: Optional[str] = None,
     cache_dir: Union[str, Path, None] = None,
     user_agent: Union[Dict, str, None] = None,
-    force_download=False,
+    force_download: Optional[bool] = False,
     force_filename: Optional[str] = None,
-    proxies=None,
-    etag_timeout=10,
-    resume_download=False,
+    proxies: Optional[Dict] = None,
+    etag_timeout: Optional[float] = 10,
+    resume_download: Optional[bool] = False,
     use_auth_token: Union[bool, str, None] = None,
-    local_files_only=False,
+    local_files_only: Optional[bool] = False,
 ):
-    """
-    Resolve a model identifier, a file name, and an optional revision id, to a huggingface.co file distributed through
-    Cloudfront (a Content Delivery Network, or CDN) for large files (more than a few MBs).
+    """Download a given file if it's not already present in the local cache.
 
-    The file is cached locally: look for the corresponding file in the local cache. If it's not there,
-    download it. Then return the path to the cached file.
-
-    Cloudfront is replicated over the globe so downloads are way faster for the end user.
-
-    Cloudfront aggressively caches files by default (default TTL is 24 hours), however this is not an issue here
-    because we implement a git-based versioning system on huggingface.co, which means that we store the files on S3/Cloudfront
-    in a content-addressable way (i.e., the file name is its hash). Using content-addressable filenames means cache
-    can't ever be stale.
-
-    In terms of client-side caching from this library, we base our caching on the objects' ETag. An object's ETag is:
-    its git-sha1 if stored in git, or its sha256 if stored in git-lfs.
+    Args:
+        repo_id (``str``):
+            A user or an organization name and a repo name seperated by a
+            ``/``.
+        filename (``str``):
+            The name of the file in the repo.
+        subfolder (``str``, `optional`):
+            An optional value corresponding to a folder inside the model repo.
+        repo_type (``str``, `optional`):
+            Set to :obj:`"dataset"` or :obj:`"space"` if uploading to a dataset
+            or space, :obj:`None` or :obj:`"model"` if uploading to a model.
+            Default is :obj:`None`.
+        revision (``str``, `optional`):
+            An optional Git revision id which can be a branch name, a tag, or a
+            commit hash.
+        library_name (``str``, `optional`):
+            The name of the library to which the object corresponds.
+        library_version (``str``, `optional`):
+            The version of the library.
+        cache_dir (``str``, ``Path``, `optional`):
+            Path to the folder where cached files are stored.
+        user_agent (``dict``, ``str``, `optional`):
+            The user-agent info in the form of a dictionary or a string.
+        force_download (``bool``, `optional`, defaults to ``False``):
+            Whether the file should be downloaded even if it already exists in
+            the local cache.
+        force_filename (``str``, `optional`):
+            Use this name instead of a generated file name.
+        proxies (``dict``, `optional`):
+            Dictionary mapping protocol to the URL of the proxy passed to
+            ``requests.request``.
+        etag_timeout (``float``, `optional`, defaults to ``10``):
+            When fetching ETag, how many seconds to wait for the server to send
+            data before giving up which is passed to ``requests.request``.
+        resume_download (``bool``, `optional`, defaults to ``False``):
+            If ``True``, resume a previously interrupted download.
+        use_auth_token (``str``, ``bool``, `optional`):
+            A token to be used for the download.
+                - If ``True``, the token is read from the HuggingFace config
+                  folder.
+                - If a string, it's used as the authentication token.
+        local_files_only (``bool``, `optional`, defaults to ``False``):
+            If ``True``, avoid downloading the file and return the path to the
+            local cached file if it exists.
 
     Return:
-        Local path (string) of file or if networking is off, last version of file cached on disk.
+        Local path (string) of file or if networking is off, last version of
+        file cached on disk.
 
     Raises:
-        In case of non-recoverable file (non-existent or inaccessible url + no cache on disk).
+        - ``EnvironmentError`` if ``use_auth_token=True`` and the token cannot
+            be found.
+
+        - ``OSError`` if ETag cannot be determined.
+
+        - ``ValueError`` if the file cannot be downloaded and cannot be found
+            locally.
     """
     url = hf_hub_url(
         repo_id, filename, subfolder=subfolder, repo_type=repo_type, revision=revision
diff --git a/src/huggingface_hub/hf_api.py b/src/huggingface_hub/hf_api.py
index c53938db..135cd7fa 100644
--- a/src/huggingface_hub/hf_api.py
+++ b/src/huggingface_hub/hf_api.py
@@ -52,6 +52,33 @@ USERNAME_PLACEHOLDER = "hf_user"
 logger = logging.get_logger(__name__)
 
 
+# TODO: remove after deprecation period is over (v0.7)
+def _validate_repo_id_deprecation(repo_id, name, organization):
+    """Returns (name, organization) from the input."""
+    if not (repo_id or name):
+        raise ValueError(
+            "No name provided. Please pass `repo_id` with a valid repository name."
+        )
+
+    if repo_id and (name or organization):
+        raise ValueError(
+            "Only pass `repo_id` and leave deprecated `name` and "
+            "`organization` to be None."
+        )
+    elif name or organization:
+        warnings.warn(
+            "`name` and `organization` input arguments are deprecated and "
+            "will be removed in v0.7. Pass `repo_id` instead.",
+            FutureWarning,
+        )
+    else:
+        if "/" in repo_id:
+            organization, name = repo_id.split("/")
+        else:
+            organization, name = None, repo_id
+    return name, organization
+
+
 def repo_type_and_id_from_hf_id(hf_id: str):
     """
     Returns the repo type and ID from a huggingface.co URL linking to a repository
@@ -998,34 +1025,47 @@ class HfApi:
 
     def create_repo(
         self,
-        name: str,
+        repo_id: str = None,
         token: Optional[str] = None,
         organization: Optional[str] = None,
         private: Optional[bool] = None,
         repo_type: Optional[str] = None,
         exist_ok=False,
-        lfsmultipartthresh: Optional[int] = None,
         space_sdk: Optional[str] = None,
+        name: str = None,
     ) -> str:
-        """
-        HuggingFace git-based system, used for models, datasets, and spaces.
+        """Create an empty repo on the HuggingFace Hub.
 
-        Call HF API to create a whole repo.
+        Args:
+            repo_id: A namespace (user or an organization) and a repo name
+                seperated by a ``/``.
 
-        Params:
-            private: Whether the model repo should be private (requires a paid huggingface.co account)
+                .. versionadded: 0.4.0
+
+            token: An authentication token [1]_.
 
-            repo_type: Set to :obj:`"dataset"` or :obj:`"space"` if uploading to a dataset or space, :obj:`None` or :obj:`"model"` if uploading to a model. Default is :obj:`None`.
+            private: Whether the model repo should be private.
 
-            exist_ok: Do not raise an error if repo already exists
+            repo_type: Set to :obj:`"dataset"` or :obj:`"space"` if uploading
+                to a dataset or space, :obj:`None` or :obj:`"model"` if
+                uploading to a model. Default is :obj:`None`.
 
-            lfsmultipartthresh: Optional: internal param for testing purposes.
+            exist_ok: If ``True``, do not raise an error if repo already
+                exists.
 
-            space_sdk: Choice of SDK to use if repo_type is "space". Can be "streamlit", "gradio", or "static".
+            space_sdk: Choice of SDK to use if repo_type is "space". Can be
+                "streamlit", "gradio", or "static".
 
         Returns:
             URL to the newly created repo.
+
+        References:
+            .. [1] https://huggingface.co/settings/tokens
+
+        Reference
         """
+        name, organization = _validate_repo_id_deprecation(repo_id, name, organization)
+
         path = f"{self.endpoint}/api/repos/create"
         if token is None:
             token = self._validate_or_retrieve_token()
@@ -1088,8 +1128,8 @@ class HfApi:
                 "Ignoring provided space_sdk because repo_type is not 'space'."
             )
 
-        if lfsmultipartthresh is not None:
-            json["lfsmultipartthresh"] = lfsmultipartthresh
+        if getattr(self, "_lfsmultipartthresh", None):
+            json["lfsmultipartthresh"] = self._lfsmultipartthresh
         r = requests.post(
             path,
             headers={"authorization": f"Bearer {token}"},
@@ -1115,18 +1155,36 @@ class HfApi:
 
     def delete_repo(
         self,
-        name: str,
+        repo_id: str = None,
         token: Optional[str] = None,
         organization: Optional[str] = None,
         repo_type: Optional[str] = None,
+        name: str = None,
     ):
-        """
-        HuggingFace git-based system, used for models, datasets, and spaces.
-
-        Call HF API to delete a whole repo.
+        """Delete a repo from the HuggingFace Hub.
 
         CAUTION(this is irreversible).
+
+        Args:
+            repo_id: A namespace (user or an organization) and a repo name
+                seperated by a ``/``.
+
+                .. versionadded: 0.4.0
+
+            token: An authentication token [1]_.
+
+            repo_type: Set to :obj:`"dataset"` or :obj:`"space"` if uploading
+                to a dataset or space, :obj:`None` or :obj:`"model"` if
+                uploading to a model. Default is :obj:`None`.
+
+        Returns:
+            None
+
+        References:
+            .. [1] https://huggingface.co/settings/tokens
         """
+        name, organization = _validate_repo_id_deprecation(repo_id, name, organization)
+
         path = f"{self.endpoint}/api/repos/delete"
         if token is None:
             token = self._validate_or_retrieve_token()
@@ -1183,18 +1241,40 @@ class HfApi:
 
     def update_repo_visibility(
         self,
-        name: str,
-        private: bool,
+        repo_id: str = None,
+        private: bool = False,
         token: Optional[str] = None,
         organization: Optional[str] = None,
         repo_type: Optional[str] = None,
+        name: str = None,
     ) -> Dict[str, bool]:
-        """
-        Update the visibility setting of a repository.
+        """Update the visibility setting of a repository.
+
+        Args:
+            repo_id: A namespace (user or an organization) and a repo name
+                seperated by a ``/``.
+
+                .. versionadded: 0.4.0
+
+            private: Whether the model repo should be private.
+
+            token: An authentication token [1]_.
+
+            repo_type: Set to :obj:`"dataset"` or :obj:`"space"` if uploading
+                to a dataset or space, :obj:`None` or :obj:`"model"` if
+                uploading to a model. Default is :obj:`None`.
+
+        Returns:
+            The HTTP response in json.
+
+        References:
+            .. [1] https://huggingface.co/settings/tokens
         """
         if repo_type not in REPO_TYPES:
             raise ValueError("Invalid repo type")
 
+        name, organization = _validate_repo_id_deprecation(repo_id, name, organization)
+
         if token is None:
             token = self._validate_or_retrieve_token()
         elif not self._is_valid_token(token):
diff --git a/src/huggingface_hub/hub_mixin.py b/src/huggingface_hub/hub_mixin.py
index 3a1cce5c..f1ee52f9 100644
--- a/src/huggingface_hub/hub_mixin.py
+++ b/src/huggingface_hub/hub_mixin.py
@@ -255,11 +255,12 @@ class ModelHubMixin:
 
         # If no URL is passed and there's no path to a directory containing files, create a repo
         if repo_url is None and not os.path.exists(repo_path_or_name):
-            repo_name = Path(repo_path_or_name).name
+            repo_id = Path(repo_path_or_name).name
+            if organization:
+                repo_id = f"{organization}/{repo_id}"
             repo_url = HfApi(endpoint=api_endpoint).create_repo(
-                repo_name,
+                repo_id=repo_id,
                 token=token,
-                organization=organization,
                 private=private,
                 repo_type=None,
                 exist_ok=True,
diff --git a/src/huggingface_hub/keras_mixin.py b/src/huggingface_hub/keras_mixin.py
index 19e71aca..ac25d410 100644
--- a/src/huggingface_hub/keras_mixin.py
+++ b/src/huggingface_hub/keras_mixin.py
@@ -292,11 +292,12 @@ def push_to_hub_keras(
 
     # If no URL is passed and there's no path to a directory containing files, create a repo
     if repo_url is None and not os.path.exists(repo_path_or_name):
-        repo_name = Path(repo_path_or_name).name
+        repo_id = Path(repo_path_or_name).name
+        if organization:
+            repo_id = f"{organization}/{repo_id}"
         repo_url = HfApi(endpoint=api_endpoint).create_repo(
-            repo_name,
+            repo_id=repo_id,
             token=token,
-            organization=organization,
             private=private,
             repo_type=None,
             exist_ok=True,
diff --git a/src/huggingface_hub/repository.py b/src/huggingface_hub/repository.py
index d4565c19..46f17229 100644
--- a/src/huggingface_hub/repository.py
+++ b/src/huggingface_hub/repository.py
@@ -373,7 +373,7 @@ class Repository:
 
         If specifying a `clone_from`:
         will clone an existing remote repository, for instance one
-        that was previously created using ``HfApi().create_repo(name=repo_name)``.
+        that was previously created using ``HfApi().create_repo(repo_id=repo_name)``.
         ``Repository`` uses the local git credentials by default, but if required, the ``huggingface_token``
         as well as the git ``user`` and the ``email`` can be explicitly specified.
         If `clone_from` is used, and the repository is being instantiated into a non-empty directory,
@@ -538,17 +538,16 @@ class Repository:
                 valid_organisations = [org["name"] for org in whoami_info["orgs"]]
 
                 if namespace is not None:
-                    repo_url += f"{namespace}/"
+                    repo_id = f"{namespace}/{repo_id}"
                 repo_url += repo_id
 
                 repo_url = repo_url.replace("https://", f"https://user:{token}@")
 
                 if namespace == user or namespace in valid_organisations:
                     api.create_repo(
-                        repo_id,
+                        repo_id=repo_id,
                         token=token,
                         repo_type=self.repo_type,
-                        organization=namespace,
                         exist_ok=True,
                         private=self.private,
                     )
diff --git a/src/huggingface_hub/snapshot_download.py b/src/huggingface_hub/snapshot_download.py
index 5ca0025a..54f678aa 100644
--- a/src/huggingface_hub/snapshot_download.py
+++ b/src/huggingface_hub/snapshot_download.py
@@ -25,15 +25,16 @@ def snapshot_download(
     library_name: Optional[str] = None,
     library_version: Optional[str] = None,
     user_agent: Optional[Union[Dict, str]] = None,
-    proxies=None,
-    etag_timeout=10,
-    resume_download=False,
+    proxies: Optional[Dict] = None,
+    etag_timeout: Optional[float] = 10,
+    resume_download: Optional[bool] = False,
     use_auth_token: Optional[Union[bool, str]] = None,
-    local_files_only=False,
+    local_files_only: Optional[bool] = False,
     allow_regex: Optional[Union[List[str], str]] = None,
     ignore_regex: Optional[Union[List[str], str]] = None,
 ) -> str:
-    """
+    """Download all files of a repo.
+
     Downloads a whole snapshot of a repo's files at the specified revision.
     This is useful when you want all files from a repo, because you don't know
     which ones you will need a priori.
@@ -43,13 +44,58 @@ def snapshot_download(
     An alternative would be to just clone a repo but this would require that
     the user always has git and git-lfs installed, and properly configured.
 
-    Note: at some point maybe this format of storage should actually replace
-    the flat storage structure we've used so far (initially from allennlp
-    if I remember correctly).
+    Args:
+        repo_id (``str``):
+            A user or an organization name and a repo name seperated by a
+            ``/``.
+        revision (``str``, `optional`):
+            An optional Git revision id which can be a branch name, a tag, or a
+            commit hash.
+        cache_dir (``str``, ``Path``, `optional`):
+            Path to the folder where cached files are stored.
+        library_name (``str``, `optional`):
+            The name of the library to which the object corresponds.
+        library_version (``str``, `optional`):
+            The version of the library.
+        user_agent (``str``, ``dict``, `optional`):
+            The user-agent info in the form of a dictionary or a string.
+        proxies (``dict``, `optional`):
+            Dictionary mapping protocol to the URL of the proxy passed to
+            ``requests.request``.
+        etag_timeout (``float``, `optional`, defaults to ``10``):
+            When fetching ETag, how many seconds to wait for the server to send
+            data before giving up which is passed to ``requests.request``.
+        resume_download (``bool``, `optional`, defaults to ``False):
+            If ``True``, resume a previously interrupted download.
+        use_auth_token (``str``, ``bool``, `optional`):
+            A token to be used for the download.
+                - If ``True``, the token is read from the HuggingFace config
+                  folder.
+                - If a string, it's used as the authentication token.
+        local_files_only (``bool``, `optional`, defaults to ``False``):
+            If ``True``, avoid downloading the file and return the path to the
+            local cached file if it exists.
+        allow_regex (``list of str``, ``str``, `optional`):
+            If provided, only files matching this regex are downladed.
+        ignore_regex (``list of str``, ``str``, `optional`):
+            If provided, files matching this regex are not downloaded.
 
     Return:
         Local folder path (string) of repo snapshot
+
+    Raises:
+        - ``EnvironmentError`` if ``use_auth_token=True`` and the token cannot
+            be found.
+
+        - ``OSError`` if ETag cannot be determined.
+
+        - ``ValueError`` if the file cannot be downloaded and cannot be found
+            locally.
     """
+    # Note: at some point maybe this format of storage should actually replace
+    # the flat storage structure we've used so far (initially from allennlp
+    # if I remember correctly).
+
     if cache_dir is None:
         cache_dir = HUGGINGFACE_HUB_CACHE
     if revision is None:
@@ -68,7 +114,7 @@ def snapshot_download(
     else:
         token = None
 
-    # remove all `/` occurances to correctly convert repo to directory name
+    # remove all `/` occurrences to correctly convert repo to directory name
     repo_id_flattened = repo_id.replace("/", REPO_ID_SEPARATOR)
 
     # if we have no internet connection we will look for the


Test patch:
diff --git a/tests/test_hf_api.py b/tests/test_hf_api.py
index 4db0bd11..44df1014 100644
--- a/tests/test_hf_api.py
+++ b/tests/test_hf_api.py
@@ -14,12 +14,14 @@
 
 
 import os
+import re
 import shutil
 import subprocess
 import tempfile
 import time
 import unittest
 import uuid
+import warnings
 from io import BytesIO
 
 import pytest
@@ -42,6 +44,7 @@ from huggingface_hub.hf_api import (
     MetricInfo,
     ModelInfo,
     ModelSearchArguments,
+    _validate_repo_id_deprecation,
     erase_from_credential_store,
     read_from_credential_store,
     repo_type_and_id_from_hf_id,
@@ -172,6 +175,104 @@ class HfApiCommonTestWithLogin(HfApiCommonTest):
         cls._token = cls._api.login(username=USER, password=PASS)
 
 
+@retry_endpoint
+def test_repo_id_no_warning():
+    # tests that passing repo_id as positional arg doesn't raise any warnings
+    # for {create, delete}_repo and update_repo_visibility
+    api = HfApi(endpoint=ENDPOINT_STAGING)
+    token = api.login(username=USER, password=PASS)
+    REPO_NAME = repo_name("crud")
+
+    args = [
+        ("create_repo", {}),
+        ("update_repo_visibility", {"private": False}),
+        ("delete_repo", {}),
+    ]
+
+    for method, kwargs in args:
+        with warnings.catch_warnings(record=True) as record:
+            getattr(api, method)(
+                REPO_NAME, token=token, repo_type=REPO_TYPE_MODEL, **kwargs
+            )
+        assert not len(record)
+
+
+def test_validate_repo_id_deprecation():
+    with pytest.warns(FutureWarning, match="input arguments are deprecated"):
+        name, org = _validate_repo_id_deprecation(
+            repo_id=None, name="repo", organization="org"
+        )
+        assert name == "repo" and org == "org"
+
+    with warnings.catch_warnings(record=True) as record:
+        name, org = _validate_repo_id_deprecation(
+            repo_id="org/repo", name=None, organization=None
+        )
+        assert name == "repo" and org == "org"
+    assert not len(record)
+
+    with pytest.raises(ValueError, match="leave deprecated"):
+        _validate_repo_id_deprecation(
+            repo_id="repo_id", name="name", organization="organization"
+        )
+
+
+@retry_endpoint
+def test_name_org_deprecation_warning():
+    # test that the right warning is raised when passing name to
+    # {create, delete}_repo and update_repo_visibility
+    api = HfApi(endpoint=ENDPOINT_STAGING)
+    token = api.login(username=USER, password=PASS)
+    REPO_NAME = repo_name("crud")
+
+    args = [
+        ("create_repo", {}),
+        ("update_repo_visibility", {"private": False}),
+        ("delete_repo", {}),
+    ]
+
+    for method, kwargs in args:
+        with pytest.warns(
+            FutureWarning,
+            match=re.escape("`name` and `organization` input arguments are deprecated"),
+        ):
+            getattr(api, method)(
+                name=REPO_NAME, token=token, repo_type=REPO_TYPE_MODEL, **kwargs
+            )
+
+
+@retry_endpoint
+def test_name_org_deprecation_error():
+    # tests that the right error is raised when passing both name and repo_id
+    # to {create, delete}_repo and update_repo_visibility
+    api = HfApi(endpoint=ENDPOINT_STAGING)
+    token = api.login(username=USER, password=PASS)
+    REPO_NAME = repo_name("crud")
+
+    args = [
+        ("create_repo", {}),
+        ("update_repo_visibility", {"private": False}),
+        ("delete_repo", {}),
+    ]
+
+    for method, kwargs in args:
+        with pytest.raises(
+            ValueError,
+            match=re.escape("Only pass `repo_id`"),
+        ):
+            getattr(api, method)(
+                repo_id="test",
+                name=REPO_NAME,
+                token=token,
+                repo_type=REPO_TYPE_MODEL,
+                **kwargs,
+            )
+
+    for method, kwargs in args:
+        with pytest.raises(ValueError, match="No name provided"):
+            getattr(api, method)(token=token, repo_type=REPO_TYPE_MODEL, **kwargs)
+
+
 class HfApiEndpointsTest(HfApiCommonTestWithLogin):
     def test_whoami(self):
         info = self._api.whoami(token=self._token)
@@ -184,57 +285,63 @@ class HfApiEndpointsTest(HfApiCommonTestWithLogin):
     @retry_endpoint
     def test_create_update_and_delete_repo(self):
         REPO_NAME = repo_name("crud")
-        self._api.create_repo(name=REPO_NAME, token=self._token)
+        self._api.create_repo(repo_id=REPO_NAME, token=self._token)
         res = self._api.update_repo_visibility(
-            name=REPO_NAME, token=self._token, private=True
+            repo_id=REPO_NAME, token=self._token, private=True
         )
         self.assertTrue(res["private"])
         res = self._api.update_repo_visibility(
-            name=REPO_NAME, token=self._token, private=False
+            repo_id=REPO_NAME, token=self._token, private=False
         )
         self.assertFalse(res["private"])
-        self._api.delete_repo(name=REPO_NAME, token=self._token)
+        self._api.delete_repo(repo_id=REPO_NAME, token=self._token)
 
     @retry_endpoint
     def test_create_update_and_delete_model_repo(self):
         REPO_NAME = repo_name("crud")
         self._api.create_repo(
-            name=REPO_NAME, token=self._token, repo_type=REPO_TYPE_MODEL
+            repo_id=REPO_NAME, token=self._token, repo_type=REPO_TYPE_MODEL
         )
         res = self._api.update_repo_visibility(
-            name=REPO_NAME, token=self._token, private=True, repo_type=REPO_TYPE_MODEL
+            repo_id=REPO_NAME,
+            token=self._token,
+            private=True,
+            repo_type=REPO_TYPE_MODEL,
         )
         self.assertTrue(res["private"])
         res = self._api.update_repo_visibility(
-            name=REPO_NAME, token=self._token, private=False, repo_type=REPO_TYPE_MODEL
+            repo_id=REPO_NAME,
+            token=self._token,
+            private=False,
+            repo_type=REPO_TYPE_MODEL,
         )
         self.assertFalse(res["private"])
         self._api.delete_repo(
-            name=REPO_NAME, token=self._token, repo_type=REPO_TYPE_MODEL
+            repo_id=REPO_NAME, token=self._token, repo_type=REPO_TYPE_MODEL
         )
 
     @retry_endpoint
     def test_create_update_and_delete_dataset_repo(self):
         DATASET_REPO_NAME = dataset_repo_name("crud")
         self._api.create_repo(
-            name=DATASET_REPO_NAME, token=self._token, repo_type=REPO_TYPE_DATASET
+            repo_id=DATASET_REPO_NAME, token=self._token, repo_type=REPO_TYPE_DATASET
         )
         res = self._api.update_repo_visibility(
-            name=DATASET_REPO_NAME,
+            repo_id=DATASET_REPO_NAME,
             token=self._token,
             private=True,
             repo_type=REPO_TYPE_DATASET,
         )
         self.assertTrue(res["private"])
         res = self._api.update_repo_visibility(
-            name=DATASET_REPO_NAME,
+            repo_id=DATASET_REPO_NAME,
             token=self._token,
             private=False,
             repo_type=REPO_TYPE_DATASET,
         )
         self.assertFalse(res["private"])
         self._api.delete_repo(
-            name=DATASET_REPO_NAME, token=self._token, repo_type=REPO_TYPE_DATASET
+            repo_id=DATASET_REPO_NAME, token=self._token, repo_type=REPO_TYPE_DATASET
         )
 
     @retry_endpoint
@@ -243,14 +350,14 @@ class HfApiEndpointsTest(HfApiCommonTestWithLogin):
         with pytest.raises(ValueError, match=r"No space_sdk provided.*"):
             self._api.create_repo(
                 token=self._token,
-                name=SPACE_REPO_NAME,
+                repo_id=SPACE_REPO_NAME,
                 repo_type=REPO_TYPE_SPACE,
                 space_sdk=None,
             )
         with pytest.raises(ValueError, match=r"Invalid space_sdk.*"):
             self._api.create_repo(
                 token=self._token,
-                name=SPACE_REPO_NAME,
+                repo_id=SPACE_REPO_NAME,
                 repo_type=REPO_TYPE_SPACE,
                 space_sdk="asdfasdf",
             )
@@ -258,27 +365,27 @@ class HfApiEndpointsTest(HfApiCommonTestWithLogin):
         for sdk in SPACES_SDK_TYPES:
             SPACE_REPO_NAME = space_repo_name(sdk)
             self._api.create_repo(
-                name=SPACE_REPO_NAME,
+                repo_id=SPACE_REPO_NAME,
                 token=self._token,
                 repo_type=REPO_TYPE_SPACE,
                 space_sdk=sdk,
             )
             res = self._api.update_repo_visibility(
-                name=SPACE_REPO_NAME,
+                repo_id=SPACE_REPO_NAME,
                 token=self._token,
                 private=True,
                 repo_type=REPO_TYPE_SPACE,
             )
             self.assertTrue(res["private"])
             res = self._api.update_repo_visibility(
-                name=SPACE_REPO_NAME,
+                repo_id=SPACE_REPO_NAME,
                 token=self._token,
                 private=False,
                 repo_type=REPO_TYPE_SPACE,
             )
             self.assertFalse(res["private"])
             self._api.delete_repo(
-                name=SPACE_REPO_NAME, token=self._token, repo_type=REPO_TYPE_SPACE
+                repo_id=SPACE_REPO_NAME, token=self._token, repo_type=REPO_TYPE_SPACE
             )
 
     @retry_endpoint
@@ -290,7 +397,7 @@ class HfApiEndpointsTest(HfApiCommonTestWithLogin):
 
         for repo_type in [REPO_TYPE_MODEL, REPO_TYPE_DATASET, REPO_TYPE_SPACE]:
             self._api.create_repo(
-                name=REPO_NAME,
+                repo_id=REPO_NAME,
                 token=self._token,
                 repo_type=repo_type,
                 space_sdk="static",
@@ -312,7 +419,7 @@ class HfApiEndpointsTest(HfApiCommonTestWithLogin):
                 repo_type=repo_type,
             )
             self._api.delete_repo(
-                name=NEW_REPO_NAME, token=self._token, repo_type=repo_type
+                repo_id=NEW_REPO_NAME, token=self._token, repo_type=repo_type
             )
 
 
@@ -362,7 +469,7 @@ class HfApiUploadFileTest(HfApiCommonTestWithLogin):
     @retry_endpoint
     def test_upload_file_path(self):
         REPO_NAME = repo_name("path")
-        self._api.create_repo(token=self._token, name=REPO_NAME)
+        self._api.create_repo(token=self._token, repo_id=REPO_NAME)
         try:
             self._api.upload_file(
                 path_or_fileobj=self.tmp_file,
@@ -383,12 +490,12 @@ class HfApiUploadFileTest(HfApiCommonTestWithLogin):
         except Exception as err:
             self.fail(err)
         finally:
-            self._api.delete_repo(name=REPO_NAME, token=self._token)
+            self._api.delete_repo(repo_id=REPO_NAME, token=self._token)
 
     @retry_endpoint
     def test_upload_file_fileobj(self):
         REPO_NAME = repo_name("fileobj")
-        self._api.create_repo(name=REPO_NAME, token=self._token)
+        self._api.create_repo(repo_id=REPO_NAME, token=self._token)
         try:
             with open(self.tmp_file, "rb") as filestream:
                 self._api.upload_file(
@@ -410,12 +517,12 @@ class HfApiUploadFileTest(HfApiCommonTestWithLogin):
         except Exception as err:
             self.fail(err)
         finally:
-            self._api.delete_repo(name=REPO_NAME, token=self._token)
+            self._api.delete_repo(repo_id=REPO_NAME, token=self._token)
 
     @retry_endpoint
     def test_upload_file_bytesio(self):
         REPO_NAME = repo_name("bytesio")
-        self._api.create_repo(name=REPO_NAME, token=self._token)
+        self._api.create_repo(repo_id=REPO_NAME, token=self._token)
         try:
             filecontent = BytesIO(b"File content, but in bytes IO")
             self._api.upload_file(
@@ -437,12 +544,12 @@ class HfApiUploadFileTest(HfApiCommonTestWithLogin):
         except Exception as err:
             self.fail(err)
         finally:
-            self._api.delete_repo(name=REPO_NAME, token=self._token)
+            self._api.delete_repo(repo_id=REPO_NAME, token=self._token)
 
     @retry_endpoint
     def test_upload_file_conflict(self):
         REPO_NAME = repo_name("conflict")
-        self._api.create_repo(name=REPO_NAME, token=self._token)
+        self._api.create_repo(repo_id=REPO_NAME, token=self._token)
         try:
             filecontent = BytesIO(b"File content, but in bytes IO")
             self._api.upload_file(
@@ -475,12 +582,12 @@ class HfApiUploadFileTest(HfApiCommonTestWithLogin):
         except Exception as err:
             self.fail(err)
         finally:
-            self._api.delete_repo(name=REPO_NAME, token=self._token)
+            self._api.delete_repo(repo_id=REPO_NAME, token=self._token)
 
     @retry_endpoint
     def test_upload_buffer(self):
         REPO_NAME = repo_name("buffer")
-        self._api.create_repo(name=REPO_NAME, token=self._token)
+        self._api.create_repo(repo_id=REPO_NAME, token=self._token)
         try:
             buffer = BytesIO()
             buffer.write(self.tmp_file_content.encode())
@@ -503,12 +610,12 @@ class HfApiUploadFileTest(HfApiCommonTestWithLogin):
         except Exception as err:
             self.fail(err)
         finally:
-            self._api.delete_repo(name=REPO_NAME, token=self._token)
+            self._api.delete_repo(repo_id=REPO_NAME, token=self._token)
 
     @retry_endpoint
     def test_delete_file(self):
         REPO_NAME = repo_name("delete")
-        self._api.create_repo(token=self._token, name=REPO_NAME)
+        self._api.create_repo(token=self._token, repo_id=REPO_NAME)
         try:
             self._api.upload_file(
                 path_or_fileobj=self.tmp_file,
@@ -529,7 +636,7 @@ class HfApiUploadFileTest(HfApiCommonTestWithLogin):
         except Exception as err:
             self.fail(err)
         finally:
-            self._api.delete_repo(name=REPO_NAME, token=self._token)
+            self._api.delete_repo(repo_id=REPO_NAME, token=self._token)
 
     def test_get_full_repo_name(self):
         repo_name_with_no_org = self._api.get_full_repo_name("model", token=self._token)
@@ -949,10 +1056,10 @@ class HfApiPrivateTest(HfApiCommonTestWithLogin):
     def setUp(self) -> None:
         super().setUp()
         self.REPO_NAME = repo_name("private")
-        self._api.create_repo(name=self.REPO_NAME, token=self._token, private=True)
+        self._api.create_repo(repo_id=self.REPO_NAME, token=self._token, private=True)
 
     def tearDown(self) -> None:
-        self._api.delete_repo(name=self.REPO_NAME, token=self._token)
+        self._api.delete_repo(repo_id=self.REPO_NAME, token=self._token)
 
     def test_model_info(self):
         shutil.rmtree(os.path.dirname(HfFolder.path_token))
@@ -1012,7 +1119,7 @@ class HfLargefilesTest(HfApiCommonTest):
         )
 
     def tearDown(self):
-        self._api.delete_repo(name=self.REPO_NAME_LARGE_FILE, token=self._token)
+        self._api.delete_repo(repo_id=self.REPO_NAME_LARGE_FILE, token=self._token)
 
     def setup_local_clone(self, REMOTE_URL):
         REMOTE_URL_AUTH = REMOTE_URL.replace(
@@ -1033,11 +1140,12 @@ class HfLargefilesTest(HfApiCommonTest):
 
     @retry_endpoint
     def test_end_to_end_thresh_6M(self):
+        self._api._lfsmultipartthresh = 6 * 10**6
         REMOTE_URL = self._api.create_repo(
-            name=self.REPO_NAME_LARGE_FILE,
+            repo_id=self.REPO_NAME_LARGE_FILE,
             token=self._token,
-            lfsmultipartthresh=6 * 10**6,
         )
+        self._api._lfsmultipartthresh = None
         self.setup_local_clone(REMOTE_URL)
 
         subprocess.run(
@@ -1087,11 +1195,12 @@ class HfLargefilesTest(HfApiCommonTest):
     @retry_endpoint
     def test_end_to_end_thresh_16M(self):
         # Here we'll push one multipart and one non-multipart file in the same commit, and see what happens
+        self._api._lfsmultipartthresh = 16 * 10**6
         REMOTE_URL = self._api.create_repo(
-            name=self.REPO_NAME_LARGE_FILE,
+            repo_id=self.REPO_NAME_LARGE_FILE,
             token=self._token,
-            lfsmultipartthresh=16 * 10**6,
         )
+        self._api._lfsmultipartthresh = None
         self.setup_local_clone(REMOTE_URL)
 
         subprocess.run(
diff --git a/tests/test_hubmixin.py b/tests/test_hubmixin.py
index 2f95331d..e2f5178c 100644
--- a/tests/test_hubmixin.py
+++ b/tests/test_hubmixin.py
@@ -133,4 +133,4 @@ class HubMixingTest(HubMixingCommonTest):
         )
         self.assertEqual(model_info.modelId, f"{USER}/{REPO_NAME}")
 
-        self._api.delete_repo(name=f"{REPO_NAME}", token=self._token)
+        self._api.delete_repo(repo_id=f"{REPO_NAME}", token=self._token)
diff --git a/tests/test_keras_integration.py b/tests/test_keras_integration.py
index 4fba4db9..092dafcb 100644
--- a/tests/test_keras_integration.py
+++ b/tests/test_keras_integration.py
@@ -1,5 +1,6 @@
 import os
 import shutil
+import tempfile
 import time
 import unittest
 import uuid
@@ -168,7 +169,7 @@ class HubMixingTestKeras(unittest.TestCase):
         )
         self.assertEqual(model_info.modelId, f"{USER}/{REPO_NAME}")
 
-        self._api.delete_repo(name=f"{REPO_NAME}", token=self._token)
+        self._api.delete_repo(repo_id=f"{REPO_NAME}", token=self._token)
 
 
 @require_tf
@@ -326,7 +327,7 @@ class HubKerasSequentialTest(HubMixingTestKeras):
         )
         self.assertEqual(model_info.modelId, f"{USER}/{REPO_NAME}")
 
-        self._api.delete_repo(name=f"{REPO_NAME}", token=self._token)
+        self._api.delete_repo(repo_id=f"{REPO_NAME}", token=self._token)
 
     @retry_endpoint
     def test_push_to_hub_model_card_build(self):
@@ -346,11 +347,11 @@ class HubKerasSequentialTest(HubMixingTestKeras):
         )
         self.assertTrue("README.md" in [f.rfilename for f in model_info.siblings])
         self.assertTrue("model.png" in [f.rfilename for f in model_info.siblings])
-        self._api.delete_repo(name=f"{REPO_NAME}", token=self._token)
+        self._api.delete_repo(repo_id=f"{REPO_NAME}", token=self._token)
 
     @retry_endpoint
     def test_push_to_hub_model_card_plot_false(self):
-        REPO_NAME = repo_name("PUSH_TO_HUB")
+        REPO_NAME = repo_name("PUSH_TO_HUB_PLOT")
         model = self.model_init()
         model = self.model_fit(model)
         push_to_hub_keras(
@@ -366,25 +367,26 @@ class HubKerasSequentialTest(HubMixingTestKeras):
             f"{USER}/{REPO_NAME}",
         )
         self.assertFalse("model.png" in [f.rfilename for f in model_info.siblings])
-        self._api.delete_repo(name=f"{REPO_NAME}", token=self._token)
+        self._api.delete_repo(repo_id=f"{REPO_NAME}", token=self._token)
 
     @retry_endpoint
     def test_push_to_hub_tensorboard(self):
-        os.makedirs(f"{WORKING_REPO_DIR}/tb_log_dir")
-        with open(f"{WORKING_REPO_DIR}/tb_log_dir/tensorboard.txt", "w") as fp:
-            fp.write("Keras FTW")
-        REPO_NAME = repo_name("PUSH_TO_HUB")
-        model = self.model_init()
-        model = self.model_fit(model)
-        push_to_hub_keras(
-            model,
-            repo_path_or_name=f"{WORKING_REPO_DIR}/{REPO_NAME}",
-            log_dir=f"{WORKING_REPO_DIR}/tb_log_dir",
-            api_endpoint=ENDPOINT_STAGING,
-            use_auth_token=self._token,
-            git_user="ci",
-            git_email="ci@dummy.com",
-        )
+        REPO_NAME = "PUSH_TO_HUB_TB"
+        with tempfile.TemporaryDirectory() as tmpdirname:
+            os.makedirs(f"{tmpdirname}/log_dir")
+            with open(f"{tmpdirname}/log_dir/tensorboard.txt", "w") as fp:
+                fp.write("Keras FTW")
+            model = self.model_init()
+            model = self.model_fit(model)
+            push_to_hub_keras(
+                model,
+                repo_path_or_name=f"{WORKING_REPO_DIR}/{REPO_NAME}",
+                log_dir=f"{tmpdirname}/log_dir",
+                api_endpoint=ENDPOINT_STAGING,
+                use_auth_token=self._token,
+                git_user="ci",
+                git_email="ci@dummy.com",
+            )
         model_info = HfApi(endpoint=ENDPOINT_STAGING).model_info(
             f"{USER}/{REPO_NAME}",
         )
@@ -392,38 +394,38 @@ class HubKerasSequentialTest(HubMixingTestKeras):
         self.assertTrue(
             "logs/tensorboard.txt" in [f.rfilename for f in model_info.siblings]
         )
-
-        self._api.delete_repo(name=f"{REPO_NAME}", token=self._token)
+        self._api.delete_repo(repo_id=f"{REPO_NAME}", token=self._token)
 
     @retry_endpoint
     def test_override_tensorboard(self):
-        os.makedirs(f"{WORKING_REPO_DIR}/tb_log_dir")
-        with open(f"{WORKING_REPO_DIR}/tb_log_dir/tensorboard.txt", "w") as fp:
-            fp.write("Keras FTW")
-        REPO_NAME = repo_name("PUSH_TO_HUB")
-        model = self.model_init()
-        model.build((None, 2))
-        push_to_hub_keras(
-            model,
-            repo_path_or_name=f"{WORKING_REPO_DIR}/{REPO_NAME}",
-            log_dir=f"{WORKING_REPO_DIR}/tb_log_dir",
-            api_endpoint=ENDPOINT_STAGING,
-            use_auth_token=self._token,
-            git_user="ci",
-            git_email="ci@dummy.com",
-        )
-        os.makedirs(f"{WORKING_REPO_DIR}/tb_log_dir2")
-        with open(f"{WORKING_REPO_DIR}/tb_log_dir2/override.txt", "w") as fp:
-            fp.write("Keras FTW")
-        push_to_hub_keras(
-            model,
-            repo_path_or_name=f"{WORKING_REPO_DIR}/{REPO_NAME}",
-            log_dir=f"{WORKING_REPO_DIR}/tb_log_dir2",
-            api_endpoint=ENDPOINT_STAGING,
-            use_auth_token=self._token,
-            git_user="ci",
-            git_email="ci@dummy.com",
-        )
+        REPO_NAME = repo_name("TB_OVERRIDE")
+        with tempfile.TemporaryDirectory() as tmpdirname:
+            os.makedirs(f"{tmpdirname}/tb_log_dir")
+            with open(f"{tmpdirname}/tb_log_dir/tensorboard.txt", "w") as fp:
+                fp.write("Keras FTW")
+            model = self.model_init()
+            model.build((None, 2))
+            push_to_hub_keras(
+                model,
+                repo_path_or_name=f"{WORKING_REPO_DIR}/{REPO_NAME}",
+                log_dir=f"{tmpdirname}/tb_log_dir",
+                api_endpoint=ENDPOINT_STAGING,
+                use_auth_token=self._token,
+                git_user="ci",
+                git_email="ci@dummy.com",
+            )
+            os.makedirs(f"{tmpdirname}/tb_log_dir2")
+            with open(f"{tmpdirname}/tb_log_dir2/override.txt", "w") as fp:
+                fp.write("Keras FTW")
+            push_to_hub_keras(
+                model,
+                repo_path_or_name=f"{WORKING_REPO_DIR}/{REPO_NAME}",
+                log_dir=f"{tmpdirname}/tb_log_dir2",
+                api_endpoint=ENDPOINT_STAGING,
+                use_auth_token=self._token,
+                git_user="ci",
+                git_email="ci@dummy.com",
+            )
 
         model_info = HfApi(endpoint=ENDPOINT_STAGING).model_info(
             f"{USER}/{REPO_NAME}",
@@ -435,7 +437,7 @@ class HubKerasSequentialTest(HubMixingTestKeras):
             "logs/tensorboard.txt" in [f.rfilename for f in model_info.siblings]
         )
 
-        self._api.delete_repo(name=f"{REPO_NAME}", token=self._token)
+        self._api.delete_repo(repo_id=f"{REPO_NAME}", token=self._token)
 
     @retry_endpoint
     def test_push_to_hub_model_kwargs(self):
@@ -462,7 +464,7 @@ class HubKerasSequentialTest(HubMixingTestKeras):
         from_pretrained_keras(f"{WORKING_REPO_DIR}/{REPO_NAME}")
         self.assertRaises(ValueError, msg="Exception encountered when calling layer*")
 
-        self._api.delete_repo(name=f"{REPO_NAME}", token=self._token)
+        self._api.delete_repo(repo_id=f"{REPO_NAME}", token=self._token)
 
 
 @require_tf
diff --git a/tests/test_repository.py b/tests/test_repository.py
index 463fc8ae..fbfc7449 100644
--- a/tests/test_repository.py
+++ b/tests/test_repository.py
@@ -79,7 +79,9 @@ class RepositoryTest(RepositoryCommonTest):
             f"Does {WORKING_REPO_DIR} exist: {os.path.exists(WORKING_REPO_DIR)}"
         )
         self.REPO_NAME = repo_name()
-        self._repo_url = self._api.create_repo(name=self.REPO_NAME, token=self._token)
+        self._repo_url = self._api.create_repo(
+            repo_id=self.REPO_NAME, token=self._token
+        )
         self._api.upload_file(
             path_or_fileobj=BytesIO(b"some initial binary data: \x00\x01"),
             path_in_repo="random_file.txt",
@@ -89,18 +91,18 @@ class RepositoryTest(RepositoryCommonTest):
 
     def tearDown(self):
         try:
-            self._api.delete_repo(name=f"{USER}/{self.REPO_NAME}", token=self._token)
+            self._api.delete_repo(repo_id=f"{USER}/{self.REPO_NAME}", token=self._token)
         except requests.exceptions.HTTPError:
             pass
 
         try:
-            self._api.delete_repo(name=self.REPO_NAME, token=self._token)
+            self._api.delete_repo(repo_id=self.REPO_NAME, token=self._token)
         except requests.exceptions.HTTPError:
             pass
 
         try:
             self._api.delete_repo(
-                name=self.REPO_NAME, token=self._token, organization="valid_org"
+                repo_id=f"valid_org/{self.REPO_NAME}", token=self._token
             )
         except requests.exceptions.HTTPError:
             pass
@@ -170,7 +172,7 @@ class RepositoryTest(RepositoryCommonTest):
     def test_init_clone_in_nonempty_non_linked_git_repo(self):
         # Create a new repository on the HF Hub
         temp_repo_url = self._api.create_repo(
-            name=f"{self.REPO_NAME}-temp", token=self._token
+            repo_id=f"{self.REPO_NAME}-temp", token=self._token
         )
         self._api.upload_file(
             path_or_fileobj=BytesIO(b"some initial binary data: \x00\x01"),
@@ -188,7 +190,7 @@ class RepositoryTest(RepositoryCommonTest):
             EnvironmentError, Repository, WORKING_REPO_DIR, clone_from=temp_repo_url
         )
 
-        self._api.delete_repo(name=f"{self.REPO_NAME}-temp", token=self._token)
+        self._api.delete_repo(repo_id=f"{self.REPO_NAME}-temp", token=self._token)
 
     @retry_endpoint
     def test_init_clone_in_nonempty_linked_git_repo_with_token(self):
@@ -553,7 +555,7 @@ class RepositoryTest(RepositoryCommonTest):
 
         with open(pathlib.Path(repo.local_dir) / "file.bin", "r") as f:
             content = f.read()
-            self.assertEquals(content, "Bin file")
+            self.assertEqual(content, "Bin file")
 
     @retry_endpoint
     def test_is_tracked_upstream(self):
@@ -1472,20 +1474,19 @@ class RepositoryDatasetTest(RepositoryCommonTest):
             f"Does {WORKING_DATASET_DIR}/{self.REPO_NAME} exist: {os.path.exists(f'{WORKING_DATASET_DIR}/{self.REPO_NAME}')}"
         )
         self._api.create_repo(
-            token=self._token, name=self.REPO_NAME, repo_type="dataset"
+            token=self._token, repo_id=self.REPO_NAME, repo_type="dataset"
         )
 
     def tearDown(self):
         try:
             self._api.delete_repo(
-                name=self.REPO_NAME, token=self._token, repo_type="dataset"
+                repo_id=self.REPO_NAME, token=self._token, repo_type="dataset"
             )
         except requests.exceptions.HTTPError:
             try:
                 self._api.delete_repo(
-                    name=self.REPO_NAME,
+                    repo_id=f"valid_org/{self.REPO_NAME}",
                     token=self._token,
-                    organization="valid_org",
                     repo_type="dataset",
                 )
             except requests.exceptions.HTTPError:
diff --git a/tests/test_snapshot_download.py b/tests/test_snapshot_download.py
index 28a29003..8efd0c14 100644
--- a/tests/test_snapshot_download.py
+++ b/tests/test_snapshot_download.py
@@ -63,7 +63,7 @@ class SnapshotDownloadTests(unittest.TestCase):
         self.third_commit_hash = repo.git_head_hash()
 
     def tearDown(self) -> None:
-        self._api.delete_repo(name=REPO_NAME, token=self._token)
+        self._api.delete_repo(repo_id=REPO_NAME, token=self._token)
         shutil.rmtree(REPO_NAME)
 
     def test_download_model(self):