Skip to content

Commit af4f4bc

Browse files
[Docs] Fix outdated docs (#4055)
* update outdated docs * revert unrelated updates
1 parent 6983a4d commit af4f4bc

File tree

10 files changed

+54
-48
lines changed

10 files changed

+54
-48
lines changed

docs/source/en/guides/cli.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,10 +1330,10 @@ Tag v1.0 created on bigcode/the-stack
13301330

13311331
### List tags
13321332

1333-
To list all tags for a repository, use the `-l` or `--list` option:
1333+
To list all tags for a repository, use the `list` (or `ls`) subcommand:
13341334

13351335
```bash
1336-
>>> hf repos tag create Wauplin/gradio-space-ci -l --repo-type space
1336+
>>> hf repos tag list Wauplin/gradio-space-ci --repo-type space
13371337
Tags for space Wauplin/gradio-space-ci:
13381338
0.2.2
13391339
0.2.1
@@ -1345,10 +1345,10 @@ Tags for space Wauplin/gradio-space-ci:
13451345

13461346
### Delete a tag
13471347

1348-
To delete a tag, use the `-d` or `--delete` option:
1348+
To delete a tag, use the `delete` subcommand:
13491349

13501350
```bash
1351-
>>> hf repos tag create -d Wauplin/my-cool-model v1.0
1351+
>>> hf repos tag delete Wauplin/my-cool-model v1.0
13521352
You are about to delete tag v1.0 on model Wauplin/my-cool-model
13531353
Proceed? [Y/n] y
13541354
Tag v1.0 deleted on Wauplin/my-cool-model

docs/source/en/guides/inference.md

Lines changed: 30 additions & 30 deletions
Large diffs are not rendered by default.

docs/source/en/guides/manage-cache.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ If you want to benefit from the symlink-based cache-system on a Windows machine,
179179
either need to [activate Developer Mode](https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development)
180180
or to run Python as an administrator.
181181

182+
If you want to proactively use the no-symlink cache mode (e.g. on a shared filesystem that doesn't handle symlinks
183+
well), you can set the [`HF_HUB_DISABLE_SYMLINKS`](../package_reference/environment_variables#hfhubdisablesymlinks) environment variable to `1`. Files will be copied into `snapshots/`
184+
directly instead of symlinking to `blobs/`.
185+
182186
When symlinks are not supported, a warning message is displayed to the user to alert
183187
them they are using a degraded version of the cache-system. This warning can be disabled
184188
by setting the `HF_HUB_DISABLE_SYMLINKS_WARNING` environment variable to true.

docs/source/en/guides/repository.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ Or via CLI:
6363
>>> hf repos create lysandre/test-dataset --repo-type dataset
6464
```
6565

66-
When you create a repository, you can set your repository visibility with the `private` parameter.
66+
When you create a repository, you can set your repository visibility with the `visibility` parameter:
6767

6868
```py
6969
>>> from huggingface_hub import create_repo
70-
>>> create_repo("lysandre/test-private", private=True)
70+
>>> create_repo("lysandre/test-private", visibility="private")
7171
```
7272

7373
Or via CLI:
@@ -91,6 +91,12 @@ Specify the `repo_id` of the repository you want to delete:
9191
>>> delete_repo(repo_id="lysandre/my-corrupted-dataset", repo_type="dataset")
9292
```
9393

94+
Pass `missing_ok=True` to silently ignore the call if the repository doesn't exist:
95+
96+
```py
97+
>>> delete_repo(repo_id="lysandre/my-corrupted-dataset", repo_type="dataset", missing_ok=True)
98+
```
99+
94100
Or via CLI:
95101

96102
```bash

docs/source/en/guides/webhooks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ local debugging but is to keep in mind for later.
198198

199199
> [!WARNING]
200200
> By default, the server is started at the end of your script. If you are running it in a notebook, you can start the
201-
> server manually by calling `decorated_function.run()`. Since a unique server is used, you only have to start the server
201+
> server manually by calling `decorated_function.launch()`. Since a unique server is used, you only have to start the server
202202
> once even if you have multiple endpoints.
203203
204204

@@ -303,7 +303,7 @@ async def goodbye(payload: WebhookPayload):
303303
return {"message": "goodbye"}
304304

305305
# 5. Start server (optional)
306-
app.run()
306+
app.launch()
307307
```
308308

309309
1. We define a custom UI using Gradio blocks. This UI will be displayed on the landing page of the server.

docs/source/en/installation.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ pip install 'huggingface_hub[mcp,torch]'
5151
```
5252

5353
Here is the list of optional dependencies in `huggingface_hub`:
54-
- `cli`: provide a more convenient CLI interface for `huggingface_hub`.
5554
- `fastai`, `torch`: dependencies to run framework-specific features.
5655
- `dev`: dependencies to contribute to the lib. Includes `testing` (to run tests), `typing` (to run type checker) and `quality` (to run linters).
5756

docs/source/en/package_reference/environment_variables.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ In order to standardize all environment variables within the Hugging Face ecosys
214214
| `HUGGINGFACE_HUB_CACHE` | `HF_HUB_CACHE` |
215215
| `HUGGINGFACE_ASSETS_CACHE` | `HF_ASSETS_CACHE` |
216216
| `HUGGING_FACE_HUB_TOKEN` | `HF_TOKEN` |
217-
| `HUGGINGFACE_HUB_VERBOSITY` | `HF_HUB_VERBOSITY` |
218217

219218
## From external tools
220219

docs/source/en/package_reference/utilities.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,18 @@ Unlike the synchronous client, the lifecycle of the async client is not managed
158158
## Handle HTTP errors
159159

160160
`huggingface_hub` defines its own HTTP errors to refine the `HTTPError` raised by
161-
`requests` with additional information sent back by the server.
161+
`httpx` with additional information sent back by the server.
162162

163163
### Raise for status
164164

165165
[`~utils.hf_raise_for_status`] is meant to be the central method to "raise for status" from any
166-
request made to the Hub. It wraps the base `requests.raise_for_status` to provide
166+
request made to the Hub. It wraps the base `httpx.Response.raise_for_status` to provide
167167
additional information. Any `HTTPError` thrown is converted into a `HfHubHTTPError`.
168168

169169
```py
170-
import requests
171-
from huggingface_hub.utils import hf_raise_for_status, HfHubHTTPError
170+
from huggingface_hub.utils import get_session, hf_raise_for_status, HfHubHTTPError
172171

173-
response = requests.post(...)
172+
response = get_session().post(...)
174173
try:
175174
hf_raise_for_status(response)
176175
except HfHubHTTPError as e:

docs/source/ko/package_reference/environment_variables.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ Hugging Face 생태계의 모든 환경 변수를 표준화하기 위해 일부
122122
| `HUGGINGFACE_HUB_CACHE` | `HF_HUB_CACHE` |
123123
| `HUGGINGFACE_ASSETS_CACHE` | `HF_ASSETS_CACHE` |
124124
| `HUGGING_FACE_HUB_TOKEN` | `HF_TOKEN` |
125-
| `HUGGINGFACE_HUB_VERBOSITY` | `HF_HUB_VERBOSITY` |
126125

127126
## 외부 도구[[from-external-tools]]
128127

src/huggingface_hub/utils/_http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,12 @@ def set_client_factory(client_factory: CLIENT_FACTORY_T) -> None:
300300
"""
301301
Set the HTTP client factory to be used by `huggingface_hub`.
302302
303-
The client factory is a method that returns a `httpx.Client` object. On the first call to [`get_client`] the client factory
303+
The client factory is a method that returns a `httpx.Client` object. On the first call to [`get_session`] the client factory
304304
will be used to create a new `httpx.Client` object that will be shared between all calls made by `huggingface_hub`.
305305
306306
This can be useful if you are running your scripts in a specific environment requiring custom configuration (e.g. custom proxy or certifications).
307307
308-
Use [`get_client`] to get a correctly configured `httpx.Client`.
308+
Use [`get_session`] to get a correctly configured `httpx.Client`.
309309
"""
310310
global _GLOBAL_CLIENT_FACTORY
311311
with _CLIENT_LOCK:

0 commit comments

Comments
 (0)