Skip to content

Commit 73f70a5

Browse files
fix: fix operators' registry
1 parent 42dc73e commit 73f70a5

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

graphgen/operators/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from .build_kg import BuildKGService
22
from .chunk import ChunkService
33
from .extract import extract
4-
from .generate import generate_qas
4+
from .generate import GenerateService
55
from .judge import JudgeService
66
from .partition import PartitionService
77
from .quiz import QuizService
@@ -14,8 +14,8 @@
1414
"build_kg": BuildKGService,
1515
"quiz": QuizService,
1616
"judge": JudgeService,
17-
"extract_info": extract,
18-
"search_all": search_all,
17+
"extract": extract,
18+
"search": search_all,
1919
"partition": PartitionService,
20-
"generate_qas": generate_qas,
20+
"generate": GenerateService,
2121
}

graphgen/operators/partition/partition_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
import os
23
from typing import Iterable
34

@@ -149,7 +150,7 @@ def _attach_additional_data_to_node(self, batch: tuple) -> tuple:
149150
if image_chunks:
150151
# The generator expects a dictionary with an 'img_path' key, not a list of captions.
151152
# We'll use the first image chunk found for this node.
152-
node_data["images"] = image_chunks[0]
153+
node_data["image_data"] = json.loads(image_chunks[0]["content"])
153154
logger.debug("Attached image data to node %s", node_id)
154155

155156
return nodes_data, edges_data

graphgen/operators/read/read.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def read(
8585
logger.info("[READ] Found %d files to process", len(all_files))
8686

8787
if not all_files:
88-
return ray.data.from_items([])
88+
raise ValueError("No files found to read.")
8989

9090
# 2. Group files by suffix to use appropriate reader
9191
files_by_suffix = {}
@@ -116,7 +116,7 @@ def read(
116116
combined_ds = combined_ds.map(
117117
lambda record: {
118118
**record,
119-
"_doc_id": compute_mm_hash(record),
119+
"_doc_id": compute_mm_hash(record, prefix="doc-"),
120120
}
121121
)
122122

0 commit comments

Comments
 (0)