azamat commited on
Commit
c9ef289
·
1 Parent(s): d867b65
Files changed (1) hide show
  1. app.py +11 -8
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
- # Display the first video
9
- first_video = gr.outputs.Video(shorts[0]["link"])
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
- iface = gr.Interface(fn=search, inputs="text", outputs=["video", "text"])
 
 
 
 
 
 
 
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()