kadirnar commited on
Commit
4f7fe11
1 Parent(s): c12540c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -11
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
- pipeline = SpeechToTextPipeline(model_id)
33
- transcript = pipeline(audio_path=video_path, language=language_choice)
 
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
- "openai/whisper-large-v3",
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=False,
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
- "openai/whisper-large",
142
- "openai/whisper-medium",
143
- "openai/whisper-base",
144
- "openai/whisper-small",
145
- "openai/whisper-tiny",
146
  ],
147
- value="openai/whisper-large-v3",
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
- "openai/whisper-large-v3",
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,