Skip to content

Commit 29509ff

Browse files
authored
refine dockerfile (infiniflow#1801)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
1 parent 216f649 commit 29509ff

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ADD ./api ./api
1010
ADD ./conf ./conf
1111
ADD ./deepdoc ./deepdoc
1212
ADD ./rag ./rag
13-
ADD ./graph ./graph
13+
ADD ./agent ./agent
1414

1515
ENV PYTHONPATH=/ragflow/
1616
ENV HF_ENDPOINT=https://hf-mirror.com

Dockerfile.arm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ADD ./api ./api
2121
ADD ./conf ./conf
2222
ADD ./deepdoc ./deepdoc
2323
ADD ./rag ./rag
24-
ADD ./graph ./graph
24+
ADD ./agent ./agent
2525

2626
ENV PYTHONPATH=/ragflow/
2727
ENV HF_ENDPOINT=https://hf-mirror.com

Dockerfile.cuda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ADD ./api ./api
1515
ADD ./conf ./conf
1616
ADD ./deepdoc ./deepdoc
1717
ADD ./rag ./rag
18-
ADD ./graph ./graph
18+
ADD ./agent ./agent
1919

2020
ENV PYTHONPATH=/ragflow/
2121
ENV HF_ENDPOINT=https://hf-mirror.com

Dockerfile.scratch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ADD ./conf ./conf
3030
ADD ./deepdoc ./deepdoc
3131
ADD ./rag ./rag
3232
ADD ./requirements.txt ./requirements.txt
33-
ADD ./graph ./graph
33+
ADD ./agent ./agent
3434

3535
RUN apt install openmpi-bin openmpi-common libopenmpi-dev
3636
ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu/openmpi/lib:$LD_LIBRARY_PATH

Dockerfile.scratch.oc9

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ADD ./conf ./conf
3030
ADD ./deepdoc ./deepdoc
3131
ADD ./rag ./rag
3232
ADD ./requirements.txt ./requirements.txt
33-
ADD ./graph ./graph
33+
ADD ./agent ./agent
3434

3535
RUN dnf install -y openmpi openmpi-devel python3-openmpi
3636
ENV C_INCLUDE_PATH /usr/include/openmpi-x86_64:$C_INCLUDE_PATH

graphrag/leiden.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from graspologic.utils import largest_connected_component
2626

2727
import networkx as nx
28+
from networkx import is_empty
2829

2930
log = logging.getLogger(__name__)
3031

@@ -91,13 +92,14 @@ def _compute_leiden_communities(
9192
seed=0xDEADBEEF,
9293
) -> dict[int, dict[str, int]]:
9394
"""Return Leiden root communities."""
95+
results: dict[int, dict[str, int]] = {}
96+
if is_empty(graph): return results
9497
if use_lcc:
9598
graph = stable_largest_connected_component(graph)
9699

97100
community_mapping = hierarchical_leiden(
98101
graph, max_cluster_size=max_cluster_size, random_seed=seed
99102
)
100-
results: dict[int, dict[str, int]] = {}
101103
for partition in community_mapping:
102104
results[partition.level] = results.get(partition.level, {})
103105
results[partition.level][partition.node] = partition.cluster

0 commit comments

Comments
 (0)