Skip to content

Commit

Permalink
Fix typo in example (#12716)
Browse files Browse the repository at this point in the history
  • Loading branch information
will-rice authored Jul 15, 2021
1 parent 8244c5a commit 6fb58d3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ def forward(
>>> import soundfile as sf
>>> model = Speech2TextForConditionalGeneration.from_pretrained("facebook/s2t-small-librispeech-asr")
>>> processor = Speech2Textprocessor.from_pretrained("facebook/s2t-small-librispeech-asr")
>>> processor = Speech2TextProcessor.from_pretrained("facebook/s2t-small-librispeech-asr")
>>> def map_to_array(batch):
>>> speech, _ = sf.read(batch["file"])
Expand All @@ -1293,7 +1293,7 @@ def forward(
>>> ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
>>> ds = ds.map(map_to_array)
>>> input_features = processor(ds["speech"][0], sampling_rate=16_000, return_tensors="pt").input_features # Batch size 1
>>> input_features = processor(ds["speech"][0], sampling_rate=16000, return_tensors="pt").input_features # Batch size 1
>>> generated_ids = model.generate(input_ids=input_features)
>>> transcription = processor.batch_decode(generated_ids)
Expand Down

0 comments on commit 6fb58d3

Please sign in to comment.