ysharma HF Staff commited on
Commit
c3ed386
·
1 Parent(s): 742f7ca
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -73,8 +73,11 @@ def get_answers_timestamp(question, final_transcript, transcript):
73
  start_timestamp = round(start_timestamp)
74
 
75
  return start_timestamp
76
-
77
-
 
 
 
78
  def display_vid(url, question):
79
  print("******** display_vid ********")
80
  #https://www.youtube.com/watch?v=smUHQndcmOY&t=425s
@@ -121,11 +124,19 @@ with demo:
121
  input_ques = gr.Textbox(label="Ask a Question")
122
  output_vid = gr.HTML(label="Video will play at the answer timestamp")
123
 
 
 
 
 
 
 
 
124
  b1 = gr.Button("Publish Video")
125
  #b2 = gr.Button("Generate Image")
126
 
127
  b1.click(display_vid, inputs=[input_url,input_ques], outputs=output_vid)
128
  #b2.click(poem_to_image, poem_txt, output_image)
129
  #examples=examples
 
130
 
131
  demo.launch(enable_queue=True, debug=True)
 
73
  start_timestamp = round(start_timestamp)
74
 
75
  return start_timestamp
76
+
77
+ def set_example_question(example: list) -> dict:
78
+ return gr.Image.update(value=example[0])
79
+
80
+
81
  def display_vid(url, question):
82
  print("******** display_vid ********")
83
  #https://www.youtube.com/watch?v=smUHQndcmOY&t=425s
 
124
  input_ques = gr.Textbox(label="Ask a Question")
125
  output_vid = gr.HTML(label="Video will play at the answer timestamp")
126
 
127
+ with gr.Row():
128
+ gr.Radio(["Does video talk about different modalities", "Can the model do classification", "Does the model pushes state of the art in image classification", "Is deepmind copying openai", "Is flamingo good enough", "Has flamingo passed andre karpathy challenge yet?", "Are there cool examples from flamingo in the video?", "Does the video talk about cat?", "Any funny examples in video?"], label= "Choose a sample Question")
129
+ #paths = sorted(pathlib.Path('images').glob('*.jpg'))
130
+ #example_images = gr.Dataset(components=[input_image],
131
+ # samples=[[path.as_posix()]
132
+ # for path in paths])
133
+
134
  b1 = gr.Button("Publish Video")
135
  #b2 = gr.Button("Generate Image")
136
 
137
  b1.click(display_vid, inputs=[input_url,input_ques], outputs=output_vid)
138
  #b2.click(poem_to_image, poem_txt, output_image)
139
  #examples=examples
140
+
141
 
142
  demo.launch(enable_queue=True, debug=True)