set PARALLEL_DEVICES default value= 0 (#7935)

### What problem does this PR solve?


it would be fail if PARALLEL_DEVICES = None in OCR class , because it
pass 0 to TextDetector and TextRecognizer init method.

and It would be simpler to set 0 as the default value for
PARALLEL_DEVICES.

### Type of change

- [x] Refactoring
This commit is contained in:
giiiiiithub
2025-05-29 13:32:16 +08:00
committed by GitHub
parent f584f5c3d0
commit 6ba5a4348a
3 changed files with 8 additions and 9 deletions

View File

@ -61,7 +61,7 @@ class RAGFlowPdfParser:
self.ocr = OCR()
self.parallel_limiter = None
if PARALLEL_DEVICES is not None and PARALLEL_DEVICES > 1:
if PARALLEL_DEVICES > 1:
self.parallel_limiter = [trio.CapacityLimiter(1) for _ in range(PARALLEL_DEVICES)]
if hasattr(self, "model_speciess"):