Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -123,15 +123,14 @@ def play_video(youtube_url):
|
|
123 |
|
124 |
|
125 |
AUDIO_EXAMPLES = glob.glob('examples/*.*', recursive=True)
|
126 |
-
YOUTUBE_EXAMPLES = ["https://
|
|
|
127 |
"https://youtu.be/OXXRoa1U6xU?si=nhJ6lzGenCmk4P7R",
|
128 |
"https://youtu.be/EOJ0wH6h3rE?si=a99k6BnSajvNmXcn",
|
129 |
"https://youtu.be/7mjQooXt28o?si=qqmMxCxwqBlLPDI2",
|
130 |
"https://youtu.be/bnS-HK_lTHA?si=PQLVAab3QHMbv0S3https://youtu.be/zJB0nnOc7bM?si=EA1DN8nHWJcpQWp_",
|
131 |
"https://youtu.be/mIWYTg55h10?si=WkbtKfL6NlNquvT8"]
|
132 |
|
133 |
-
# theme = 'gradio/dracula_revamped' #'Insuz/Mocha' #gr.themes.Soft()
|
134 |
-
# with gr.Blocks(theme=theme) as demo:
|
135 |
theme = gr.Theme.from_hub("gradio/dracula_revamped")
|
136 |
theme.text_md = '9px'
|
137 |
theme.text_lg = '11px'
|
@@ -152,15 +151,9 @@ css = """
|
|
152 |
height: 100vh;
|
153 |
}
|
154 |
@keyframes gradient {
|
155 |
-
0% {
|
156 |
-
|
157 |
-
}
|
158 |
-
50% {
|
159 |
-
background-position: 100% 50%;
|
160 |
-
}
|
161 |
-
100% {
|
162 |
-
background-position: 0% 50%;
|
163 |
-
}
|
164 |
}
|
165 |
"""
|
166 |
|
@@ -217,25 +210,26 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
217 |
transcribe_audio_button.click(process_audio, inputs=audio_input, outputs=output_tab1)
|
218 |
|
219 |
with gr.Tab("From YouTube"):
|
220 |
-
with gr.
|
221 |
# Input URL
|
222 |
youtube_url = gr.Textbox(label="YouTube Link URL",
|
223 |
placeholder="https://youtu.be/...")
|
224 |
-
#
|
225 |
-
|
226 |
-
with gr.Row():
|
227 |
# Play button
|
228 |
play_video_button = gr.Button("Get Audio from YouTube", variant="primary")
|
|
|
|
|
|
|
|
|
229 |
# Submit button
|
230 |
transcribe_video_button = gr.Button("Transcribe", variant="primary")
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
# Display examples
|
239 |
-
gr.Examples(examples=YOUTUBE_EXAMPLES, inputs=youtube_url)
|
240 |
|
241 |
demo.launch(debug=True)
|
|
|
123 |
|
124 |
|
125 |
AUDIO_EXAMPLES = glob.glob('examples/*.*', recursive=True)
|
126 |
+
YOUTUBE_EXAMPLES = ["https://youtu.be/5vJBhdjvVcE?si=s3NFG_SlVju0Iklg",
|
127 |
+
"https://www.youtube.com/watch?v=vMboypSkj3c",
|
128 |
"https://youtu.be/OXXRoa1U6xU?si=nhJ6lzGenCmk4P7R",
|
129 |
"https://youtu.be/EOJ0wH6h3rE?si=a99k6BnSajvNmXcn",
|
130 |
"https://youtu.be/7mjQooXt28o?si=qqmMxCxwqBlLPDI2",
|
131 |
"https://youtu.be/bnS-HK_lTHA?si=PQLVAab3QHMbv0S3https://youtu.be/zJB0nnOc7bM?si=EA1DN8nHWJcpQWp_",
|
132 |
"https://youtu.be/mIWYTg55h10?si=WkbtKfL6NlNquvT8"]
|
133 |
|
|
|
|
|
134 |
theme = gr.Theme.from_hub("gradio/dracula_revamped")
|
135 |
theme.text_md = '9px'
|
136 |
theme.text_lg = '11px'
|
|
|
151 |
height: 100vh;
|
152 |
}
|
153 |
@keyframes gradient {
|
154 |
+
0% {background-position: 0% 50%;}
|
155 |
+
50% {background-position: 100% 50%;}
|
156 |
+
100% {background-position: 0% 50%;}
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
}
|
158 |
"""
|
159 |
|
|
|
210 |
transcribe_audio_button.click(process_audio, inputs=audio_input, outputs=output_tab1)
|
211 |
|
212 |
with gr.Tab("From YouTube"):
|
213 |
+
with gr.Column(scale=4):
|
214 |
# Input URL
|
215 |
youtube_url = gr.Textbox(label="YouTube Link URL",
|
216 |
placeholder="https://youtu.be/...")
|
217 |
+
# Display examples
|
218 |
+
gr.Examples(examples=YOUTUBE_EXAMPLES, inputs=youtube_url)
|
|
|
219 |
# Play button
|
220 |
play_video_button = gr.Button("Get Audio from YouTube", variant="primary")
|
221 |
+
# Play youtube
|
222 |
+
youtube_player = gr.HTML(render=True)
|
223 |
+
|
224 |
+
with gr.Column(scale=4):
|
225 |
# Submit button
|
226 |
transcribe_video_button = gr.Button("Transcribe", variant="primary")
|
227 |
+
with gr.Column(scale=1):
|
228 |
+
# Transcribe
|
229 |
+
output_tab2 = gr.HTML(render=True)
|
230 |
+
# video_output = gr.Text(label="Video Info")
|
231 |
+
transcribe_video_button.click(process_video, inputs=youtube_url, outputs=output_tab2)
|
232 |
+
# Play
|
233 |
+
play_video_button.click(play_video, inputs=youtube_url, outputs=youtube_player)
|
|
|
|
|
234 |
|
235 |
demo.launch(debug=True)
|