Hemang Thakur commited on
Commit
23c4573
·
1 Parent(s): f6241a7

change directory to working direct before saving graph html file

Browse files
Files changed (1) hide show
  1. src/rag/graph_rag.py +4 -4
src/rag/graph_rag.py CHANGED
@@ -1220,13 +1220,13 @@ class GraphRAG:
1220
  net.options["layout"] = {"improvedLayout": True}
1221
  net.options["interaction"] = {"dragNodes": True}
1222
 
1223
- file_path = os.path.join(os.getenv("WRITABLE_DIR", "/tmp"), "temp_graph.html")
1224
- net.save_graph(file_path)
1225
 
1226
- with open(file_path, "r", encoding="utf-8") as f:
1227
  html_str = f.read()
1228
 
1229
- # os.remove(file_path)
1230
  return html_str
1231
 
1232
  def verify_graph_integrity(self):
 
1220
  net.options["layout"] = {"improvedLayout": True}
1221
  net.options["interaction"] = {"dragNodes": True}
1222
 
1223
+ os.chdir(os.getenv("WRITABLE_DIR", "/tmp"))
1224
+ net.save_graph("temp_graph.html")
1225
 
1226
+ with open("temp_graph.html", "r", encoding="utf-8") as f:
1227
  html_str = f.read()
1228
 
1229
+ os.remove("temp_graph.html")
1230
  return html_str
1231
 
1232
  def verify_graph_integrity(self):