mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-26 20:14:47 +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:
|
||||
|
||||
print(f"converting {path}")
|
||||
|
||||
doc_pred_json = None
|
||||
doc_true_json = None
|
||||
|
||||
try:
|
||||
# print(f"converting {path}")
|
||||
try:
|
||||
doc_pred_json = converter.convert_single(path)
|
||||
except:
|
||||
continue
|
||||
@ -114,11 +115,11 @@ def test_conversions():
|
||||
with open(md_path, "r") as fr:
|
||||
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))
|
||||
|
||||
assert verify_json(
|
||||
doc_, doc_true_json
|
||||
doc_pred_json.model_dump(), doc_true_json
|
||||
), f"failed json prediction for {path}"
|
||||
|
||||
assert verify_md(
|
||||
|
Loading…
Reference in New Issue
Block a user