Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -168,8 +168,6 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
|
168 |
outputs=[input_text, input_image]
|
169 |
)
|
170 |
|
171 |
-
|
172 |
-
|
173 |
with gr.Tab("Gallery"):
|
174 |
gallery = gr.Gallery(
|
175 |
label="Generated Videos",
|
@@ -180,13 +178,18 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
|
180 |
object_fit="contain",
|
181 |
height="auto"
|
182 |
)
|
|
|
183 |
refresh_btn = gr.Button("Refresh Gallery")
|
184 |
|
185 |
def update_gallery():
|
186 |
return load_gallery()
|
187 |
|
188 |
-
|
189 |
-
|
|
|
|
|
|
|
|
|
190 |
|
191 |
input_text.submit(
|
192 |
fn=respond,
|
|
|
168 |
outputs=[input_text, input_image]
|
169 |
)
|
170 |
|
|
|
|
|
171 |
with gr.Tab("Gallery"):
|
172 |
gallery = gr.Gallery(
|
173 |
label="Generated Videos",
|
|
|
178 |
object_fit="contain",
|
179 |
height="auto"
|
180 |
)
|
181 |
+
selected_video = gr.Video(label="Selected Video")
|
182 |
refresh_btn = gr.Button("Refresh Gallery")
|
183 |
|
184 |
def update_gallery():
|
185 |
return load_gallery()
|
186 |
|
187 |
+
def show_video(evt: gr.SelectData):
|
188 |
+
return evt.value[2] # 선택된 썸네일에 해당하는 비디오 경로 반환
|
189 |
+
|
190 |
+
refresh_btn.click(fn=update_gallery, inputs=None, outputs=gallery)
|
191 |
+
demo.load(fn=update_gallery, inputs=None, outputs=gallery)
|
192 |
+
gallery.select(show_video, None, selected_video)
|
193 |
|
194 |
input_text.submit(
|
195 |
fn=respond,
|