Spaces:
Runtime error
Runtime error
Commit
•
426e663
1
Parent(s):
f25e7c2
use zero gpu
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ from transformers.pipelines.audio_utils import ffmpeg_read
|
|
4 |
import torch
|
5 |
import gradio as gr
|
6 |
import time
|
|
|
7 |
|
8 |
BATCH_SIZE = 16
|
9 |
MAX_AUDIO_MINS = 30 # maximum audio input in minutes
|
@@ -52,6 +53,7 @@ distil_pipe = pipeline(
|
|
52 |
distil_pipe_forward = distil_pipe._forward
|
53 |
|
54 |
|
|
|
55 |
def transcribe(inputs):
|
56 |
if inputs is None:
|
57 |
raise gr.Error("No audio file submitted! Please record or upload an audio file before submitting your request.")
|
|
|
4 |
import torch
|
5 |
import gradio as gr
|
6 |
import time
|
7 |
+
import spaces
|
8 |
|
9 |
BATCH_SIZE = 16
|
10 |
MAX_AUDIO_MINS = 30 # maximum audio input in minutes
|
|
|
53 |
distil_pipe_forward = distil_pipe._forward
|
54 |
|
55 |
|
56 |
+
@spaces.GPU
|
57 |
def transcribe(inputs):
|
58 |
if inputs is None:
|
59 |
raise gr.Error("No audio file submitted! Please record or upload an audio file before submitting your request.")
|