Spaces:
Running
on
Zero
Running
on
Zero
add attention mask
Browse files- whisper.py +2 -1
whisper.py
CHANGED
|
@@ -21,7 +21,8 @@ def generate(audio_path):
|
|
| 21 |
input_speech = input_audio[0]
|
| 22 |
|
| 23 |
input_features = processor(input_speech,
|
| 24 |
-
sampling_rate=16_000,
|
|
|
|
| 25 |
return_tensors="pt", torch_dtype=torch_dtype).input_features.to(device)
|
| 26 |
|
| 27 |
pred_ids = model.generate(input_features,
|
|
|
|
| 21 |
input_speech = input_audio[0]
|
| 22 |
|
| 23 |
input_features = processor(input_speech,
|
| 24 |
+
sampling_rate=16_000,
|
| 25 |
+
return_attention_mask=True,
|
| 26 |
return_tensors="pt", torch_dtype=torch_dtype).input_features.to(device)
|
| 27 |
|
| 28 |
pred_ids = model.generate(input_features,
|