Spaces:
Runtime error
Runtime error
sradc
commited on
Commit
•
7b9d833
1
Parent(s):
498eef9
only go 1 second before timestamp
Browse files
video_semantic_search/app.py
CHANGED
@@ -53,7 +53,7 @@ class SearchResult:
|
|
53 |
|
54 |
|
55 |
def get_video_url(video_id: str, timestamp: float) -> str:
|
56 |
-
timestamp = max(0, timestamp -
|
57 |
return f"https://www.youtube.com/watch?v={video_id}&t={int(timestamp)}"
|
58 |
|
59 |
|
@@ -112,7 +112,9 @@ def main():
|
|
112 |
st.markdown("_App by Ben Tenmann and Sidney Radcliffe_")
|
113 |
searcher = get_semantic_searcher()
|
114 |
num_videos = len(searcher.metadata.video_id.unique())
|
115 |
-
st.text_input(
|
|
|
|
|
116 |
query = st.session_state["query"]
|
117 |
if query:
|
118 |
st.text("Click image to open video")
|
|
|
53 |
|
54 |
|
55 |
def get_video_url(video_id: str, timestamp: float) -> str:
|
56 |
+
timestamp = max(0, timestamp - 1)
|
57 |
return f"https://www.youtube.com/watch?v={video_id}&t={int(timestamp)}"
|
58 |
|
59 |
|
|
|
112 |
st.markdown("_App by Ben Tenmann and Sidney Radcliffe_")
|
113 |
searcher = get_semantic_searcher()
|
114 |
num_videos = len(searcher.metadata.video_id.unique())
|
115 |
+
st.text_input(
|
116 |
+
f"What are you looking for? Search over {num_videos} music videos.", key="query"
|
117 |
+
)
|
118 |
query = st.session_state["query"]
|
119 |
if query:
|
120 |
st.text("Click image to open video")
|