Spaces:
Build error
Build error
Update app.py
Browse files
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 == (
|
116 |
-
assert (attention_mask.sum().item() == input_features.shape[
|
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():
|