ó
    æ9i·  ã                   ó®   • S SK JrJrJrJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SSKJr  S	S
KJr  \
R"                  \" S5       " S S\5      5       5       rg)é    )ÚAnyÚDictÚOptionalÚUnioné   )Úpipeline_requires_extraé   )ÚDocVLMResult)Ú	benchmark)Ú	HPIConfig)ÚPaddlePredictorOptioné   )ÚBasePipelineÚ
multimodalc                   óŠ   ^ • \ rS rSrSrSr    SS\S\S\S\	S	\
\\\\4   \4      S
S4U 4S jjjrS\S
\4S jrS rSrU =r$ )ÚDocUnderstandingPipelineé   zDoc Understanding PipelineÚdoc_understandingNÚconfigÚdeviceÚ	pp_optionÚuse_hpipÚ
hpi_configÚreturnc                 ó–   >• [         TU ]  X#XES9  UR                  S0 5      R                  SSS05      nU R                  U5      U l        g)ah  
Initializes the class with given configurations and options.

Args:
    config (Dict): Configuration dictionary containing model and other parameters.
    device (str): The device to run the prediction on. Default is None.
    pp_option (PaddlePredictorOption): Options for PaddlePaddle predictor. Default is None.
    use_hpip (bool, optional): Whether to use the high-performance
        inference plugin (HPIP) by default. Defaults to False.
    hpi_config (Optional[Union[Dict[str, Any], HPIConfig]], optional):
        The default high-performance inference configuration dictionary.
        Defaults to None.
)r   r   r   r   Ú
SubModulesÚDocUnderstandingÚmodel_config_errorz)config error for doc_understanding_model!N)ÚsuperÚ__init__ÚgetÚcreate_modelÚdoc_understanding_model)Úselfr   r   r   r   r   Údoc_understanding_model_configÚ	__class__s          €Úv/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/paddlex/inference/pipelines/doc_understanding/pipeline.pyr    Ú!DocUnderstandingPipeline.__init__    s\   ø€ ô* 	‰ÑØ¸ð 	ñ 	
ð *0¯©°LÀ"Ó)E×)IÑ)IØØ!Ð#NÐOó*
Ð&ð (,×'8Ñ'8Ð9WÓ'XˆÕ$ó    Úinputc              +   óF   #   • U R                   " U40 UD6 Sh  v•N   g N7f)a   Predicts doc understanding results for the given input.

Args:
    input (dict): The input image and query.
    **kwargs: Additional keyword arguments that can be passed to the function.

Returns:
    DocVLMResult: The predicted doc understanding results.
N©r#   )r$   r*   Úkwargss      r'   ÚpredictÚ DocUnderstandingPipeline.predict?   s    é € ð ×/Ò/°Ñ@¸Ñ@×@Ó@ùs   ‚!™š!c                 ó8   • U R                   R                  5         g )N)r#   Úclose)r$   s    r'   r1   ÚDocUnderstandingPipeline.closeK   s   € Ø×$Ñ$×*Ñ*Õ,r)   r,   )NNFN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úentitiesr   Ústrr   Úboolr   r   r   r   r    r
   r.   r1   Ú__static_attributes__Ú__classcell__)r&   s   @r'   r   r      sž   ø† ñ %à"€Hð
 Ø+/ØØAEñYàðYð ðYð )ð	Yð
 ðYð ˜U 4¨¨S¨¡>°9Ð#<Ñ=Ñ>ðYð 
÷Yð Yð>
A˜Tð 
A°ô 
A÷-ð -r)   r   N)Útypingr   r   r   r   Ú
utils.depsr   Úmodels.doc_vlm.resultr
   Úutils.benchmarkr   Ú	utils.hpir   Úutils.pp_optionr   Úbaser   Útime_methodsr   © r)   r'   Ú<module>rF      sM   ð÷ .Ó -å 2Ý 1Ý (Ý "Ý 4Ý ð ×ÑÙ˜Ó&ô1-˜|ó 1-ó 'ó ñ1-r)   