Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse filesupdate imports
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
import yt_dlp as youtube_dl
|
3 |
from transformers import pipeline
|
4 |
from transformers.pipelines.audio_utils import ffmpeg_read
|
|
|
5 |
from huggingface_hub import CommitScheduler
|
6 |
import tempfile
|
7 |
import os
|
@@ -28,6 +29,7 @@ scheduler = CommitScheduler(
|
|
28 |
path_in_repo="data",
|
29 |
)
|
30 |
|
|
|
31 |
def transcribe_audio(inputs, task):
|
32 |
if inputs is None:
|
33 |
raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
|
|
|
2 |
import yt_dlp as youtube_dl
|
3 |
from transformers import pipeline
|
4 |
from transformers.pipelines.audio_utils import ffmpeg_read
|
5 |
+
import torch
|
6 |
from huggingface_hub import CommitScheduler
|
7 |
import tempfile
|
8 |
import os
|
|
|
29 |
path_in_repo="data",
|
30 |
)
|
31 |
|
32 |
+
@spaces.GPU
|
33 |
def transcribe_audio(inputs, task):
|
34 |
if inputs is None:
|
35 |
raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
|