tahirsher commited on
Commit
2ff2cbe
Β·
verified Β·
1 Parent(s): add50b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
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
- # Move the input features to the correct device (GPU/CPU)
93
- input_features = inputs.input_features.to("cuda" if torch.cuda.is_available() else "cpu")
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