Pārlūkot izejas kodu

Update mineru/utils/pdf_image_tools.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Xiaomeng Zhao 1 mēnesi atpakaļ
vecāks
revīzija
74de2725cb
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      mineru/utils/pdf_image_tools.py

+ 1 - 1
mineru/utils/pdf_image_tools.py

@@ -75,7 +75,7 @@ def load_images_from_pdf(
         ), pdf_doc
     else:
         # 根据进程数调整超时时间
-        threads = min(os.cpu_count(), threads)
+        threads = min(os.cpu_count() or 1, threads)
         timeout = timeout // threads
 
         end_page_id = get_end_page_id(end_page_id, len(pdf_doc))