Spaces:
Sleeping
Sleeping
test
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import gradio as gr
|
|
4 |
from weaviate_explorer import WeaviateExplorer
|
5 |
|
6 |
weaviate_explorer = WeaviateExplorer()
|
7 |
-
video_player = gr.Video(label="Search Results")
|
8 |
|
9 |
downloads_dir = "downloads" # Directory to store downloaded videos
|
10 |
|
@@ -23,11 +23,12 @@ def search(query):
|
|
23 |
shorts = weaviate_explorer.explore(query)
|
24 |
download_url = f"https://drive.google.com/uc?id={shorts[0]['link'].split('/')[-2]}"
|
25 |
video_path = gdown.download(download_url, output=f"./video.mp4")
|
26 |
-
|
|
|
27 |
print(video_path)
|
28 |
-
return
|
29 |
|
30 |
iface = gr.Interface(fn=search,
|
31 |
inputs="text",
|
32 |
-
outputs=[
|
33 |
iface.launch()
|
|
|
4 |
from weaviate_explorer import WeaviateExplorer
|
5 |
|
6 |
weaviate_explorer = WeaviateExplorer()
|
7 |
+
# video_player = gr.Video(label="Search Results")
|
8 |
|
9 |
downloads_dir = "downloads" # Directory to store downloaded videos
|
10 |
|
|
|
23 |
shorts = weaviate_explorer.explore(query)
|
24 |
download_url = f"https://drive.google.com/uc?id={shorts[0]['link'].split('/')[-2]}"
|
25 |
video_path = gdown.download(download_url, output=f"./video.mp4")
|
26 |
+
|
27 |
+
# video_player.value = video_path
|
28 |
print(video_path)
|
29 |
+
return video_path, "\n\n".join([f"{r['title']}\n{r['link']}" for r in shorts])
|
30 |
|
31 |
iface = gr.Interface(fn=search,
|
32 |
inputs="text",
|
33 |
+
outputs=["playable_video", "text"])
|
34 |
iface.launch()
|