Esse commit está contido em:
alckasoc
2025-07-10 15:05:27 -07:00
commit 278cb7134b
+6 -8
Ver Arquivo
@@ -278,10 +278,9 @@ class KnowledgeBase(BaseModule):
subtask_summarization = self.summarize_episode(subtask_traj)
kb[subtask_key] = subtask_summarization
if self.save_knowledge:
os.makedirs(os.path.dirname(self.episodic_memory_path), exist_ok=True)
with open(self.episodic_memory_path, "w") as fout:
json.dump(kb, fout, indent=2)
os.makedirs(os.path.dirname(self.episodic_memory_path), exist_ok=True)
with open(self.episodic_memory_path, "w") as fout:
json.dump(kb, fout, indent=2)
return kb.get(subtask_key)
@@ -304,10 +303,9 @@ class KnowledgeBase(BaseModule):
task_summarization = self.summarize_narrative(task_traj)
kb[task_key] = task_summarization
if self.save_knowledge:
os.makedirs(os.path.dirname(self.narrative_memory_path), exist_ok=True)
with open(self.narrative_memory_path, "w") as fout:
json.dump(kb, fout, indent=2)
os.makedirs(os.path.dirname(self.narrative_memory_path), exist_ok=True)
with open(self.narrative_memory_path, "w") as fout:
json.dump(kb, fout, indent=2)
return kb.get(task_key)