Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import gradio as gr
|
|
4 |
import pytube as pt
|
5 |
from transformers import pipeline
|
6 |
|
7 |
-
MODEL_NAME = "openai/whisper-
|
8 |
BATCH_SIZE = 8
|
9 |
|
10 |
device = 0 if torch.cuda.is_available() else "cpu"
|
@@ -39,7 +39,7 @@ def transcribe(microphone, file_upload, task):
|
|
39 |
|
40 |
text = pipe(file, batch_size=BATCH_SIZE)["text"]
|
41 |
|
42 |
-
return warn_output + text
|
43 |
|
44 |
|
45 |
def _return_yt_html_embed(yt_url):
|
@@ -73,7 +73,7 @@ mf_transcribe = gr.Interface(
|
|
73 |
gr.inputs.Audio(source="upload", type="filepath", optional=True),
|
74 |
gr.inputs.Radio(["transcribe", "translate"], label="Task", default="transcribe"),
|
75 |
],
|
76 |
-
outputs=
|
77 |
layout="horizontal",
|
78 |
theme="huggingface",
|
79 |
title="Whisper Large V2: Transcribe Audio",
|
|
|
4 |
import pytube as pt
|
5 |
from transformers import pipeline
|
6 |
|
7 |
+
MODEL_NAME = "openai/whisper-tiny"
|
8 |
BATCH_SIZE = 8
|
9 |
|
10 |
device = 0 if torch.cuda.is_available() else "cpu"
|
|
|
39 |
|
40 |
text = pipe(file, batch_size=BATCH_SIZE)["text"]
|
41 |
|
42 |
+
return warn_output + text
|
43 |
|
44 |
|
45 |
def _return_yt_html_embed(yt_url):
|
|
|
73 |
gr.inputs.Audio(source="upload", type="filepath", optional=True),
|
74 |
gr.inputs.Radio(["transcribe", "translate"], label="Task", default="transcribe"),
|
75 |
],
|
76 |
+
outputs="text",
|
77 |
layout="horizontal",
|
78 |
theme="huggingface",
|
79 |
title="Whisper Large V2: Transcribe Audio",
|