Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,8 +29,9 @@ def youtube_url_to_text(url, model_id, language_choice):
|
|
| 29 |
video_path (str): The path of the downloaded video.
|
| 30 |
"""
|
| 31 |
video_path = download_and_convert_to_mp3(url)
|
| 32 |
-
|
| 33 |
-
|
|
|
|
| 34 |
|
| 35 |
return transcript, video_path
|
| 36 |
|
|
@@ -114,7 +115,7 @@ def youtube_url_to_text_app():
|
|
| 114 |
examples=[
|
| 115 |
[
|
| 116 |
"https://www.youtube.com/watch?v=di3rHkEZuUw",
|
| 117 |
-
"
|
| 118 |
"English",
|
| 119 |
],
|
| 120 |
],
|
|
@@ -125,7 +126,7 @@ def youtube_url_to_text_app():
|
|
| 125 |
language_choice,
|
| 126 |
],
|
| 127 |
outputs=[output_text, output_audio],
|
| 128 |
-
cache_examples=
|
| 129 |
)
|
| 130 |
|
| 131 |
|
|
@@ -138,13 +139,10 @@ def speaker_diarization_app():
|
|
| 138 |
whisper_model_id = gr.Dropdown(
|
| 139 |
choices=[
|
| 140 |
"openai/whisper-large-v3",
|
| 141 |
-
"
|
| 142 |
-
"
|
| 143 |
-
"openai/whisper-base",
|
| 144 |
-
"openai/whisper-small",
|
| 145 |
-
"openai/whisper-tiny",
|
| 146 |
],
|
| 147 |
-
value="
|
| 148 |
label="Whisper Model",
|
| 149 |
)
|
| 150 |
num_speakers = gr.Number(value=2, label="Number of Speakers")
|
|
@@ -171,7 +169,7 @@ def speaker_diarization_app():
|
|
| 171 |
examples=[
|
| 172 |
[
|
| 173 |
"https://www.youtube.com/shorts/o8PgLUgte2k",
|
| 174 |
-
"
|
| 175 |
2,
|
| 176 |
1,
|
| 177 |
2,
|
|
|
|
| 29 |
video_path (str): The path of the downloaded video.
|
| 30 |
"""
|
| 31 |
video_path = download_and_convert_to_mp3(url)
|
| 32 |
+
output = SpeechToTextPipeline(model_id)
|
| 33 |
+
print(video_path)
|
| 34 |
+
transcript = output(audio_path=video_path, language=language_choice)
|
| 35 |
|
| 36 |
return transcript, video_path
|
| 37 |
|
|
|
|
| 115 |
examples=[
|
| 116 |
[
|
| 117 |
"https://www.youtube.com/watch?v=di3rHkEZuUw",
|
| 118 |
+
"distil-whisper/distil-large-v3",
|
| 119 |
"English",
|
| 120 |
],
|
| 121 |
],
|
|
|
|
| 126 |
language_choice,
|
| 127 |
],
|
| 128 |
outputs=[output_text, output_audio],
|
| 129 |
+
cache_examples=True,
|
| 130 |
)
|
| 131 |
|
| 132 |
|
|
|
|
| 139 |
whisper_model_id = gr.Dropdown(
|
| 140 |
choices=[
|
| 141 |
"openai/whisper-large-v3",
|
| 142 |
+
"distil-whisper/distil-large-v3",
|
| 143 |
+
"distil-whisper/distil-large-v2",
|
|
|
|
|
|
|
|
|
|
| 144 |
],
|
| 145 |
+
value="distil-whisper/distil-large-v3",
|
| 146 |
label="Whisper Model",
|
| 147 |
)
|
| 148 |
num_speakers = gr.Number(value=2, label="Number of Speakers")
|
|
|
|
| 169 |
examples=[
|
| 170 |
[
|
| 171 |
"https://www.youtube.com/shorts/o8PgLUgte2k",
|
| 172 |
+
"distil-whisper/distil-large-v3",
|
| 173 |
2,
|
| 174 |
1,
|
| 175 |
2,
|