Update app.py
Browse files
app.py
CHANGED
@@ -63,6 +63,7 @@ def transcribe_audio(audio_path):
|
|
63 |
inputs = {"array": inputs, "sampling_rate": whisper_pipeline.feature_extractor.sampling_rate}
|
64 |
|
65 |
# Perform transcription using Whisper
|
|
|
66 |
result = whisper_pipeline(inputs, batch_size=BATCH_SIZE, return_timestamps=False)
|
67 |
return result["text"]
|
68 |
except Exception as e:
|
@@ -182,6 +183,7 @@ if __name__ == "__main__":
|
|
182 |
|
183 |
|
184 |
|
|
|
185 |
# import os
|
186 |
# import tempfile
|
187 |
# from subprocess import Popen, PIPE
|
|
|
63 |
inputs = {"array": inputs, "sampling_rate": whisper_pipeline.feature_extractor.sampling_rate}
|
64 |
|
65 |
# Perform transcription using Whisper
|
66 |
+
inputs["array"] = inputs["array"].astype(float)
|
67 |
result = whisper_pipeline(inputs, batch_size=BATCH_SIZE, return_timestamps=False)
|
68 |
return result["text"]
|
69 |
except Exception as e:
|
|
|
183 |
|
184 |
|
185 |
|
186 |
+
|
187 |
# import os
|
188 |
# import tempfile
|
189 |
# from subprocess import Popen, PIPE
|