Spaces:
Build error
Build error
app.py
CHANGED
@@ -83,7 +83,7 @@ def display_vid(url, question, sample_question=None, example_video=None):
|
|
83 |
if question == '':
|
84 |
question = sample_question
|
85 |
|
86 |
-
#get embedding and youtube link
|
87 |
html_in = "<iframe width='560' height='315' src=" + url + " frameborder='0' allowfullscreen></iframe>"
|
88 |
#print(html)
|
89 |
|
@@ -98,9 +98,9 @@ def display_vid(url, question, sample_question=None, example_video=None):
|
|
98 |
ans_timestamp, ans_timestamp_secondbest = get_answers_timestamp(question, final_transcript, transcript)
|
99 |
|
100 |
#created embedding width='560' height='315'
|
101 |
-
html_out = "<iframe width='
|
102 |
print(f"html output is : {html_out}")
|
103 |
-
html_out_secondbest = "<iframe width='
|
104 |
|
105 |
if question == '':
|
106 |
print(f"Inside display_vid(), Sample_Question coming from Radio box is BEFORE : {sample_question}")
|
@@ -123,11 +123,14 @@ with demo:
|
|
123 |
gr.Markdown(
|
124 |
"""### How many times have you seen a long video/podcast on Youtube and wondered only if there would have been 'explanatory' timestamps it would have been so much better..
|
125 |
**How to use this space:** You can either provide a new YouTube video link or can use the sample video link provided. Then provide a Questions that you would like about exploring the content in the given video.
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
131 |
)
|
132 |
with gr.Row():
|
133 |
input_url = gr.Textbox(label="Input a Youtube video link") #gr.HTML(placeholder="Enter a video link here..")
|
@@ -164,8 +167,7 @@ with demo:
|
|
164 |
"does the video discuss multilingual language models?",
|
165 |
"whar is the cool library?"], label= "Choose a sample Question", value=None)
|
166 |
with gr.Row():
|
167 |
-
example_video = gr.CheckboxGroup( ["https://www.youtube.com/watch?v=smUHQndcmOY"], label= "Choose a sample YouTube video")
|
168 |
-
#example_question.update(set_example_question) #,inputs=example_question, outputs= input_url) #example_styles.components)
|
169 |
|
170 |
b1 = gr.Button("Publish Video")
|
171 |
|
|
|
83 |
if question == '':
|
84 |
question = sample_question
|
85 |
|
86 |
+
#get embedding and youtube link for initial video
|
87 |
html_in = "<iframe width='560' height='315' src=" + url + " frameborder='0' allowfullscreen></iframe>"
|
88 |
#print(html)
|
89 |
|
|
|
98 |
ans_timestamp, ans_timestamp_secondbest = get_answers_timestamp(question, final_transcript, transcript)
|
99 |
|
100 |
#created embedding width='560' height='315'
|
101 |
+
html_out = "<iframe width='720' height='400' src='https://www.youtube.com/embed/" + video_id + "?start=" + str(ans_timestamp) + "' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>"
|
102 |
print(f"html output is : {html_out}")
|
103 |
+
html_out_secondbest = "<iframe width='720' height='400' src='https://www.youtube.com/embed/" + video_id + "?start=" + str(ans_timestamp_secondbest) + "' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>"
|
104 |
|
105 |
if question == '':
|
106 |
print(f"Inside display_vid(), Sample_Question coming from Radio box is BEFORE : {sample_question}")
|
|
|
123 |
gr.Markdown(
|
124 |
"""### How many times have you seen a long video/podcast on Youtube and wondered only if there would have been 'explanatory' timestamps it would have been so much better..
|
125 |
**How to use this space:** You can either provide a new YouTube video link or can use the sample video link provided. Then provide a Questions that you would like about exploring the content in the given video.
|
126 |
+
The App will generate timestamps and Play the video at those timestamps for you in the space provided. You will see two video displays, corresponding to two of the best guesses by the underlying models. Chances are that both videos might start with same timestamp, which will depend on the question and the content in the video, please bear! Also, a small caveat, the App will perform as good as the available English Transcripts are for the given YouTube Video. If there are no transcripts, the App will not work.
|
127 |
+
|
128 |
+
**Motivation behind building this App:** When we see a long video without timestamps, we often wonder 'if' the content we are looking for is in there, or 'where' in the video is the content we are looking for? The Idea is that we might have questions like 'Is the xxxx thing covered in this video?', or maybe 'does the host talks about the architecture of the xxxxx model', or maybe 'Does host talk about alien doorway on Mars?' and so on.
|
129 |
+
|
130 |
+
So this App could help you in reaching to that timestamp in 'Record time'!
|
131 |
+
|
132 |
+
**Best part:** You don't even have to move away from the Space tab in your browser as the YouTube video gets played within the given View.
|
133 |
+
"""
|
134 |
)
|
135 |
with gr.Row():
|
136 |
input_url = gr.Textbox(label="Input a Youtube video link") #gr.HTML(placeholder="Enter a video link here..")
|
|
|
167 |
"does the video discuss multilingual language models?",
|
168 |
"whar is the cool library?"], label= "Choose a sample Question", value=None)
|
169 |
with gr.Row():
|
170 |
+
example_video = gr.CheckboxGroup( ["https://www.youtube.com/watch?v=smUHQndcmOY"], label= "Choose a sample YouTube video")
|
|
|
171 |
|
172 |
b1 = gr.Button("Publish Video")
|
173 |
|