Spaces:
Build error
Build error
Campfireman
commited on
Commit
•
921236f
1
Parent(s):
4f21df2
Update app.py
Browse files
app.py
CHANGED
@@ -97,34 +97,22 @@ def transcribe2(audio):
|
|
97 |
text = pipe(audio)["text"]
|
98 |
return text
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
with gr.Blocks() as demo:
|
108 |
-
with gr.TabItem("Record from microphone"):
|
109 |
-
|
110 |
-
record_file = gr.Audio(source="microphone", type="filepath",label="Record from microphone")
|
111 |
-
record_button = gr.Button("Submit for recognition")
|
112 |
-
record_outputs = "text"
|
113 |
-
with gr.TabItem("Transcribe from Youtube URL"):
|
114 |
-
url = gr.Textbox(label = "Enter the URL of the Youtube video clip here (without prefixes like http://):"),
|
115 |
-
youtube_button = gr.Button("Submit for recognition")
|
116 |
-
youtube_outputs = "text"
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
inputs=url,
|
126 |
-
outputs=youtube_outputs,
|
127 |
-
)
|
128 |
|
|
|
129 |
|
130 |
demo.launch()
|
|
|
97 |
text = pipe(audio)["text"]
|
98 |
return text
|
99 |
|
100 |
+
iface = gr.Interface(
|
101 |
+
fn=transcribe,
|
102 |
+
inputs=gr.Textbox(label = "Enter the URL of the Youtube video clip here (without prefixes like http://):"),
|
103 |
+
outputs="text",
|
104 |
+
title="Whisper Small SE",
|
105 |
+
description="Video Swedish Transcriptior",
|
106 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
|
108 |
+
iface2 = gr.Interface(
|
109 |
+
fn=transcribe2,
|
110 |
+
inputs=gr.Audio(source="microphone", type="filepath"),
|
111 |
+
outputs="text",
|
112 |
+
title="Whisper Small Swedish",
|
113 |
+
description="Realtime demo for Swedish speech recognition using a fine-tuned Whisper small model.",
|
114 |
+
)
|
|
|
|
|
|
|
115 |
|
116 |
+
demo = gr.TabbedInterface([iface, iface2],
|
117 |
|
118 |
demo.launch()
|