VikParuchuri / marker

Convert PDF to markdown quickly with high accuracy
https://www.datalab.to
GNU General Public License v3.0
14.65k stars 764 forks source link

ZeroDivisionError: float division by zero - File "/marker/marker/cleaners/code.py", line 111, in indent_blocks #79

Closed mrticker closed 2 months ago

mrticker commented 5 months ago

While converting

https://arxiv.org/abs/1908.03491 https://arxiv.org/abs/1910.13038 https://arxiv.org/abs/2001.07685

Loaded texify model to cuda with torch.float16 dtype
Traceback (most recent call last):
  File "/marker/convert_single.py", line 32, in <module>
    main()
  File "/marker/convert_single.py", line 21, in main
    full_text, out_meta = convert_single_pdf(fname, model_lst, max_pages=args.max_pages, parallel_factor=args.parallel_factor)
  File "/marker/marker/convert.py", line 133, in convert_single_pdf
    indent_blocks(blocks)
  File "/marker/marker/cleaners/code.py", line 111, in indent_blocks
    prefix = " " * int((line[0].x0 - min_left) / col_width)
ZeroDivisionError: float division by zero
xujryan commented 4 months ago

I'm encountering the same error. Are there any updates or suggestions on how to resolve this?@VikParuchuri

VikParuchuri commented 2 months ago

I'll fix this in the next version (to be merged into master shortly).