SteveDigital commited on
Commit
c5541dd
·
1 Parent(s): e36067e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -19,6 +19,7 @@ def get_audio(url):
19
  return a
20
 
21
  def get_text(url):
 
22
  result = model.transcribe(get_audio(url))
23
  return result['text']
24
 
@@ -32,6 +33,7 @@ def get_summary(article):
32
  with gr.Blocks() as demo:
33
  gr.Markdown("<h1><center>Free YouTube URL Video to Text using OpenAI's Whisper Model</center></h1>")
34
  gr.Markdown("<center>Enter the link of any YouTube video to generate a text transcript of the video and then create a summary of the video transcript.</center>")
 
35
 
36
  input_text_url = gr.Textbox(placeholder='Youtube video URL', label='URL')
37
  result_button_transcribe = gr.Button('1. Transcribe')
@@ -40,7 +42,7 @@ with gr.Blocks() as demo:
40
  result_button_summary = gr.Button('2. Create Summary')
41
  output_text_summary = gr.Textbox(placeholder='Summary of the YouTube video transcript.', label='Summary')
42
 
43
- result_button_transcribe.click(get_text, inputs=input_text_url, outputs=output_text_transcribe)
44
- result_button_summary.click(get_summary, inputs=output_text_transcribe, outputs=output_text_summary)
45
 
46
  demo.launch(debug = True)
 
19
  return a
20
 
21
  def get_text(url):
22
+ if url != '' : output_text_transcribe = ''
23
  result = model.transcribe(get_audio(url))
24
  return result['text']
25
 
 
33
  with gr.Blocks() as demo:
34
  gr.Markdown("<h1><center>Free YouTube URL Video to Text using OpenAI's Whisper Model</center></h1>")
35
  gr.Markdown("<center>Enter the link of any YouTube video to generate a text transcript of the video and then create a summary of the video transcript.</center>")
36
+ gr.Markdown("<center>Generating the transcript takes 5-10 seconds per minute of the video. #patience</center>")
37
 
38
  input_text_url = gr.Textbox(placeholder='Youtube video URL', label='URL')
39
  result_button_transcribe = gr.Button('1. Transcribe')
 
42
  result_button_summary = gr.Button('2. Create Summary')
43
  output_text_summary = gr.Textbox(placeholder='Summary of the YouTube video transcript.', label='Summary')
44
 
45
+ result_button_transcribe.click(get_text, inputs = input_text_url, outputs = output_text_transcribe)
46
+ result_button_summary.click(get_summary, inputs = output_text_transcribe, outputs = output_text_summary)
47
 
48
  demo.launch(debug = True)