Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -104,10 +104,9 @@ def transcribe_audio(audio_file, chunk_length_s=30):
|
|
104 |
if chunk_waveform.shape[0] > 1:
|
105 |
chunk_waveform = torch.mean(chunk_waveform, dim=0, keepdim=True)
|
106 |
|
107 |
-
# Process the chunk with the tokenizer
|
108 |
-
inputs = processor(chunk_waveform.squeeze(0).numpy(), sampling_rate=sample_rate, return_tensors="pt")
|
109 |
-
|
110 |
-
input_features = inputs.input_features
|
111 |
|
112 |
# Create attention mask
|
113 |
attention_mask = torch.ones(inputs.input_features.shape[:2], dtype=torch.long, device=device)
|
|
|
104 |
if chunk_waveform.shape[0] > 1:
|
105 |
chunk_waveform = torch.mean(chunk_waveform, dim=0, keepdim=True)
|
106 |
|
107 |
+
# Process the chunk with the tokenizer
|
108 |
+
inputs = processor(chunk_waveform.squeeze(0).numpy(), sampling_rate=sample_rate, return_tensors="pt")
|
109 |
+
input_features = inputs.input_features
|
|
|
110 |
|
111 |
# Create attention mask
|
112 |
attention_mask = torch.ones(inputs.input_features.shape[:2], dtype=torch.long, device=device)
|