Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -128,6 +128,7 @@ def play_video(youtube_url):
|
|
| 128 |
|
| 129 |
AUDIO_EXAMPLES = glob.glob('examples/*.*', recursive=True)
|
| 130 |
YOUTUBE_EXAMPLES = ["https://www.youtube.com/watch?v=vMboypSkj3c",
|
|
|
|
| 131 |
"https://youtu.be/OXXRoa1U6xU?si=nhJ6lzGenCmk4P7R",
|
| 132 |
"https://youtu.be/EOJ0wH6h3rE?si=a99k6BnSajvNmXcn",
|
| 133 |
"https://youtu.be/7mjQooXt28o?si=qqmMxCxwqBlLPDI2",
|
|
@@ -154,15 +155,9 @@ css = """
|
|
| 154 |
height: 100vh;
|
| 155 |
}
|
| 156 |
@keyframes gradient {
|
| 157 |
-
0% {
|
| 158 |
-
|
| 159 |
-
}
|
| 160 |
-
50% {
|
| 161 |
-
background-position: 100% 50%;
|
| 162 |
-
}
|
| 163 |
-
100% {
|
| 164 |
-
background-position: 0% 50%;
|
| 165 |
-
}
|
| 166 |
}
|
| 167 |
"""
|
| 168 |
|
|
@@ -215,30 +210,29 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
| 215 |
transcribe_audio_button = gr.Button("Transcribe", variant="primary")
|
| 216 |
# Transcribe
|
| 217 |
output_tab1 = gr.HTML()
|
| 218 |
-
# audio_output = gr.Text(label="Audio Info")
|
| 219 |
-
# transcribe_audio_button.click(process_audio, inputs=audio_input, outputs=output_tab1)
|
| 220 |
transcribe_audio_button.click(process_audio, inputs=audio_input, outputs=output_tab1)
|
| 221 |
|
| 222 |
with gr.Tab("From YouTube"):
|
| 223 |
-
with gr.
|
| 224 |
# Input URL
|
| 225 |
youtube_url = gr.Textbox(label="YouTube Link URL",
|
| 226 |
placeholder="https://youtu.be/...")
|
| 227 |
-
#
|
| 228 |
-
|
| 229 |
-
with gr.Row():
|
| 230 |
# Play button
|
| 231 |
play_video_button = gr.Button("Get Audio from YouTube", variant="primary")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
# Submit button
|
| 233 |
transcribe_video_button = gr.Button("Transcribe", variant="primary")
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
# Display examples
|
| 242 |
-
gr.Examples(examples=YOUTUBE_EXAMPLES, inputs=youtube_url)
|
| 243 |
|
| 244 |
demo.launch(debug=True)
|
|
|
|
| 128 |
|
| 129 |
AUDIO_EXAMPLES = glob.glob('examples/*.*', recursive=True)
|
| 130 |
YOUTUBE_EXAMPLES = ["https://www.youtube.com/watch?v=vMboypSkj3c",
|
| 131 |
+
"https://youtu.be/5vJBhdjvVcE?si=s3NFG_SlVju0Iklg",
|
| 132 |
"https://youtu.be/OXXRoa1U6xU?si=nhJ6lzGenCmk4P7R",
|
| 133 |
"https://youtu.be/EOJ0wH6h3rE?si=a99k6BnSajvNmXcn",
|
| 134 |
"https://youtu.be/7mjQooXt28o?si=qqmMxCxwqBlLPDI2",
|
|
|
|
| 155 |
height: 100vh;
|
| 156 |
}
|
| 157 |
@keyframes gradient {
|
| 158 |
+
0% {background-position: 0% 50%;}
|
| 159 |
+
50% {background-position: 100% 50%;}
|
| 160 |
+
100% {background-position: 0% 50%;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
}
|
| 162 |
"""
|
| 163 |
|
|
|
|
| 210 |
transcribe_audio_button = gr.Button("Transcribe", variant="primary")
|
| 211 |
# Transcribe
|
| 212 |
output_tab1 = gr.HTML()
|
|
|
|
|
|
|
| 213 |
transcribe_audio_button.click(process_audio, inputs=audio_input, outputs=output_tab1)
|
| 214 |
|
| 215 |
with gr.Tab("From YouTube"):
|
| 216 |
+
with gr.Column(scale=4):
|
| 217 |
# Input URL
|
| 218 |
youtube_url = gr.Textbox(label="YouTube Link URL",
|
| 219 |
placeholder="https://youtu.be/...")
|
| 220 |
+
# Display examples
|
| 221 |
+
gr.Examples(examples=YOUTUBE_EXAMPLES, inputs=youtube_url)
|
|
|
|
| 222 |
# Play button
|
| 223 |
play_video_button = gr.Button("Get Audio from YouTube", variant="primary")
|
| 224 |
+
# Play youtube
|
| 225 |
+
youtube_player = gr.HTML(render=True)
|
| 226 |
+
|
| 227 |
+
with gr.Column(scale=4):
|
| 228 |
# Submit button
|
| 229 |
transcribe_video_button = gr.Button("Transcribe", variant="primary")
|
| 230 |
+
with gr.Column(scale=1):
|
| 231 |
+
# Transcribe
|
| 232 |
+
output_tab2 = gr.HTML(render=True)
|
| 233 |
+
# video_output = gr.Text(label="Video Info")
|
| 234 |
+
transcribe_video_button.click(process_video, inputs=youtube_url, outputs=output_tab2)
|
| 235 |
+
# Play
|
| 236 |
+
play_video_button.click(play_video, inputs=youtube_url, outputs=youtube_player)
|
|
|
|
|
|
|
| 237 |
|
| 238 |
demo.launch(debug=True)
|