Use List[str] to annotate topics field, add spinner when persisting index
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ INDEX_PATH = Path(__file__).parent.joinpath("data/index.bin")
|
|
| 16 |
def load_index():
|
| 17 |
class RepoDoc(BaseDoc):
|
| 18 |
name: str
|
| 19 |
-
topics:
|
| 20 |
stars: int
|
| 21 |
license: str
|
| 22 |
code_embedding: Optional[TorchTensor[768]]
|
|
@@ -161,7 +161,8 @@ if search:
|
|
| 161 |
else:
|
| 162 |
st.success("Repo updated in the index!")
|
| 163 |
|
| 164 |
-
|
|
|
|
| 165 |
|
| 166 |
st.session_state["query_doc"] = query_doc
|
| 167 |
else:
|
|
|
|
| 16 |
def load_index():
|
| 17 |
class RepoDoc(BaseDoc):
|
| 18 |
name: str
|
| 19 |
+
topics: List[str]
|
| 20 |
stars: int
|
| 21 |
license: str
|
| 22 |
code_embedding: Optional[TorchTensor[768]]
|
|
|
|
| 161 |
else:
|
| 162 |
st.success("Repo updated in the index!")
|
| 163 |
|
| 164 |
+
with st.spinner("Persisting the index..."):
|
| 165 |
+
index.persist(file=INDEX_PATH)
|
| 166 |
|
| 167 |
st.session_state["query_doc"] = query_doc
|
| 168 |
else:
|