Skip to content

Commit d88c479

Browse files
Merge branch 'feat/pdf-reader' of https://github.com/open-sciencelab/GraphGen into feat/pdf-reader
2 parents e6e02eb + d00c663 commit d88c479

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

graphgen/generate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def main():
7272

7373
graph_gen.search(search_config=config["search"])
7474

75-
graph_gen.quiz_and_judge(quiz_and_judge_config=config["quiz_and_judge"])
75+
if config.get("quiz_and_judge", {}).get("enabled"):
76+
graph_gen.quiz_and_judge(quiz_and_judge_config=config["quiz_and_judge"])
7677

7778
# TODO: add data filtering step here in the future
7879
# graph_gen.filter(filter_config=config["filter"])

graphgen/graphgen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async def insert(self, read_config: Dict, split_config: Dict):
105105
"content": doc["content"]
106106
}
107107
for doc in data
108-
if doc["type"] == "text"
108+
if doc.get("type", "text") == "text"
109109
}
110110
_add_doc_keys = await self.full_docs_storage.filter_keys(list(new_docs.keys()))
111111
new_docs = {k: v for k, v in new_docs.items() if k in _add_doc_keys}

tests/integration_tests/models/reader/test_mineru_parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ def test_check_bin():
1212
def test_parse_pdf():
1313
"""Parse a real PDF and verify basic structure."""
1414
repo_root = Path(__file__).resolve().parents[4]
15-
os.chdir(repo_root)
1615

1716
sample_pdf = os.path.join(repo_root, "resources", "input_examples", "pdf_demo.pdf")
1817
parser = MinerUParser()

0 commit comments

Comments
 (0)