ysharma HF Staff commited on
Commit
e97bbe0
·
1 Parent(s): fba419b
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -12,6 +12,7 @@ import torch
12
 
13
  #input - video link, output - full transcript
14
  def get_transcript(link):
 
15
  video_id = link.split("=")[1]
16
  print(f"video id extracted is : {video_id}")
17
  transcript = YouTubeTranscriptApi.get_transcript(video_id)
@@ -21,6 +22,7 @@ def get_transcript(link):
21
 
22
  #input - question and transcript, output - answer timestamp
23
  def get_answers_timestamp(question, transcript):
 
24
  model_ckpt = "deepset/minilm-uncased-squad2"
25
  tokenizer = AutoTokenizer.from_pretrained(model_ckpt)
26
  #question = "any funny examples in video??"
@@ -71,6 +73,7 @@ def get_answers_timestamp(question, transcript):
71
 
72
 
73
  def display_vid(url, question):
 
74
  #https://www.youtube.com/watch?v=smUHQndcmOY&t=425s
75
  #html = HTML("<iframe width='560' height='315' src='https://www.youtube.com/watch?v=smUHQndcmOY&t=425s' frameborder='0' allowfullscreen></iframe>")
76
  #html = "<iframe width='560' height='315' src='https://www.youtube.com/embed/smUHQndcmOY' frameborder='0' allowfullscreen></iframe>"
 
12
 
13
  #input - video link, output - full transcript
14
  def get_transcript(link):
15
+ print("******** Inside get_transcript ********")
16
  video_id = link.split("=")[1]
17
  print(f"video id extracted is : {video_id}")
18
  transcript = YouTubeTranscriptApi.get_transcript(video_id)
 
22
 
23
  #input - question and transcript, output - answer timestamp
24
  def get_answers_timestamp(question, transcript):
25
+ print("******** Inside get_answers_timestamp ********")
26
  model_ckpt = "deepset/minilm-uncased-squad2"
27
  tokenizer = AutoTokenizer.from_pretrained(model_ckpt)
28
  #question = "any funny examples in video??"
 
73
 
74
 
75
  def display_vid(url, question):
76
+ print("******** display_vid ********")
77
  #https://www.youtube.com/watch?v=smUHQndcmOY&t=425s
78
  #html = HTML("<iframe width='560' height='315' src='https://www.youtube.com/watch?v=smUHQndcmOY&t=425s' frameborder='0' allowfullscreen></iframe>")
79
  #html = "<iframe width='560' height='315' src='https://www.youtube.com/embed/smUHQndcmOY' frameborder='0' allowfullscreen></iframe>"