camparchimedes commited on
Commit
46546e2
·
verified ·
1 Parent(s): 23b8d9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -112,8 +112,8 @@ def transcribe_audio(audio_file, chunk_length_s=30):
112
  attention_mask = torch.ones(inputs.input_features.shape[:2], dtype=torch.long, device=device)
113
 
114
  # Check the dimensions and values of the attention mask
115
- assert attention_mask.shape == (2, input_features.shape[2]), "Attention mask dimensions do not match the input features."
116
- assert (attention_mask.sum().item() == input_features.shape[2]), "Attention mask has incorrect values."
117
 
118
  # ASR model inference on the chunk
119
  with torch.no_grad():
 
112
  attention_mask = torch.ones(inputs.input_features.shape[:2], dtype=torch.long, device=device)
113
 
114
  # Check the dimensions and values of the attention mask
115
+ assert attention_mask.shape == (1, input_features.shape[1]), "Attention mask dimensions do not match the input features."
116
+ assert (attention_mask.sum().item() == input_features.shape[1]), "Attention mask has incorrect values."
117
 
118
  # ASR model inference on the chunk
119
  with torch.no_grad():