Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,9 @@ from transformers.pipelines.audio_utils import ffmpeg_read
|
|
8 |
import tempfile
|
9 |
import os
|
10 |
|
|
|
|
|
|
|
11 |
MODEL_NAME = "kotoba-tech/kotoba-whisper-v1.0"
|
12 |
BATCH_SIZE = 8
|
13 |
FILE_LIMIT_MB = 1000
|
@@ -74,7 +77,7 @@ def yt_transcribe(yt_url, max_filesize=75.0):
|
|
74 |
demo = gr.Blocks()
|
75 |
mf_transcribe = gr.Interface(
|
76 |
fn=transcribe,
|
77 |
-
inputs=[gr.
|
78 |
outputs="text",
|
79 |
layout="horizontal",
|
80 |
theme="huggingface",
|
@@ -85,7 +88,7 @@ mf_transcribe = gr.Interface(
|
|
85 |
|
86 |
file_transcribe = gr.Interface(
|
87 |
fn=transcribe,
|
88 |
-
inputs=[gr.
|
89 |
outputs="text",
|
90 |
layout="horizontal",
|
91 |
theme="huggingface",
|
@@ -95,7 +98,7 @@ file_transcribe = gr.Interface(
|
|
95 |
)
|
96 |
yt_transcribe = gr.Interface(
|
97 |
fn=yt_transcribe,
|
98 |
-
inputs=[gr.
|
99 |
outputs=["html", "text"],
|
100 |
layout="horizontal",
|
101 |
theme="huggingface",
|
|
|
8 |
import tempfile
|
9 |
import os
|
10 |
|
11 |
+
os.system("pip uninstall -y gradio")
|
12 |
+
os.system("pip install gradio==3.50")
|
13 |
+
|
14 |
MODEL_NAME = "kotoba-tech/kotoba-whisper-v1.0"
|
15 |
BATCH_SIZE = 8
|
16 |
FILE_LIMIT_MB = 1000
|
|
|
77 |
demo = gr.Blocks()
|
78 |
mf_transcribe = gr.Interface(
|
79 |
fn=transcribe,
|
80 |
+
inputs=[gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
|
81 |
outputs="text",
|
82 |
layout="horizontal",
|
83 |
theme="huggingface",
|
|
|
88 |
|
89 |
file_transcribe = gr.Interface(
|
90 |
fn=transcribe,
|
91 |
+
inputs=[gr.inputs.Audio(source="upload", type="filepath", optional=True, label="Audio file")],
|
92 |
outputs="text",
|
93 |
layout="horizontal",
|
94 |
theme="huggingface",
|
|
|
98 |
)
|
99 |
yt_transcribe = gr.Interface(
|
100 |
fn=yt_transcribe,
|
101 |
+
inputs=[gr.inputs.Textbox(lines=1, placeholder="Paste the URL to a YouTube video here", label="YouTube URL")],
|
102 |
outputs=["html", "text"],
|
103 |
layout="horizontal",
|
104 |
theme="huggingface",
|