raihanrifaldi commited on
Commit
70ce03e
·
1 Parent(s): c98a50a

update off (youtube url)

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -348,10 +348,10 @@ def speech_to_text(video_file_path, selected_source_lang, whisper_model, num_spe
348
  # ---- Gradio Layout -----
349
  # Inspiration from https://huggingface.co/spaces/RASMUS/Whisper-youtube-crosslingual-subtitles
350
  video_in = gr.Video(label="Video file", mirror_webcam=False)
351
- youtube_url_in = gr.Textbox(label="Youtube url", lines=1, interactive=True)
352
  df_init = pd.DataFrame(columns=['Start', 'End', 'Speaker', 'Text'])
353
  memory = psutil.virtual_memory()
354
- selected_source_lang = gr.Dropdown(choices=source_language_list, type="value", value="Indonesia", label="Bahasa", interactive=True)
355
  selected_whisper_model = gr.Dropdown(choices=whisper_models, type="value", value="base", label="Whisper model", interactive=True)
356
  number_speakers = gr.Number(precision=0, value=0, label="Masukkan jumlah pembicara untuk hasil yang lebih baik. Jika nilai=0, model akan secara otomatis menemukan jumlah pembicara terbaik.", interactive=True)
357
  system_info = gr.Markdown(f"*Memory: {memory.total / (1024 * 1024 * 1024):.2f}GB, used: {memory.percent}%, available: {memory.available / (1024 * 1024 * 1024):.2f}GB*")
@@ -392,13 +392,13 @@ with demo:
392
  # label="Examples", inputs=[youtube_url_in])
393
 
394
 
395
- with gr.Row():
396
- with gr.Column():
397
- youtube_url_in.render()
398
- download_youtube_btn = gr.Button("Download Youtube video")
399
- download_youtube_btn.click(get_youtube, [youtube_url_in], [
400
- video_in])
401
- print(video_in)
402
 
403
 
404
  with gr.Row():
 
348
  # ---- Gradio Layout -----
349
  # Inspiration from https://huggingface.co/spaces/RASMUS/Whisper-youtube-crosslingual-subtitles
350
  video_in = gr.Video(label="Video file", mirror_webcam=False)
351
+ # youtube_url_in = gr.Textbox(label="Youtube url", lines=1, interactive=True)
352
  df_init = pd.DataFrame(columns=['Start', 'End', 'Speaker', 'Text'])
353
  memory = psutil.virtual_memory()
354
+ selected_source_lang = gr.Dropdown(choices=source_language_list, type="value", value="id", label="Bahasa", interactive=True)
355
  selected_whisper_model = gr.Dropdown(choices=whisper_models, type="value", value="base", label="Whisper model", interactive=True)
356
  number_speakers = gr.Number(precision=0, value=0, label="Masukkan jumlah pembicara untuk hasil yang lebih baik. Jika nilai=0, model akan secara otomatis menemukan jumlah pembicara terbaik.", interactive=True)
357
  system_info = gr.Markdown(f"*Memory: {memory.total / (1024 * 1024 * 1024):.2f}GB, used: {memory.percent}%, available: {memory.available / (1024 * 1024 * 1024):.2f}GB*")
 
392
  # label="Examples", inputs=[youtube_url_in])
393
 
394
 
395
+ # with gr.Row():
396
+ # with gr.Column():
397
+ # youtube_url_in.render()
398
+ # download_youtube_btn = gr.Button("Download Youtube video")
399
+ # download_youtube_btn.click(get_youtube, [youtube_url_in], [
400
+ # video_in])
401
+ # print(video_in)
402
 
403
 
404
  with gr.Row():