Commit
·
744a1c4
1
Parent(s):
4a34fa7
adding video examples as Radio and linking to fn
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def get_text_from_youtube_link(video_link,max_video_length=800):
|
|
34 |
video_text = ""
|
35 |
video_id = video_link.split("watch?v=")[1].split("&")[0]
|
36 |
srt = YouTubeTranscriptApi.get_transcript(video_id)
|
37 |
-
print("SRT "
|
38 |
for text_data in srt:
|
39 |
video_text = video_text + " " + text_data.get("text")
|
40 |
if len(video_text) > max_video_length:
|
@@ -146,7 +146,7 @@ with gr.Blocks(css=css) as demo:
|
|
146 |
|
147 |
with gr.Column():
|
148 |
with gr.Row():
|
149 |
-
LLM_option = gr.Dropdown(['HuggingFace','OpenAI'],label='
|
150 |
API_key = gr.Textbox(label="Add API key", type="password",autofocus=True)
|
151 |
with gr.Accordion(label='Advanced options', open=False):
|
152 |
max_new_tokens = gr.Slider(
|
@@ -165,7 +165,7 @@ with gr.Blocks(css=css) as demo:
|
|
165 |
|
166 |
|
167 |
with gr.Group():
|
168 |
-
chatbot = gr.Chatbot(height=
|
169 |
examples_set = gr.Radio(label="Examples of some You tube Videos",choices=EXAMPLES)
|
170 |
|
171 |
with gr.Row():
|
|
|
34 |
video_text = ""
|
35 |
video_id = video_link.split("watch?v=")[1].split("&")[0]
|
36 |
srt = YouTubeTranscriptApi.get_transcript(video_id)
|
37 |
+
print("SRT ",srt )
|
38 |
for text_data in srt:
|
39 |
video_text = video_text + " " + text_data.get("text")
|
40 |
if len(video_text) > max_video_length:
|
|
|
146 |
|
147 |
with gr.Column():
|
148 |
with gr.Row():
|
149 |
+
LLM_option = gr.Dropdown(['HuggingFace','OpenAI'],label='Select HuggingFace/OpenAI')
|
150 |
API_key = gr.Textbox(label="Add API key", type="password",autofocus=True)
|
151 |
with gr.Accordion(label='Advanced options', open=False):
|
152 |
max_new_tokens = gr.Slider(
|
|
|
165 |
|
166 |
|
167 |
with gr.Group():
|
168 |
+
chatbot = gr.Chatbot(height=220)
|
169 |
examples_set = gr.Radio(label="Examples of some You tube Videos",choices=EXAMPLES)
|
170 |
|
171 |
with gr.Row():
|