Skip to content

Commit 7a3c469

Browse files
[Doc]: fix various typos in different files (#3509)
1 parent 951d9f9 commit 7a3c469

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

docs/source/en/guides/jobs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Running this will show the following output!
172172
This code ran with the following GPU: NVIDIA A10G
173173
```
174174

175-
Use this to run a fine tuning script like [trl/scripts/sft.py](https://github.com/huggingface/trl/blob/main/trl/scripts/sft.py) with UV:
175+
Use this to run a fine-tuning script like [trl/scripts/sft.py](https://github.com/huggingface/trl/blob/main/trl/scripts/sft.py) with UV:
176176

177177
```python
178178
>>> from huggingface_hub import run_uv_job

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ In this guide, we will see how to manage your Space runtime
1010

1111
## A simple example: configure secrets and hardware.
1212

13-
Here is an end-to-end example to create and setup a Space on the Hub.
13+
Here is an end-to-end example to create and set up a Space on the Hub.
1414

1515
**1. Create a Space on the Hub.**
1616

src/huggingface_hub/_space_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class SpaceRuntime:
111111
Current hardware of the space. Example: "cpu-basic". Can be `None` if Space
112112
is `BUILDING` for the first time.
113113
requested_hardware (`str` or `None`):
114-
Requested hardware. Can be different than `hardware` especially if the request
114+
Requested hardware. Can be different from `hardware` especially if the request
115115
has just been made. Example: "t4-medium". Can be `None` if no hardware has
116116
been requested yet.
117117
sleep_time (`int` or `None`):

src/huggingface_hub/file_download.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ def _hf_hub_download_to_cache_dir(
10341034
locks_dir = os.path.join(cache_dir, ".locks")
10351035
storage_folder = os.path.join(cache_dir, repo_folder_name(repo_id=repo_id, repo_type=repo_type))
10361036

1037-
# cross platform transcription of filename, to be used as a local file path.
1037+
# cross-platform transcription of filename, to be used as a local file path.
10381038
relative_filename = os.path.join(*filename.split("/"))
10391039
if os.name == "nt":
10401040
if relative_filename.startswith("..\\") or "\\..\\" in relative_filename:
@@ -1531,7 +1531,7 @@ def get_hf_file_metadata(
15311531
# Return
15321532
return HfFileMetadata(
15331533
commit_hash=response.headers.get(constants.HUGGINGFACE_HEADER_X_REPO_COMMIT),
1534-
# We favor a custom header indicating the etag of the linked resource, and we fallback to the regular etag header.
1534+
# We favor a custom header indicating the etag of the linked resource, and we fall back to the regular etag header.
15351535
etag=_normalize_etag(
15361536
response.headers.get(constants.HUGGINGFACE_HEADER_X_LINKED_ETAG) or response.headers.get("ETag")
15371537
),

src/huggingface_hub/hub_mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class ModelHubMixin:
117117
Tags to be added to the model card. Used to generate model card. E.g. ["computer-vision"]
118118
coders (`dict[Type, tuple[Callable, Callable]]`, *optional*):
119119
Dictionary of custom types and their encoders/decoders. Used to encode/decode arguments that are not
120-
jsonable by default. E.g dataclasses, argparse.Namespace, OmegaConf, etc.
120+
jsonable by default. E.g. dataclasses, argparse.Namespace, OmegaConf, etc.
121121
122122
Example:
123123

src/huggingface_hub/utils/_git_credential.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def _parse_credential_output(output: str) -> list[str]:
111111
output (`str`):
112112
The output of `git credential fill`.
113113
"""
114-
# NOTE: If user has set an helper for a custom URL, it will not be caught here.
114+
# NOTE: If user has set a helper for a custom URL, it will not be caught here.
115115
# Example: `credential.https://huggingface.co.helper=store`
116116
# See: https://github.com/huggingface/huggingface_hub/pull/1138#discussion_r1013324508
117117
return sorted( # Sort for nice printing

tests/test_hf_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ def test_commit_preflight_on_lots_of_lfs_files(self, repo_url: RepoUrl):
837837
def test_create_commit_repo_id_case_insensitive(self):
838838
"""Test create commit but repo_id is lowercased.
839839
840-
Regression test for #1371. Hub API is already case insensitive. Somehow the issue was with the `requests`
840+
Regression test for #1371. Hub API is already case-insensitive. Somehow the issue was with the `requests`
841841
streaming implementation when generating the ndjson payload "on the fly". It seems that the server was
842842
receiving only the first line which causes a confusing "400 Bad Request - Add a line with the key `lfsFile`,
843843
`file` or `deletedFile`". Passing raw bytes instead of a generator fixes the problem.
@@ -3958,7 +3958,7 @@ def test_create_collection_exists_ok(self) -> None:
39583958

39593959
self.assertEqual(collection_1.slug, collection_2.slug)
39603960
self.assertIsNone(collection_1.description)
3961-
self.assertIsNone(collection_2.description) # Did not got updated!
3961+
self.assertIsNone(collection_2.description) # Did not get updated!
39623962

39633963
def test_create_private_collection(self) -> None:
39643964
collection = self._api.create_collection(self.title, private=True)

tests/test_utils_cache.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class TestValidCacheUtils(unittest.TestCase):
5050

5151
@with_production_testing
5252
def setUp(self) -> None:
53-
"""Setup a clean cache for tests that will remain valid in all tests."""
53+
"""Set up a clean cache for tests that will remain valid in all tests."""
5454
# Download latest main
5555
snapshot_download(repo_id=MODEL_ID, repo_type="model", cache_dir=self.cache_dir)
5656

@@ -71,7 +71,7 @@ def test_scan_cache_on_valid_cache_unix(self) -> None:
7171
"""Scan the cache dir without warnings (on unix-based platform).
7272
7373
This test is duplicated and adapted for Windows in `test_scan_cache_on_valid_cache_windows`.
74-
Note: Please make sure to updated both if any change is made.
74+
Note: Please make sure to update both if any change is made.
7575
"""
7676
report = scan_cache_dir(self.cache_dir)
7777

@@ -104,7 +104,7 @@ def test_scan_cache_on_valid_cache_unix(self) -> None:
104104
self.assertEqual(sum(rev.nb_files for rev in repo_a.revisions), 6)
105105

106106
# 2 REFS in the repo: "main" and "refs/pr/1"
107-
# We could have add a tag as well
107+
# We could have added a tag as well
108108
self.assertEqual(set(repo_a.refs.keys()), {"main", REF_1_NAME})
109109
self.assertEqual(repo_a.refs["main"].commit_hash, REPO_A_MAIN_HASH)
110110
self.assertEqual(repo_a.refs[REF_1_NAME].commit_hash, REPO_A_PR_1_HASH)
@@ -139,7 +139,7 @@ def test_scan_cache_on_valid_cache_unix(self) -> None:
139139
pr_1_readme_file = [file for file in pr_1_revision.files if file.file_name == "README.md"][0]
140140
pr_1_readme_file_path = pr_1_revision_path / "README.md"
141141

142-
# file_path in "refs/pr/1" revision is different than "main" but same blob path
142+
# file_path in "refs/pr/1" revision is different from "main" but same blob path
143143
self.assertEqual(pr_1_readme_file.file_path, pr_1_readme_file_path) # different
144144
self.assertEqual(pr_1_readme_file.blob_path, main_readme_blob_path) # same
145145

@@ -150,7 +150,7 @@ def test_scan_cache_on_valid_cache_windows(self) -> None:
150150
Windows tests do not use symlinks which leads to duplication in the cache.
151151
This test is duplicated from `test_scan_cache_on_valid_cache_unix` with a few
152152
tweaks specific to windows.
153-
Note: Please make sure to updated both if any change is made.
153+
Note: Please make sure to update both if any change is made.
154154
"""
155155
report = scan_cache_dir(self.cache_dir)
156156

@@ -183,7 +183,7 @@ def test_scan_cache_on_valid_cache_windows(self) -> None:
183183
self.assertEqual(sum(rev.nb_files for rev in repo_a.revisions), 6)
184184

185185
# 2 REFS in the repo: "main" and "refs/pr/1"
186-
# We could have add a tag as well
186+
# We could have added a tag as well
187187
REF_1_NAME = "refs\\pr\\1" # Windows-specific
188188
self.assertEqual(set(repo_a.refs.keys()), {"main", REF_1_NAME})
189189
self.assertEqual(repo_a.refs["main"].commit_hash, REPO_A_MAIN_HASH)
@@ -220,7 +220,7 @@ def test_scan_cache_on_valid_cache_windows(self) -> None:
220220
pr_1_readme_file = [file for file in pr_1_revision.files if file.file_name == "README.md"][0]
221221
pr_1_readme_file_path = pr_1_revision_path / "README.md"
222222

223-
# file_path in "refs/pr/1" revision is different than "main"
223+
# file_path in "refs/pr/1" revision is different from "main"
224224
# Windows-specific: even blob path is different
225225
self.assertEqual(pr_1_readme_file.file_path, pr_1_readme_file_path)
226226
self.assertNotEqual( # Windows-specific: different as well
@@ -237,7 +237,7 @@ class TestCorruptedCacheUtils(unittest.TestCase):
237237

238238
@with_production_testing
239239
def setUp(self) -> None:
240-
"""Setup a clean cache for tests that will get corrupted/modified in tests."""
240+
"""Set up a clean cache for tests that will get corrupted/modified in tests."""
241241
# Download latest main
242242
snapshot_download(repo_id=MODEL_ID, repo_type="model", cache_dir=self.cache_dir)
243243

@@ -676,7 +676,7 @@ def test_delete_path_on_folder_success(self) -> None:
676676
self.assertFalse(file_path_2.exists())
677677

678678
def test_delete_path_on_missing_file(self) -> None:
679-
"""Try delete a missing file."""
679+
"""Try to delete a missing file."""
680680
file_path = self.cache_dir / "file.txt"
681681

682682
with self.assertLogs() as captured:
@@ -687,7 +687,7 @@ def test_delete_path_on_missing_file(self) -> None:
687687
assert any(f"Couldn't delete TYPE: file not found ({file_path})" in log for log in captured.output)
688688

689689
def test_delete_path_on_missing_folder(self) -> None:
690-
"""Try delete a missing folder."""
690+
"""Try to delete a missing folder."""
691691
dir_path = self.cache_dir / "folder"
692692

693693
with self.assertLogs() as captured:
@@ -699,7 +699,7 @@ def test_delete_path_on_missing_folder(self) -> None:
699699

700700
@xfail_on_windows(reason="Permissions are handled differently on Windows.")
701701
def test_delete_path_on_local_folder_with_wrong_permission(self) -> None:
702-
"""Try delete a local folder that is protected."""
702+
"""Try to delete a local folder that is protected."""
703703
dir_path = self.cache_dir / "something"
704704
dir_path.mkdir()
705705
file_path_1 = dir_path / "file.txt" # file at root

0 commit comments

Comments
 (0)