mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-29 17:22:25 +06:00
Fix typo in example (#12716)
This commit is contained in:
parent
8244c5ad4f
commit
6fb58d30b9
@ -1283,7 +1283,7 @@ class Speech2TextForConditionalGeneration(Speech2TextPreTrainedModel):
|
||||
>>> 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"])
|
||||
@ -1293,7 +1293,7 @@ class Speech2TextForConditionalGeneration(Speech2TextPreTrainedModel):
|
||||
>>> 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)
|
||||
|
Loading…
Reference in New Issue
Block a user