Update app.py

This commit is contained in:
Ahmed Nassar 2025-03-18 09:06:13 +00:00 committed by system
parent 61303b8155
commit 12df581e7f
No known key found for this signature in database
GPG Key ID: 6A528E38E0733467
1 changed files with 0 additions and 3 deletions

3
app.py
View File

@ -129,11 +129,8 @@ def model_inference(
doctag_output = doctag_output.replace("<chart>", "<otsl>").replace("</chart>", "</otsl>") doctag_output = doctag_output.replace("<chart>", "<otsl>").replace("</chart>", "</otsl>")
doctag_output = re.sub(r'(<loc_500>)(?!.*<loc_500>)<[^>]+>', r'\1', doctag_output) doctag_output = re.sub(r'(<loc_500>)(?!.*<loc_500>)<[^>]+>', r'\1', doctag_output)
print(doctag_output)
doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctag_output], images) doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctag_output], images)
doc.load_from_doctags(doctags_doc) doc.load_from_doctags(doctags_doc)
print(doc)
yield f"**MD Output:**\n\n{doc.export_to_markdown()}" yield f"**MD Output:**\n\n{doc.export_to_markdown()}"
examples=[[{"text": "Convert this page to docling.", "files": ["example_images/2d0fbcc50e88065a040a537b717620e964fb4453314b71d83f3ed3425addcef6.png"]}], examples=[[{"text": "Convert this page to docling.", "files": ["example_images/2d0fbcc50e88065a040a537b717620e964fb4453314b71d83f3ed3425addcef6.png"]}],