diff --git a/docs/source/en/model_doc/auto.md b/docs/source/en/model_doc/auto.md index 75d162bbcf..9dbaaf3acb 100644 --- a/docs/source/en/model_doc/auto.md +++ b/docs/source/en/model_doc/auto.md @@ -49,7 +49,7 @@ You will then be able to use the auto classes like you would usually do! -If your `NewModelConfig` is a subclass of [`~transformer.PretrainedConfig`], make sure its +If your `NewModelConfig` is a subclass of [`~transformers.PretrainedConfig`], make sure its `model_type` attribute is set to the same key you use when registering the config (here `"new-model"`). Likewise, if your `NewModel` is a subclass of [`PreTrainedModel`], make sure its diff --git a/docs/source/ja/model_doc/auto.md b/docs/source/ja/model_doc/auto.md index b104e4c99f..c6775493ba 100644 --- a/docs/source/ja/model_doc/auto.md +++ b/docs/source/ja/model_doc/auto.md @@ -43,7 +43,7 @@ AutoModel.register(NewModelConfig, NewModel) -あなたの`NewModelConfig`が[`~transformer.PretrainedConfig`]のサブクラスである場合、その`model_type`属性がコンフィグを登録するときに使用するキー(ここでは`"new-model"`)と同じに設定されていることを確認してください。 +あなたの`NewModelConfig`が[`~transformers.PretrainedConfig`]のサブクラスである場合、その`model_type`属性がコンフィグを登録するときに使用するキー(ここでは`"new-model"`)と同じに設定されていることを確認してください。 同様に、あなたの`NewModel`が[`PreTrainedModel`]のサブクラスである場合、その`config_class`属性がモデルを登録する際に使用するクラス(ここでは`NewModelConfig`)と同じに設定されていることを確認してください。 diff --git a/src/transformers/generation/beam_search.py b/src/transformers/generation/beam_search.py index a46859c88c..a29d34306f 100644 --- a/src/transformers/generation/beam_search.py +++ b/src/transformers/generation/beam_search.py @@ -151,7 +151,7 @@ class BeamSearchScorer(BeamScorer): beam search algorithm). num_beam_hyps_to_keep (`int`, *optional*, defaults to 1): The number of beam hypotheses that shall be returned upon calling - [`~transformer.BeamSearchScorer.finalize`]. + [`~transformers.BeamSearchScorer.finalize`]. num_beam_groups (`int`, *optional*, defaults to 1): Number of groups to divide `num_beams` into in order to ensure diversity among different groups of beams. See [this paper](https://arxiv.org/pdf/1610.02424.pdf) for more details. @@ -444,7 +444,7 @@ class ConstrainedBeamSearchScorer(BeamScorer): beam search algorithm). num_beam_hyps_to_keep (`int`, *optional*, defaults to 1): The number of beam hypotheses that shall be returned upon calling - [`~transformer.BeamSearchScorer.finalize`]. + [`~transformers.BeamSearchScorer.finalize`]. num_beam_groups (`int`, *optional*, defaults to 1): Number of groups to divide `num_beams` into in order to ensure diversity among different groups of beams. See [this paper](https://arxiv.org/pdf/1610.02424.pdf) for more details. diff --git a/src/transformers/trainer.py b/src/transformers/trainer.py index 8d85e50772..add69bbf39 100755 --- a/src/transformers/trainer.py +++ b/src/transformers/trainer.py @@ -650,38 +650,38 @@ class Trainer: def add_callback(self, callback): """ - Add a callback to the current list of [`~transformer.TrainerCallback`]. + Add a callback to the current list of [`~transformers.TrainerCallback`]. Args: - callback (`type` or [`~transformer.TrainerCallback`]): - A [`~transformer.TrainerCallback`] class or an instance of a [`~transformer.TrainerCallback`]. In the + callback (`type` or [`~transformers.TrainerCallback`]): + A [`~transformers.TrainerCallback`] class or an instance of a [`~transformers.TrainerCallback`]. In the first case, will instantiate a member of that class. """ self.callback_handler.add_callback(callback) def pop_callback(self, callback): """ - Remove a callback from the current list of [`~transformer.TrainerCallback`] and returns it. + Remove a callback from the current list of [`~transformers.TrainerCallback`] and returns it. If the callback is not found, returns `None` (and no error is raised). Args: - callback (`type` or [`~transformer.TrainerCallback`]): - A [`~transformer.TrainerCallback`] class or an instance of a [`~transformer.TrainerCallback`]. In the + callback (`type` or [`~transformers.TrainerCallback`]): + A [`~transformers.TrainerCallback`] class or an instance of a [`~transformers.TrainerCallback`]. In the first case, will pop the first member of that class found in the list of callbacks. Returns: - [`~transformer.TrainerCallback`]: The callback removed, if found. + [`~transformers.TrainerCallback`]: The callback removed, if found. """ return self.callback_handler.pop_callback(callback) def remove_callback(self, callback): """ - Remove a callback from the current list of [`~transformer.TrainerCallback`]. + Remove a callback from the current list of [`~transformers.TrainerCallback`]. Args: - callback (`type` or [`~transformer.TrainerCallback`]): - A [`~transformer.TrainerCallback`] class or an instance of a [`~transformer.TrainerCallback`]. In the + callback (`type` or [`~transformers.TrainerCallback`]): + A [`~transformers.TrainerCallback`] class or an instance of a [`~transformers.TrainerCallback`]. In the first case, will remove the first member of that class found in the list of callbacks. """ self.callback_handler.remove_callback(callback) diff --git a/src/transformers/trainer_callback.py b/src/transformers/trainer_callback.py index 5e0c75a1b8..13b2dcb6b0 100644 --- a/src/transformers/trainer_callback.py +++ b/src/transformers/trainer_callback.py @@ -207,7 +207,7 @@ class TrainerCallback: The argument `args`, `state` and `control` are positionals for all events, all the others are grouped in `kwargs`. You can unpack the ones you need in the signature of the event using them. As an example, see the code of the - simple [`~transformer.PrinterCallback`]. + simple [`~transformers.PrinterCallback`]. Example: