Skip to content

Commit

Permalink
Fix exception cause in audio.py (ggerganov#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-RR authored Sep 23, 2022
1 parent c85eaaa commit 59f543e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion whisper/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def load_audio(file: str, sr: int = SAMPLE_RATE):
.run(cmd="ffmpeg", capture_stdout=True, capture_stderr=True)
)
except ffmpeg.Error as e:
raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}")
raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e

return np.frombuffer(out, np.int16).flatten().astype(np.float32) / 32768.0

Expand Down

0 comments on commit 59f543e

Please sign in to comment.