ó
    =pˆjÿ  ã                   ó¦   • S SK JrJrJrJr  SSKJr  SSKJr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é   )Ú	HPIConfigÚPaddlePredictorOption)ÚDocVLMResult)Ú	benchmarké   )ÚBasePipelineÚ
multimodalc                   óº   ^ • \ rS rSrSrSrSSSSSSS.S\S\\   S	\\   S
\\\\	4      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_understandingNF©ÚdeviceÚengineÚengine_configÚ	pp_optionÚuse_hpipÚ
hpi_configÚconfigr   r   r   r   r   r   Úreturnc          
      ó¨   >• [         T
U ]  " SUUUUUUS.UD6  UR                  S0 5      R                  SSS05      n	U R                  U	5      U l        g)aÃ  Initializes the doc understanding pipeline.

Args:
    config (Dict): Configuration dictionary containing model and other parameters.
    device (Optional[str], optional): The device to use for prediction. Defaults to `None`.
    engine (Optional[str], optional): Inference engine. Defaults to `None`.
    engine_config (Optional[Dict[str, Any]], optional): Engine-specific config. Defaults to `None`.
    pp_option (Optional[PaddlePredictorOption], optional): Paddle predictor options.
        Defaults to `None`.
    use_hpip (bool, optional): Whether to use HPIP. Defaults to `False`.
    hpi_config (Optional[Union[Dict[str, Any], HPIConfig]], optional):
        HPIP configuration. Defaults to `None`.
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   r   r   ÚkwargsÚdoc_understanding_model_configÚ	__class__s             €Úr/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/paddlex/inference/pipelines/doc_understanding/pipeline.pyr$   Ú!DocUnderstandingPipeline.__init__   ss   ø€ ô2 	‰Òð 	
ØØØ'ØØØ!ñ	
ð ò	
ð *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/   r)   s      r,   ÚpredictÚ DocUnderstandingPipeline.predictH   s    é € ð ×/Ò/°Ñ@¸Ñ@×@Ó@ùs   ‚!™š!c                 ó8   • U R                   R                  5         g )N)r'   Úclose)r(   s    r,   r5   ÚDocUnderstandingPipeline.closeT   s   € Ø×$Ñ$×*Ñ*Õ,r.   r1   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úentitiesr   r   Ústrr   r   Úboolr   r
   r$   r   r2   r5   Ú__static_attributes__Ú__classcell__)r+   s   @r,   r   r      sÖ   ø† ñ %à"€Hð !%Ø $Ø26Ø59ØØAEò'Yàð'Yð ˜‘ð	'Yð
 ˜‘ð'Yð    S¨# X¡Ñ/ð'Yð Ð1Ñ2ð'Yð ð'Yð ˜U 4¨¨S¨¡>°9Ð#<Ñ=Ñ>ð'Yð 
÷'Yð 'YðR
A˜Tð 
A°ô 
A÷-ð -r.   r   N)Útypingr   r   r   r   Ú
utils.depsr   Úmodelsr
   r   Úmodels.doc_vlm.resultr   Úutils.benchmarkr   Úbaser   Útime_methodsr   r"   r.   r,   Ú<module>rH      sJ   ð÷ .Ó -å 2ß 6Ý 1Ý (Ý ð ×ÑÙ˜Ó&ô;-˜|ó ;-ó 'ó ñ;-r.   