Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Reset archive instance on index

davidmezzettif881c2fd7bb5
diff --git a/src/python/txtai/embeddings/base.py b/src/python/txtai/embeddings/base.py
index 7c44eabb..4ca7ab97 100644
--- a/src/python/txtai/embeddings/base.py
+++ b/src/python/txtai/embeddings/base.py
@@ -56,7 +56,7 @@ class Embeddings:
# Document database
self.database = None
- # Archiver
+ # Index archive
self.archive = None
def score(self, documents):
@@ -107,6 +107,9 @@ class Embeddings:
# Save indexids-ids mapping for indexes with no database
self.config["ids"] = ids
+ # Reset archive since this is a new index
+ self.archive = None
+
def upsert(self, documents):
"""
Runs an embeddings upsert operation. If the index exists, new data is
@@ -419,7 +422,7 @@ class Embeddings:
(working directory, current path) if this is an archive, original path otherwise
"""
- # Create archiver instance, if necessary
+ # Create archive instance, if necessary
self.archive = self.archive if self.archive else Archive()
# Check if path if an archive file