mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-27 04:24:45 +00:00
replaced deprecated json function with model_dump_json
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
This commit is contained in:
parent
08364dfa56
commit
35bd7b9cff
@ -84,11 +84,12 @@ def test_conversions():
|
|||||||
|
|
||||||
for path in pdf_paths:
|
for path in pdf_paths:
|
||||||
|
|
||||||
|
print(f"converting {path}")
|
||||||
|
|
||||||
doc_pred_json = None
|
doc_pred_json = None
|
||||||
doc_true_json = None
|
doc_true_json = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# print(f"converting {path}")
|
|
||||||
doc_pred_json = converter.convert_single(path)
|
doc_pred_json = converter.convert_single(path)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
@ -114,11 +115,11 @@ def test_conversions():
|
|||||||
with open(md_path, "r") as fr:
|
with open(md_path, "r") as fr:
|
||||||
doc_true_md = "".join(fr.readlines())
|
doc_true_md = "".join(fr.readlines())
|
||||||
|
|
||||||
doc_ = json.loads(doc_pred_json.model_dump_json())
|
#doc_ = json.loads(doc_pred_json.model_dump_json())
|
||||||
# print(json.dumps(doc_, indent=2))
|
# print(json.dumps(doc_, indent=2))
|
||||||
|
|
||||||
assert verify_json(
|
assert verify_json(
|
||||||
doc_, doc_true_json
|
doc_pred_json.model_dump(), doc_true_json
|
||||||
), f"failed json prediction for {path}"
|
), f"failed json prediction for {path}"
|
||||||
|
|
||||||
assert verify_md(
|
assert verify_md(
|
||||||
|
Loading…
Reference in New Issue
Block a user