Skip to content

Commit 75be5a0

Browse files
authored
[Whisper] fix docstrings typo (#35319)
typos docstring
1 parent 69e31eb commit 75be5a0

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/transformers/models/whisper/generation_whisper.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def generate(
382382
the soundfile library (`pip install soundfile`). To prepare the array into `input_features`, the
383383
[`AutoFeatureExtractor`] should be used for extracting the mel features, padding and conversion into a
384384
tensor of type `torch.FloatTensor`. See [`~WhisperFeatureExtractor.__call__`] for details.
385-
generation_config (`~generation.GenerationConfig`, *optional*):
385+
generation_config ([`~generation.GenerationConfig`], *optional*):
386386
The generation configuration to be used as base parametrization for the generation call. `**kwargs`
387387
passed to generate matching the attributes of `generation_config` will override them. If
388388
`generation_config` is not provided, the default will be used, which had the following loading
@@ -480,8 +480,8 @@ def generate(
480480
`return_segments` is set True. In this case the generation outputs of each segment is added to each
481481
segment.
482482
force_unique_generate_call (`bool`, *optional*):
483-
Whether to force a unique call to the underlying GenerationMixin's generate method. This is useful for assisted decoding and testing purposes to ensure
484-
that only one call to generate is made and therefore decoder input token ids and eos token ids are returned.
483+
Whether to force a unique call to the underlying GenerationMixin's [~generation.GenerationMixin.generate] method. This is useful for assisted decoding and testing purposes to ensure
484+
that only one call to [~generation.GenerationMixin.generate] is made and therefore decoder input token ids and eos token ids are returned.
485485
kwargs (`Dict[str, Any]`, *optional*):
486486
Ad hoc parametrization of `generate_config` and/or additional model-specific kwargs that will be
487487
forwarded to the `forward` function of the model. If the model is an encoder-decoder model, encoder
@@ -495,18 +495,18 @@ def generate(
495495
- `torch.LongTensor` in all other cases, excluding the decoder input ids and end of sequence id.
496496
497497
The possible [`~utils.ModelOutput`] types are:
498-
- [`~utils.GenerateEncoderDecoderOutput`]
499-
- [`~utils.GenerateBeamEncoderDecoderOutput`]
498+
- [`~generation.GenerateEncoderDecoderOutput`]
499+
- [`~generation.GenerateBeamEncoderDecoderOutput`]
500500
501501
`segments` is a list of lists (one list per batch element) of `segment`.
502502
A `segment` is a dictionary with keys `start`, `end`, `tokens`, `idxs`, and `result`.
503503
- `start`: the start timestamp of the segment.
504504
- `end`: the end timestamp of the segment.
505505
- `tokens`: the tokens of the segment, excluding the decoder input ids and end of sequence id.
506-
- `idxs`: the start (included) and end (excluded) indices of the `tokens` of the segment in the underlying call to GenerationMixin's `generate` (present in `result`).
507-
- `result`: the result of the underlying call to GenerationMixin's `generate`.
506+
- `idxs`: the start (included) and end (excluded) indices of the `tokens` of the segment in the underlying call to GenerationMixin's [~generation.GenerationMixin.generate] (present in `result`).
507+
- `result`: the result of the underlying call to GenerationMixin's [~generation.GenerationMixin.generate].
508508
509-
When `return_timestamps=True`, `return_dict_in_generate=True` applies to each call of the underlying GenerationMixin's `generate`, with outputs stored in `result` of each `segment`.
509+
When `return_timestamps=True`, `return_dict_in_generate=True` applies to each call of the underlying GenerationMixin's [~generation.GenerationMixin.generate], with outputs stored in `result` of each `segment`.
510510
511511
Example:
512512
@@ -543,7 +543,7 @@ def generate(
543543
```
544544
545545
- *Shortform transcription*: If passed mel input features are <= 30 seconds, there are two possibilities:
546-
- `return_timestamps=False`: the whole audio will be transcribed with a single call to GenerationMixin's generate.
546+
- `return_timestamps=False`: the whole audio will be transcribed with a single call to GenerationMixin's [~generation.GenerationMixin.generate].
547547
- `return_timestamps=True`: the audio will be transcribed using the same logic as long-form transcription.
548548
549549
```python

0 commit comments

Comments
 (0)