Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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 |
-
|
|
|
|
| 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",
|