Spaces:
Paused
Paused
Hemang Thakur
commited on
Commit
·
23c4573
1
Parent(s):
f6241a7
change directory to working direct before saving graph html file
Browse files- 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 |
-
|
1224 |
-
net.save_graph(
|
1225 |
|
1226 |
-
with open(
|
1227 |
html_str = f.read()
|
1228 |
|
1229 |
-
|
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):
|