RuntimeError: Invalid buffer size 17.26 GB when using LayoutLMv3 model in PDF conversion script
GitHub Issue Description:
Description
I am encountering a runtime error while trying to convert a PDF to Markdown using a script that employs the LayoutLMv3 model from the transformers library. The script is designed to handle parallel processing but fails with a significant memory allocation issue.
Error Details
Running the script with a parallel_factor of 12 on a PDF results in the following error:
RuntimeError: Invalid buffer size: 17.26 GB
This error occurs during the forward pass of the LayoutLMv3 model.
Steps to Reproduce
Run the conversion script with the following command:
GitHub Issue Title:
RuntimeError: Invalid buffer size 17.26 GB when using LayoutLMv3 model in PDF conversion script
GitHub Issue Description:
Description
I am encountering a runtime error while trying to convert a PDF to Markdown using a script that employs the LayoutLMv3 model from the transformers library. The script is designed to handle parallel processing but fails with a significant memory allocation issue.
Error Details
Running the script with a
parallel_factor
of 12 on a PDF results in the following error:This error occurs during the forward pass of the LayoutLMv3 model.
Steps to Reproduce
System Information
Looking forward to suggestions or patches