Spaces:
Runtime error
Runtime error
sradc
commited on
Commit
•
bac9ad8
1
Parent(s):
8b68fd8
show git hash in app
Browse files
video_semantic_search/app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import base64
|
2 |
import os
|
|
|
3 |
from dataclasses import dataclass
|
4 |
from typing import Final
|
5 |
|
@@ -43,6 +44,11 @@ def get_semantic_searcher():
|
|
43 |
return SemanticSearcher(pd.read_parquet(DATAFRAME_PATH))
|
44 |
|
45 |
|
|
|
|
|
|
|
|
|
|
|
46 |
@dataclass
|
47 |
class SearchResult:
|
48 |
video_id: str
|
@@ -119,6 +125,7 @@ def main():
|
|
119 |
if query:
|
120 |
st.text("Click image to open video")
|
121 |
display_search_results(searcher.search(query))
|
|
|
122 |
|
123 |
|
124 |
if __name__ == "__main__":
|
|
|
1 |
import base64
|
2 |
import os
|
3 |
+
import subprocess
|
4 |
from dataclasses import dataclass
|
5 |
from typing import Final
|
6 |
|
|
|
44 |
return SemanticSearcher(pd.read_parquet(DATAFRAME_PATH))
|
45 |
|
46 |
|
47 |
+
@st.cache_data
|
48 |
+
def get_git_hash() -> str:
|
49 |
+
return subprocess.check_output(["git", "rev-parse", "HEAD"]).decode().strip()
|
50 |
+
|
51 |
+
|
52 |
@dataclass
|
53 |
class SearchResult:
|
54 |
video_id: str
|
|
|
125 |
if query:
|
126 |
st.text("Click image to open video")
|
127 |
display_search_results(searcher.search(query))
|
128 |
+
st.text(f"Build: {get_git_hash()[0:7]}")
|
129 |
|
130 |
|
131 |
if __name__ == "__main__":
|