mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-25 03:24:59 +00:00
Merge branch 'main' of github.com:DS4SD/docling into copilot/fix-1903
This commit is contained in:
commit
6aa85cc933
@ -260,7 +260,15 @@ class oMath2Latex(Tag2Method):
|
|||||||
the fraction object
|
the fraction object
|
||||||
"""
|
"""
|
||||||
c_dict = self.process_children_dict(elm)
|
c_dict = self.process_children_dict(elm)
|
||||||
pr = c_dict["fPr"]
|
pr = c_dict.get("fPr")
|
||||||
|
if pr is None:
|
||||||
|
# Handle missing fPr element gracefully
|
||||||
|
_log.debug("Missing fPr element in fraction, using default formatting")
|
||||||
|
latex_s = F_DEFAULT
|
||||||
|
return latex_s.format(
|
||||||
|
num=c_dict.get("num"),
|
||||||
|
den=c_dict.get("den"),
|
||||||
|
)
|
||||||
latex_s = get_val(pr.type, default=F_DEFAULT, store=F)
|
latex_s = get_val(pr.type, default=F_DEFAULT, store=F)
|
||||||
return pr.text + latex_s.format(num=c_dict.get("num"), den=c_dict.get("den"))
|
return pr.text + latex_s.format(num=c_dict.get("num"), den=c_dict.get("den"))
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ smolvlm_picture_description = PictureDescriptionVlmOptions(
|
|||||||
|
|
||||||
# GraniteVision
|
# GraniteVision
|
||||||
granite_picture_description = PictureDescriptionVlmOptions(
|
granite_picture_description = PictureDescriptionVlmOptions(
|
||||||
repo_id="ibm-granite/granite-vision-3.2-2b-preview",
|
repo_id="ibm-granite/granite-vision-3.3-2b",
|
||||||
prompt="What is shown in this image?",
|
prompt="What is shown in this image?",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
2
docs/examples/pictures_description_api.py
vendored
2
docs/examples/pictures_description_api.py
vendored
@ -114,7 +114,7 @@ def main():
|
|||||||
# Example for the Granite Vision model:
|
# Example for the Granite Vision model:
|
||||||
# (uncomment the following lines)
|
# (uncomment the following lines)
|
||||||
# pipeline_options.picture_description_options = vllm_local_options(
|
# pipeline_options.picture_description_options = vllm_local_options(
|
||||||
# model="ibm-granite/granite-vision-3.1-2b-preview"
|
# model="ibm-granite/granite-vision-3.3-2b"
|
||||||
# )
|
# )
|
||||||
|
|
||||||
# Example for the SmolVLM model:
|
# Example for the SmolVLM model:
|
||||||
|
Loading…
Reference in New Issue
Block a user