SteveDigital commited on
Commit
fe55d4b
1 Parent(s): 4d713e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -1,12 +1,12 @@
1
  import whisper
2
  from pytube import YouTube
3
- from transformers import pipeline
4
  import gradio as gr
5
  import os
6
  import re
7
 
8
  model = whisper.load_model("large")
9
- summarizer = pipeline("summarization")
10
 
11
  def get_audio(url):
12
  try:
@@ -45,7 +45,8 @@ def get_summary(article):
45
 
46
  with gr.Blocks() as demo:
47
  gr.Markdown("<h1><center>Free Fast YouTube URL Video-to-Text using <a href=https://openai.com/blog/whisper/ target=_blank>OpenAI's Whisper</a> Model</center></h1>")
48
- 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>")
 
49
  gr.Markdown("<center><b>'Whisper is a neural net that approaches human level robustness and accuracy on English speech recognition.'</b></center>")
50
  gr.Markdown("<center>Transcription takes 5-10 seconds per minute of the video (bad audio/hard accents slow it down a bit). #patience<br />If you have time while waiting, check out my <a href=https://www.artificial-intelligence.blog target=_blank>AI blog</a> (opens in new tab).</center>")
51
 
@@ -53,10 +54,10 @@ with gr.Blocks() as demo:
53
  result_button_transcribe = gr.Button('1. Transcribe')
54
  output_text_transcribe = gr.Textbox(placeholder='Transcript of the YouTube video.', label='Transcript')
55
 
56
- result_button_summary = gr.Button('2. Create Summary')
57
- output_text_summary = gr.Textbox(placeholder='Summary of the YouTube video transcript.', label='Summary')
58
 
59
  result_button_transcribe.click(get_text, inputs = input_text_url, outputs = output_text_transcribe)
60
- result_button_summary.click(get_summary, inputs = output_text_transcribe, outputs = output_text_summary)
61
 
62
  demo.queue(default_enabled = True).launch(debug = True)
 
1
  import whisper
2
  from pytube import YouTube
3
+ #from transformers import pipeline
4
  import gradio as gr
5
  import os
6
  import re
7
 
8
  model = whisper.load_model("large")
9
+ #summarizer = pipeline("summarization")
10
 
11
  def get_audio(url):
12
  try:
 
45
 
46
  with gr.Blocks() as demo:
47
  gr.Markdown("<h1><center>Free Fast YouTube URL Video-to-Text using <a href=https://openai.com/blog/whisper/ target=_blank>OpenAI's Whisper</a> Model</center></h1>")
48
+ #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>")
49
+ gr.Markdown("<center>Enter the link of any YouTube video to generate a text transcript of the video.</center>")
50
  gr.Markdown("<center><b>'Whisper is a neural net that approaches human level robustness and accuracy on English speech recognition.'</b></center>")
51
  gr.Markdown("<center>Transcription takes 5-10 seconds per minute of the video (bad audio/hard accents slow it down a bit). #patience<br />If you have time while waiting, check out my <a href=https://www.artificial-intelligence.blog target=_blank>AI blog</a> (opens in new tab).</center>")
52
 
 
54
  result_button_transcribe = gr.Button('1. Transcribe')
55
  output_text_transcribe = gr.Textbox(placeholder='Transcript of the YouTube video.', label='Transcript')
56
 
57
+ #result_button_summary = gr.Button('2. Create Summary')
58
+ #output_text_summary = gr.Textbox(placeholder='Summary of the YouTube video transcript.', label='Summary')
59
 
60
  result_button_transcribe.click(get_text, inputs = input_text_url, outputs = output_text_transcribe)
61
+ #result_button_summary.click(get_summary, inputs = output_text_transcribe, outputs = output_text_summary)
62
 
63
  demo.queue(default_enabled = True).launch(debug = True)