Spaces:
Sleeping
Sleeping
Fix
Browse files
app.py
CHANGED
@@ -3,14 +3,17 @@ from weaviate_explorer import WeaviateExplorer
|
|
3 |
|
4 |
weaviate_explorer = WeaviateExplorer()
|
5 |
|
6 |
-
def search(query):
|
7 |
shorts = weaviate_explorer.explore(query)
|
8 |
-
|
9 |
-
|
10 |
-
# Display the list of URLs
|
11 |
-
# other_videos = [gr.outputs.Text(url) for url in video_urls[1:]]
|
12 |
-
return first_video, "\n\n".join([f"{r['title']}\n{r['link']}" for r in shorts])
|
13 |
-
# return
|
14 |
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
iface.launch()
|
|
|
3 |
|
4 |
weaviate_explorer = WeaviateExplorer()
|
5 |
|
6 |
+
def search(query, video_player):
|
7 |
shorts = weaviate_explorer.explore(query)
|
8 |
+
video_player.value = shorts[0]["link"]
|
9 |
+
return video_player, "\n\n".join([f"{r['title']}\n{r['link']}" for r in shorts])
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
video_player = gr.Video(label="Search Results")
|
12 |
+
|
13 |
+
iface = gr.Interface(fn=search,
|
14 |
+
inputs="text",
|
15 |
+
outputs=[
|
16 |
+
video_player,
|
17 |
+
"text"
|
18 |
+
])
|
19 |
iface.launch()
|