ArthurZ HF staff commited on
Commit
7e3649f
1 Parent(s): e00fe1d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -5
README.md CHANGED
@@ -210,15 +210,14 @@ The "<|en|>" token is used to specify that the speech is in english and should b
210
 
211
  >>> # load dummy dataset and read soundfiles
212
  >>> ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
213
-
214
- >>> # tokenize
215
  >>> input_features = processor(ds[0]["audio"]["array"], return_tensors="pt").input_features
216
- >>> # retrieve logits
217
- >>> logits = model(input_features).logits
 
218
  >>> # take argmax and decode
219
  >>> predicted_ids = torch.argmax(logits, dim=-1)
220
  >>> transcription = processor.batch_decode(predicted_ids)
221
- ['<|startoftranscript|><|en|><|notimestamps|> Mr']
222
  ```
223
 
224
  ### French to French
210
 
211
  >>> # load dummy dataset and read soundfiles
212
  >>> ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
 
 
213
  >>> input_features = processor(ds[0]["audio"]["array"], return_tensors="pt").input_features
214
+
215
+ >>> # Generate logits
216
+ >>> logits = model(input_features, decoder_input_ids = torch.tensor([[50258]]).logits
217
  >>> # take argmax and decode
218
  >>> predicted_ids = torch.argmax(logits, dim=-1)
219
  >>> transcription = processor.batch_decode(predicted_ids)
220
+ ['<|en|>']
221
  ```
222
 
223
  ### French to French