Skip to content

Commit 2884967

Browse files
committed
fix - make sure to pass a deep copy of merged_graph to summarizer as it overwrites it
1 parent 59ab206 commit 2884967

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "langchain-graphrag"
3-
version = "0.0.5"
3+
version = "0.0.6"
44
description = "Implementation of GraphRAG (https://arxiv.org/pdf/2404.16130)"
55
authors = [{ name = "Kapil Sachdeva", email = "[email protected]" }]
66
dependencies = [

src/langchain_graphrag/indexing/graph_generation/generator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from copy import deepcopy
2+
13
import networkx as nx
24
import pandas as pd
35

@@ -20,5 +22,7 @@ def __init__(
2022
def run(self, text_units: pd.DataFrame) -> tuple[nx.Graph, nx.Graph]:
2123
er_graphs = self._er_extractor.invoke(text_units)
2224
er_merged_graph = self._graphs_merger(er_graphs)
23-
er_summarized_graph = self._er_description_summarizer.invoke(er_merged_graph)
25+
er_summarized_graph = self._er_description_summarizer.invoke(
26+
deepcopy(er_merged_graph)
27+
)
2428
return er_merged_graph, er_summarized_graph

0 commit comments

Comments
 (0)