Spaces:
Sleeping
Sleeping
update app.py to use GPU zero
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import torch
|
2 |
|
3 |
import gradio as gr
|
|
|
4 |
import yt_dlp as youtube_dl
|
5 |
from transformers import pipeline
|
6 |
from transformers.pipelines.audio_utils import ffmpeg_read
|
@@ -22,7 +23,7 @@ pipe = pipeline(
|
|
22 |
device=device,
|
23 |
)
|
24 |
|
25 |
-
|
26 |
def transcribe(inputs, task):
|
27 |
if inputs is None:
|
28 |
raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
|
|
|
1 |
import torch
|
2 |
|
3 |
import gradio as gr
|
4 |
+
import spaces
|
5 |
import yt_dlp as youtube_dl
|
6 |
from transformers import pipeline
|
7 |
from transformers.pipelines.audio_utils import ffmpeg_read
|
|
|
23 |
device=device,
|
24 |
)
|
25 |
|
26 |
+
@spaces.GPU
|
27 |
def transcribe(inputs, task):
|
28 |
if inputs is None:
|
29 |
raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
|