Update app.py
Browse files
app.py
CHANGED
@@ -84,13 +84,9 @@ if audio_file:
|
|
84 |
# β
Preprocess Audio with Processor (Corrected)
|
85 |
# ================================
|
86 |
inputs = processor(adversarial_waveform.squeeze().numpy(), sampling_rate=16000, return_tensors="pt", padding=True)
|
87 |
-
|
88 |
-
# Ensure the input has batch dimension (even if it's one example)
|
89 |
-
if len(inputs.input_features.shape) == 1:
|
90 |
-
inputs.input_features = inputs.input_features.unsqueeze(0)
|
91 |
|
92 |
-
#
|
93 |
-
input_features = inputs
|
94 |
|
95 |
# ================================
|
96 |
# β
Fast Transcription Processing with Conformer
|
|
|
84 |
# β
Preprocess Audio with Processor (Corrected)
|
85 |
# ================================
|
86 |
inputs = processor(adversarial_waveform.squeeze().numpy(), sampling_rate=16000, return_tensors="pt", padding=True)
|
|
|
|
|
|
|
|
|
87 |
|
88 |
+
# Ensure the input has batch dimension (even if it's one example)
|
89 |
+
input_features = inputs["input_features"].to("cuda" if torch.cuda.is_available() else "cpu")
|
90 |
|
91 |
# ================================
|
92 |
# β
Fast Transcription Processing with Conformer
|