From 3090931da0c4996a35557914c8c4d8edf5635a6f Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Wed, 27 Dec 2023 00:25:00 +1100 Subject: [PATCH] Remove flatten in load_audio --- whisper/audio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whisper/audio.py b/whisper/audio.py index cf6c66a..63d36f9 100644 --- a/whisper/audio.py +++ b/whisper/audio.py @@ -59,7 +59,7 @@ def load_audio(file: str, sr: int = SAMPLE_RATE): except CalledProcessError as e: raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e - return np.frombuffer(out, np.int16).flatten().astype(np.float32) / 32768.0 + return np.frombuffer(out, np.int16).astype(np.float32) / 32768.0 def pad_or_trim(array, length: int = N_SAMPLES, *, axis: int = -1):