Skip to content

Commit fdf893c

Browse files
authored
Fix typo: indinces -> indices (#8159)
* Fix typo: indinces -> indices * Fix some more * Fix some more * Fix some more * Fix CI
1 parent c83cec4 commit fdf893c

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

src/transformers/pipelines.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def get_default_model(targeted_task: Dict, framework: Optional[str], task_option
122122
123123
Args:
124124
targeted_task (:obj:`Dict` ):
125-
Dictionnary representing the given task, that should contain default models
125+
Dictionary representing the given task, that should contain default models
126126
127127
framework (:obj:`str`, None)
128128
"pt", "tf" or None, representing a specific framework if it was specified, or None if we don't know yet.
@@ -150,9 +150,7 @@ def get_default_model(targeted_task: Dict, framework: Optional[str], task_option
150150
else:
151151
# XXX This error message needs to be updated to be more generic if more tasks are going to become
152152
# parametrized
153-
raise ValueError(
154-
'The task defaults can\'t be correctly selectionned. You probably meant "translation_XX_to_YY"'
155-
)
153+
raise ValueError('The task defaults can\'t be correctly selected. You probably meant "translation_XX_to_YY"')
156154

157155
if framework is None:
158156
framework = "pt"
@@ -695,7 +693,7 @@ def _forward(self, inputs, return_tensors=False):
695693
Internal framework specific forward dispatching
696694
697695
Args:
698-
inputs: dict holding all the keyworded arguments for required by the model forward method.
696+
inputs: dict holding all the keyword arguments for required by the model forward method.
699697
return_tensors: Whether to return native framework (pt/tf) tensors rather than numpy array
700698
701699
Returns:
@@ -874,7 +872,7 @@ def __call__(
874872
args (:obj:`str` or :obj:`List[str]`):
875873
One or several prompts (or one list of prompts) to complete.
876874
return_tensors (:obj:`bool`, `optional`, defaults to :obj:`False`):
877-
Whether or not to include the tensors of predictions (as token indinces) in the outputs.
875+
Whether or not to include the tensors of predictions (as token indices) in the outputs.
878876
return_text (:obj:`bool`, `optional`, defaults to :obj:`True`):
879877
Whether or not to include the decoded texts in the outputs.
880878
clean_up_tokenization_spaces (:obj:`bool`, `optional`, defaults to :obj:`False`):
@@ -1710,7 +1708,7 @@ def __call__(self, *args, **kwargs):
17101708
question (:obj:`str` or :obj:`List[str]`):
17111709
One or several question(s) (must be used in conjunction with the :obj:`context` argument).
17121710
context (:obj:`str` or :obj:`List[str]`):
1713-
One or several context(s) associated with the qustion(s) (must be used in conjunction with the
1711+
One or several context(s) associated with the question(s) (must be used in conjunction with the
17141712
:obj:`question` argument).
17151713
topk (:obj:`int`, `optional`, defaults to 1):
17161714
The number of answers to return (will be chosen by order of likelihood).
@@ -1959,7 +1957,7 @@ def __call__(
19591957
return_text (:obj:`bool`, `optional`, defaults to :obj:`True`):
19601958
Whether or not to include the decoded texts in the outputs
19611959
return_tensors (:obj:`bool`, `optional`, defaults to :obj:`False`):
1962-
Whether or not to include the tensors of predictions (as token indinces) in the outputs.
1960+
Whether or not to include the tensors of predictions (as token indices) in the outputs.
19631961
clean_up_tokenization_spaces (:obj:`bool`, `optional`, defaults to :obj:`False`):
19641962
Whether or not to clean up the potential extra spaces in the text output.
19651963
generate_kwargs:
@@ -2077,7 +2075,7 @@ def __call__(
20772075
args (:obj:`str` or :obj:`List[str]`):
20782076
Texts to be translated.
20792077
return_tensors (:obj:`bool`, `optional`, defaults to :obj:`False`):
2080-
Whether or not to include the tensors of predictions (as token indinces) in the outputs.
2078+
Whether or not to include the tensors of predictions (as token indices) in the outputs.
20812079
return_text (:obj:`bool`, `optional`, defaults to :obj:`True`):
20822080
Whether or not to include the decoded texts in the outputs.
20832081
clean_up_tokenization_spaces (:obj:`bool`, `optional`, defaults to :obj:`False`):
@@ -2188,7 +2186,7 @@ def __call__(
21882186
args (:obj:`str` or :obj:`List[str]`):
21892187
Input text for the encoder.
21902188
return_tensors (:obj:`bool`, `optional`, defaults to :obj:`False`):
2191-
Whether or not to include the tensors of predictions (as token indinces) in the outputs.
2189+
Whether or not to include the tensors of predictions (as token indices) in the outputs.
21922190
return_text (:obj:`bool`, `optional`, defaults to :obj:`True`):
21932191
Whether or not to include the decoded texts in the outputs.
21942192
clean_up_tokenization_spaces (:obj:`bool`, `optional`, defaults to :obj:`False`):
@@ -2253,8 +2251,8 @@ class Conversation:
22532251
:class:`~transformers.ConversationalPipeline`. The conversation contains a number of utility function to manage the
22542252
addition of new user input and generated model responses. A conversation needs to contain an unprocessed user input
22552253
before being passed to the :class:`~transformers.ConversationalPipeline`. This user input is either created when
2256-
the class is instantiated, or by calling :obj:`conversional_pipeline.append_response("input")` after a conversation
2257-
turn.
2254+
the class is instantiated, or by calling :obj:`conversational_pipeline.append_response("input")` after a
2255+
conversation turn.
22582256
22592257
Arguments:
22602258
text (:obj:`str`, `optional`):
@@ -2671,8 +2669,8 @@ def check_task(task: str) -> Tuple[Dict, Any]:
26712669
- :obj:`"conversational"`
26722670
26732671
Returns:
2674-
(task_defaults:obj:`dict`, task_options: (:obj:`tuple`, None)) The actual dictionnary required to initialize
2675-
the pipeline and some extra task options for parametrized tasks like "translation_XX_to_YY"
2672+
(task_defaults:obj:`dict`, task_options: (:obj:`tuple`, None)) The actual dictionary required to initialize the
2673+
pipeline and some extra task options for parametrized tasks like "translation_XX_to_YY"
26762674
26772675
26782676
"""

src/transformers/tokenization_t5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class T5Tokenizer(PreTrainedTokenizer):
8989
extra_ids (:obj:`int`, `optional`, defaults to 100):
9090
Add a number of extra ids added to the end of the vocabulary for use as sentinels. These tokens are
9191
accessible as "<extra_id_{%d}>" where "{%d}" is a number between 0 and extra_ids-1. Extra tokens are
92-
indexed from the end of the vocabulary up to beginnning ("<extra_id_0>" is the last token in the vocabulary
92+
indexed from the end of the vocabulary up to beginning ("<extra_id_0>" is the last token in the vocabulary
9393
like in T5 preprocessing see `here
9494
<https://github.com/google-research/text-to-text-transfer-transformer/blob/9fd7b14a769417be33bc6c850f9598764913c833/t5/data/preprocessors.py#L2117>`__).
9595
additional_special_tokens (:obj:`List[str]`, `optional`):

src/transformers/tokenization_t5_fast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class T5TokenizerFast(PreTrainedTokenizerFast):
100100
extra_ids (:obj:`int`, `optional`, defaults to 100):
101101
Add a number of extra ids added to the end of the vocabulary for use as sentinels. These tokens are
102102
accessible as "<extra_id_{%d}>" where "{%d}" is a number between 0 and extra_ids-1. Extra tokens are
103-
indexed from the end of the vocabulary up to beginnning ("<extra_id_0>" is the last token in the vocabulary
103+
indexed from the end of the vocabulary up to beginning ("<extra_id_0>" is the last token in the vocabulary
104104
like in T5 preprocessing see `here
105105
<https://github.com/google-research/text-to-text-transfer-transformer/blob/9fd7b14a769417be33bc6c850f9598764913c833/t5/data/preprocessors.py#L2117>`__).
106106
additional_special_tokens (:obj:`List[str]`, `optional`):

0 commit comments

Comments
 (0)