File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 11import asyncio
22import math
3+ import os
34import re
45from concurrent .futures import Executor
56from typing import Literal , Sequence
67
78from PIL import Image
9+ from loguru import logger
810
911from .post_process import post_process
1012from .structs import BLOCK_TYPES , ContentBlock
@@ -318,6 +320,15 @@ def __init__(
318320 max_retries : int = 3 , # for http-client backend only
319321 retry_backoff_factor : float = 0.5 , # for http-client backend only
320322 ) -> None :
323+ env_debug_value = os .getenv ('MINERU_VL_DEBUG_ENABLE' , '' )
324+ if env_debug_value :
325+ if env_debug_value .lower () in ['true' , '1' , 'yes' ]:
326+ debug = True
327+ elif env_debug_value .lower () in ['false' , '0' , 'no' ]:
328+ debug = False
329+ else :
330+ logger .warning (f'unknown MINERU_VL_DEBUG_ENABLE config: { env_debug_value } , pass' )
331+
321332 if backend == "transformers" :
322333 if model is None or processor is None :
323334 if not model_path :
You can’t perform that action at this time.
0 commit comments