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
6fb58d30
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "6b09328368324d170504c14bcd202856d0f851a3"
Unverified
Commit
6fb58d30
authored
Jul 15, 2021
by
Will Rice
Committed by
GitHub
Jul 15, 2021
Browse files
Fix typo in example (#12716)
parent
8244c5ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/models/speech_to_text/modeling_speech_to_text.py
...sformers/models/speech_to_text/modeling_speech_to_text.py
+2
-2
No files found.
src/transformers/models/speech_to_text/modeling_speech_to_text.py
View file @
6fb58d30
...
...
@@ -1283,7 +1283,7 @@ class Speech2TextForConditionalGeneration(Speech2TextPreTrainedModel):
>>> import soundfile as sf
>>> model = Speech2TextForConditionalGeneration.from_pretrained("facebook/s2t-small-librispeech-asr")
>>> processor = Speech2Text
p
rocessor.from_pretrained("facebook/s2t-small-librispeech-asr")
>>> processor = Speech2Text
P
rocessor.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)
...
...
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