Update src/qa.py
Browse files
src/qa.py
CHANGED
|
@@ -87,7 +87,7 @@ def _hash_name(file_name: str, chunk_size: int, overlap: int, num_chunks: int):
|
|
| 87 |
combo = f"{file_name}_{chunk_size}_{overlap}_{num_chunks}"
|
| 88 |
return hashlib.md5(combo.encode()).hexdigest()[:8]
|
| 89 |
|
| 90 |
-
def _clean_old_caches(base_name: str, keep_latest: int =
|
| 91 |
"""
|
| 92 |
Retains only the latest few embedding cache files for a given document.
|
| 93 |
Prevents /tmp from filling with redundant embeddings.
|
|
|
|
| 87 |
combo = f"{file_name}_{chunk_size}_{overlap}_{num_chunks}"
|
| 88 |
return hashlib.md5(combo.encode()).hexdigest()[:8]
|
| 89 |
|
| 90 |
+
def _clean_old_caches(base_name: str, keep_latest: int = 5):
|
| 91 |
"""
|
| 92 |
Retains only the latest few embedding cache files for a given document.
|
| 93 |
Prevents /tmp from filling with redundant embeddings.
|