Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
f2ad4b53
Unverified
Commit
f2ad4b53
authored
Nov 28, 2023
by
Tom Aarsen
Committed by
GitHub
Nov 28, 2023
Browse files
Docs: Fix broken cross-references, i.e. `~transformer.` -> `~transformers.` (#27740)
~transformer. -> ~transformers.
parent
dfbd209c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
docs/source/en/model_doc/auto.md
docs/source/en/model_doc/auto.md
+1
-1
docs/source/ja/model_doc/auto.md
docs/source/ja/model_doc/auto.md
+1
-1
src/transformers/generation/beam_search.py
src/transformers/generation/beam_search.py
+2
-2
src/transformers/trainer.py
src/transformers/trainer.py
+10
-10
src/transformers/trainer_callback.py
src/transformers/trainer_callback.py
+1
-1
No files found.
docs/source/en/model_doc/auto.md
View file @
f2ad4b53
...
...
@@ -49,7 +49,7 @@ You will then be able to use the auto classes like you would usually do!
<Tip
warning=
{true}
>
If your
`NewModelConfig`
is a subclass of [
`~transformer.PretrainedConfig`
], make sure its
If your
`NewModelConfig`
is a subclass of [
`~transformer
s
.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
...
...
docs/source/ja/model_doc/auto.md
View file @
f2ad4b53
...
...
@@ -43,7 +43,7 @@ AutoModel.register(NewModelConfig, NewModel)
<Tip
warning=
{true}
>
あなたの
`NewModelConfig`
が[
`~transformer.PretrainedConfig`
]のサブクラスである場合、その
`model_type`
属性がコンフィグを登録するときに使用するキー(ここでは
`"new-model"`
)と同じに設定されていることを確認してください。
あなたの
`NewModelConfig`
が[
`~transformer
s
.PretrainedConfig`
]のサブクラスである場合、その
`model_type`
属性がコンフィグを登録するときに使用するキー(ここでは
`"new-model"`
)と同じに設定されていることを確認してください。
同様に、あなたの
`NewModel`
が[
`PreTrainedModel`
]のサブクラスである場合、その
`config_class`
属性がモデルを登録する際に使用するクラス(ここでは
`NewModelConfig`
)と同じに設定されていることを確認してください。
...
...
src/transformers/generation/beam_search.py
View file @
f2ad4b53
...
...
@@ -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`].
[`~transformer
s
.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`].
[`~transformer
s
.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.
...
...
src/transformers/trainer.py
View file @
f2ad4b53
...
...
@@ -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 [`~transformer
s
.TrainerCallback`].
Args:
callback (`type` or [`~transformer.TrainerCallback`]):
A [`~transformer.TrainerCallback`] class or an instance of a [`~transformer.TrainerCallback`]. In the
callback (`type` or [`~transformer
s
.TrainerCallback`]):
A [`~transformer
s
.TrainerCallback`] class or an instance of a [`~transformer
s
.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 [`~transformer
s
.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 [`~transformer
s
.TrainerCallback`]):
A [`~transformer
s
.TrainerCallback`] class or an instance of a [`~transformer
s
.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.
[`~transformer
s
.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 [`~transformer
s
.TrainerCallback`].
Args:
callback (`type` or [`~transformer.TrainerCallback`]):
A [`~transformer.TrainerCallback`] class or an instance of a [`~transformer.TrainerCallback`]. In the
callback (`type` or [`~transformer
s
.TrainerCallback`]):
A [`~transformer
s
.TrainerCallback`] class or an instance of a [`~transformer
s
.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
)
...
...
src/transformers/trainer_callback.py
View file @
f2ad4b53
...
...
@@ -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 [`~transformer
s
.PrinterCallback`].
Example:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment