demavior commited on
Commit
538e95e
·
verified ·
1 Parent(s): 302ebdf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -40,13 +40,14 @@ def transcribe(audio):
40
  device=device,
41
  )
42
 
43
- # Create an attention mask
44
- attention_mask = np.ones(audio_np.shape, dtype=np.int64)
 
 
45
 
46
- # Use EncoderDecoderCache for past_key_values
47
- past_key_values = EncoderDecoderCache.from_legacy_cache(None)
48
 
49
- prediction = pipe(audio_np, attention_mask=attention_mask, past_key_values=past_key_values)["text"]
50
  return prediction
51
 
52
  gradio_app = gr.Interface(
 
40
  device=device,
41
  )
42
 
43
+ # prediction = pipe(audio_np)["text"]
44
+
45
+ ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
46
+ sample = ds[0]["audio"]
47
 
48
+ prediction = pipe(sample.copy(), batch_size=8)["text"]
49
+ print(prediction)
50
 
 
51
  return prediction
52
 
53
  gradio_app = gr.Interface(