Skip to content

Commit 55baee5

Browse files
Fix some code annotation typos.
Signed-off-by: zhanluxianshen <[email protected]>
1 parent 800510c commit 55baee5

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/transformers/configuration_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ def recursive_diff_dict(dict_a, dict_b, config_obj=None):
11841184
Helper function to recursively take the diff between two nested dictionaries. The resulting diff only contains the
11851185
values from `dict_a` that are different from values in `dict_b`.
11861186
1187-
dict_b : the default config dictionnary. We want to remove values that are in this one
1187+
dict_b : the default config dictionary. We want to remove values that are in this one
11881188
"""
11891189
diff = {}
11901190
default = config_obj.__class__().to_dict() if config_obj is not None else {}

src/transformers/modeling_gguf_pytorch_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def get_gguf_hf_weights_map(
290290
# hack: ggufs have a different name for cohere
291291
if model_type == "cohere":
292292
model_type = "command-r"
293-
if model_type == "qwen2_moe":
293+
elif model_type == "qwen2_moe":
294294
model_type = "qwen2moe"
295295
arch = None
296296
for key, value in MODEL_ARCH_NAMES.items():
@@ -346,7 +346,7 @@ def load_gguf_checkpoint(gguf_checkpoint_path, return_tensors=False, model_to_lo
346346
Args:
347347
gguf_checkpoint_path (`str`):
348348
The path the to GGUF file to load
349-
return_tensors (`bool`, defaults to `True`):
349+
return_tensors (`bool`, defaults to `False`):
350350
Whether to read the tensors from the file and return them. Not doing so is faster
351351
and only loads the metadata in memory.
352352
"""

src/transformers/models/bark/processing_bark.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def from_pretrained(
7878
- a path to a *directory* containing a processor saved using the [`~BarkProcessor.save_pretrained`]
7979
method, e.g., `./my_model_directory/`.
8080
speaker_embeddings_dict_path (`str`, *optional*, defaults to `"speaker_embeddings_path.json"`):
81-
The name of the `.json` file containing the speaker_embeddings dictionnary located in
81+
The name of the `.json` file containing the speaker_embeddings dictionary located in
8282
`pretrained_model_name_or_path`. If `None`, no speaker_embeddings is loaded.
8383
**kwargs
8484
Additional keyword arguments passed along to both
@@ -105,7 +105,7 @@ def from_pretrained(
105105
logger.warning(
106106
f"""`{os.path.join(pretrained_processor_name_or_path, speaker_embeddings_dict_path)}` does not exists
107107
, no preloaded speaker embeddings will be used - Make sure to provide a correct path to the json
108-
dictionnary if wanted, otherwise set `speaker_embeddings_dict_path=None`."""
108+
dictionary if wanted, otherwise set `speaker_embeddings_dict_path=None`."""
109109
)
110110
speaker_embeddings = None
111111
else:
@@ -135,7 +135,7 @@ def save_pretrained(
135135
Directory where the tokenizer files and the speaker embeddings will be saved (directory will be created
136136
if it does not exist).
137137
speaker_embeddings_dict_path (`str`, *optional*, defaults to `"speaker_embeddings_path.json"`):
138-
The name of the `.json` file that will contains the speaker_embeddings nested path dictionnary, if it
138+
The name of the `.json` file that will contains the speaker_embeddings nested path dictionary, if it
139139
exists, and that will be located in `pretrained_model_name_or_path/speaker_embeddings_directory`.
140140
speaker_embeddings_directory (`str`, *optional*, defaults to `"speaker_embeddings/"`):
141141
The name of the folder in which the speaker_embeddings arrays will be saved.
@@ -246,7 +246,7 @@ def __call__(
246246
`is_split_into_words=True` (to lift the ambiguity with a batch of sequences).
247247
voice_preset (`str`, `Dict[np.ndarray]`):
248248
The voice preset, i.e the speaker embeddings. It can either be a valid voice_preset name, e.g
249-
`"en_speaker_1"`, or directly a dictionnary of `np.ndarray` embeddings for each submodel of `Bark`. Or
249+
`"en_speaker_1"`, or directly a dictionary of `np.ndarray` embeddings for each submodel of `Bark`. Or
250250
it can be a valid file name of a local `.npz` single voice preset.
251251
return_tensors (`str` or [`~utils.TensorType`], *optional*):
252252
If set, will return tensors of a particular framework. Acceptable values are:

src/transformers/utils/hub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ def create_and_tag_model_card(
11501150
The list of tags to add in the model card
11511151
token (`str`, *optional*):
11521152
Authentication token, obtained with `huggingface_hub.HfApi.login` method. Will default to the stored token.
1153-
ignore_metadata_errors (`str`):
1153+
ignore_metadata_errors (`bool`, *optional*, defaults to `False`):
11541154
If True, errors while parsing the metadata section will be ignored. Some information might be lost during
11551155
the process. Use it at your own risk.
11561156
"""

0 commit comments

Comments
 (0)