Skip to content

Commit fcac2c0

Browse files
[Doc]: fix various typos in different files (#3517)
1 parent 981c368 commit fcac2c0

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

docs/source/en/package_reference/hf_api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All methods from the `HfApi` are also accessible from the package's root directl
1010

1111
Using the root method is more straightforward but the [`HfApi`] class gives you more flexibility.
1212
In particular, you can pass a token that will be reused in all HTTP calls. This is different
13-
than `hf auth login` or [`login`] as the token is not persisted on the machine.
13+
from `hf auth login` or [`login`] as the token is not persisted on the machine.
1414
It is also possible to provide a different endpoint or configure a custom user-agent.
1515

1616
```python

docs/source/en/package_reference/webhooks_server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ all repos belonging to particular users/organizations you're interested in follo
99
more about webhooks on the Huggingface Hub, you can read the Webhooks [guide](https://huggingface.co/docs/hub/webhooks).
1010

1111
> [!TIP]
12-
> Check out this [guide](../guides/webhooks_server) for a step-by-step tutorial on how to setup your webhooks server and
12+
> Check out this [guide](../guides/webhooks_server) for a step-by-step tutorial on how to set up your webhooks server and
1313
> deploy it as a Space.
1414
1515
> [!WARNING]

src/huggingface_hub/_oauth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def greet_json(request: Request):
190190

191191
def parse_huggingface_oauth(request: "fastapi.Request") -> Optional[OAuthInfo]:
192192
"""
193-
Returns the information from a logged in user as a [`OAuthInfo`] object.
193+
Returns the information from a logged-in user as a [`OAuthInfo`] object.
194194
195195
For flexibility and future-proofing, this method is very lax in its parsing and does not raise errors.
196196
Missing fields are set to `None` without a warning.

src/huggingface_hub/repocard.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def push_to_hub(
258258
If specified and `create_pr` is `False`, the commit will fail if `revision` does not point to `parent_commit`.
259259
If specified and `create_pr` is `True`, the pull request will be created from `parent_commit`.
260260
Specifying `parent_commit` ensures the repo has not changed before committing the changes, and can be
261-
especially useful if the repo is updated / committed to concurrently.
261+
especially useful if the repo is updated / committed too concurrently.
262262
Returns:
263263
`str`: URL of the commit which updated the card metadata.
264264
"""
@@ -692,7 +692,7 @@ def metadata_update(
692692
) -> str:
693693
"""
694694
Updates the metadata in the README.md of a repository on the Hugging Face Hub.
695-
If the README.md file doesn't exist yet, a new one is created with metadata and an
695+
If the README.md file doesn't exist yet, a new one is created with metadata and
696696
the default ModelCard or DatasetCard template. For `space` repo, an error is thrown
697697
as a Space cannot exist without a `README.md` file.
698698
@@ -725,7 +725,7 @@ def metadata_update(
725725
If specified and `create_pr` is `False`, the commit will fail if `revision` does not point to `parent_commit`.
726726
If specified and `create_pr` is `True`, the pull request will be created from `parent_commit`.
727727
Specifying `parent_commit` ensures the repo has not changed before committing the changes, and can be
728-
especially useful if the repo is updated / committed to concurrently.
728+
especially useful if the repo is updated / committed too concurrently.
729729
Returns:
730730
`str`: URL of the commit which updated the card metadata.
731731

tests/test_utils_errors.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def test_hf_hub_http_error_init_with_request_id_and_multiline_message(self) -> N
156156
assert str(error) == "this is a message (Request ID: test-id)\n\nthis is more details"
157157

158158
def test_hf_hub_http_error_init_with_request_id_already_in_message(self) -> None:
159-
"""Test request id is not duplicated in error message (case insensitive)"""
159+
"""Test request id is not duplicated in error message (case-insensitive)"""
160160
self.response.headers = {X_REQUEST_ID: "test-id"}
161161
error = _format(HfHubHTTPError, "this is a message on request TEST-ID", response=self.response)
162162
assert str(error) == "this is a message on request TEST-ID"
@@ -196,7 +196,7 @@ def test_hf_hub_http_error_init_with_server_error_already_in_message(
196196
) -> None:
197197
"""Test server error is not duplicated if already in details.
198198
199-
Case insensitive.
199+
Case-insensitive.
200200
"""
201201
self.response._content = b'{"error": "repo NOT found"}'
202202
error = _format(
@@ -256,14 +256,14 @@ def test_hf_hub_http_error_init_with_error_message_duplicated_in_header_and_body
256256
assert error.server_message == "Error message duplicated in headers and body."
257257

258258
def test_hf_hub_http_error_without_request_id_with_amzn_trace_id(self) -> None:
259-
"""Test request id is not duplicated in error message (case insensitive)"""
259+
"""Test request id is not duplicated in error message (case-insensitive)"""
260260
self.response.headers = {X_AMZN_TRACE_ID: "test-trace-id"}
261261
error = _format(HfHubHTTPError, "this is a message", response=self.response)
262262
assert str(error) == "this is a message (Amzn Trace ID: test-trace-id)"
263263
assert error.request_id == "test-trace-id"
264264

265265
def test_hf_hub_http_error_with_request_id_and_amzn_trace_id(self) -> None:
266-
"""Test request id is not duplicated in error message (case insensitive)"""
266+
"""Test request id is not duplicated in error message (case-insensitive)"""
267267
self.response.headers = {X_AMZN_TRACE_ID: "test-trace-id", X_REQUEST_ID: "test-id"}
268268
error = _format(HfHubHTTPError, "this is a message", response=self.response)
269269
assert str(error) == "this is a message (Request ID: test-id)"

0 commit comments

Comments
 (0)