mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-09 21:10:56 +00:00
fix: fix some bugs in rag (#399)
* fix some bugs in rag * fix a bug in costeer
This commit is contained in:
@@ -14,12 +14,12 @@ class KnowledgeBase:
|
||||
if self.path is not None and self.path.exists():
|
||||
with self.path.open("rb") as f:
|
||||
self.__dict__.update(
|
||||
pickle.load(f),
|
||||
pickle.load(f).__dict__,
|
||||
) # TODO: because we need to align with init function, we need a less hacky way to do this
|
||||
|
||||
def dump(self) -> None:
|
||||
if self.path is not None:
|
||||
self.path.parent.mkdir(parents=True, exist_ok=True)
|
||||
pickle.dump(self.__dict__, self.path.open("wb"))
|
||||
pickle.dump(self, self.path.open("wb"))
|
||||
else:
|
||||
logger.warning("KnowledgeBase path is not set, dump failed.")
|
||||
|
||||
Reference in New Issue
Block a user