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

@ -62,7 +62,7 @@ SVR_CONSUMER_GROUP_NAME = "rag_flow_svr_task_broker"
PAGERANK_FLD = "pagerank_fea"
TAG_FLD = "tag_feas"
PARALLEL_DEVICES = None
PARALLEL_DEVICES = 0
try:
import torch.cuda
PARALLEL_DEVICES = torch.cuda.device_count()