mfidabel commited on
Commit
e1d5e25
·
verified ·
1 Parent(s): 8fb7d8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -28,7 +28,8 @@ def transcribe(audio):
28
  sr, y = audio
29
  y = y.astype(np.float32)
30
  y /= np.max(np.abs(y))
31
- return pipeline({"sampling_rate": sr, "raw": y.astype(np.half)}, generate_kwargs={"forced_decoder_ids": forced_decoder_ids}, max_new_tokens=255)["text"]
 
32
 
33
  examples = [
34
  "./examples/audio_1.mp3",
 
28
  sr, y = audio
29
  y = y.astype(np.float32)
30
  y /= np.max(np.abs(y))
31
+ with torch.autocast("cuda"):
32
+ return pipeline({"sampling_rate": sr, "raw": y}, generate_kwargs={"forced_decoder_ids": forced_decoder_ids}, max_new_tokens=255)["text"]
33
 
34
  examples = [
35
  "./examples/audio_1.mp3",