Ë
    HêñiN  ã                   ón   — d dl mZ ddlmZ ddlmZmZmZ  e edd¬«      d	«       G d
„ de«      «       Zy)é    )ÚAnyé   )Úadd_end_docstringsé   )ÚGenericTensorÚPipelineÚbuild_pipeline_init_argsTF)Úhas_tokenizerÚsupports_binary_outputa  
        tokenize_kwargs (`dict`, *optional*):
                Additional dictionary of keyword arguments passed along to the tokenizer.
        return_tensors (`bool`, *optional*):
            If `True`, returns a tensor according to the specified framework, otherwise returns a list.c                   ó„   ‡ — e Zd ZdZdZdZdZdZdd„Zde	e
ef   fd„Zd„ Zdd„Zd	e
ee
   z  d
edeee   z  fˆ fd„Zˆ xZS )ÚFeatureExtractionPipelineaÝ  
    Feature extraction pipeline uses no model head. This pipeline extracts the hidden states from the base
    transformer, which can be used as features in downstream tasks.

    Example:

    ```python
    >>> from transformers import pipeline

    >>> extractor = pipeline(model="google-bert/bert-base-uncased", task="feature-extraction")
    >>> result = extractor("This is a simple test.", return_tensors=True)
    >>> result.shape  # This is a tensor of shape [1, sequence_length, hidden_dimension] representing the input string.
    torch.Size([1, 8, 768])
    ```

    Learn more about the basics of using a pipeline in the [pipeline tutorial](../pipeline_tutorial)

    This feature extraction pipeline can currently be loaded from [`pipeline`] using the task identifier:
    `"feature-extraction"`.

    All models may be used for this pipeline. See a list of all models, including community-contributed models on
    [huggingface.co/models](https://huggingface.co/models).
    FTc                 óV   — |€i }|�d|v rt        d«      ‚||d<   |}i }|�||d<   |i |fS )NÚ
truncationz\truncation parameter defined twice (given as keyword argument as well as in tokenize_kwargs)Úreturn_tensors)Ú
ValueError)Úselfr   Útokenize_kwargsr   ÚkwargsÚpreprocess_paramsÚpostprocess_paramss          úk/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/transformers/pipelines/feature_extraction.pyÚ_sanitize_parametersz.FeatureExtractionPipeline._sanitize_parameters-   sc   € ØÐ"Ø ˆOàÐ!Ø˜Ñ.Ü Øróð ð -7ˆO˜LÑ)à+ÐàÐØÐ%Ø3AÐÐ/Ñ0à  "Ð&8Ð8Ð8ó    Úreturnc                 ó0   —  | j                   |fddi|¤Ž}|S )Nr   Úpt)Ú	tokenizer)r   Úinputsr   Úmodel_inputss       r   Ú
preprocessz$FeatureExtractionPipeline.preprocess@   s"   € Ø%�t—~‘~ fÑU¸TÐUÀ_ÑUˆØÐr   c                 ó*   —  | j                   di |¤Ž}|S )N© )Úmodel)r   r   Úmodel_outputss      r   Ú_forwardz"FeatureExtractionPipeline._forwardD   s   € Ø"˜Ÿ
™
Ñ2 \Ñ2ˆØÐr   c                 ó6   — |r|d   S |d   j                  «       S )Nr   )Útolist)r   r$   r   s      r   Úpostprocessz%FeatureExtractionPipeline.postprocessH   s$   € áØ  Ñ#Ð#Ø˜QÑ×&Ñ&Ó(Ð(r   Úargsr   c                 ó"   •— t        ‰| �  |i |¤ŽS )a  
        Extract the features of the input(s) text.

        Args:
            args (`str` or `list[str]`): One or several texts (or one list of texts) to get the features of.

        Return:
            A nested list of `float`: The features computed by the model.
        )ÚsuperÚ__call__)r   r)   r   Ú	__class__s      €r   r,   z"FeatureExtractionPipeline.__call__N   s   ø€ ô ‰wÑ Ð0¨Ñ0Ð0r   )NNN)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú_load_processorÚ_load_image_processorÚ_load_feature_extractorÚ_load_tokenizerr   ÚdictÚstrr   r    r%   r(   Úlistr   r,   Ú__classcell__)r-   s   @r   r   r      st   ø„ ñð0 €OØ!ÐØ#ÐØ€Oó9ð&°t¸CÀÐ<NÑ7Oó òó)ð
1˜c D¨¡I™oð 
1¸ð 
1ÀÀtÈCÁyÁ÷ 
1ñ 
1r   r   N)	Útypingr   Úutilsr   Úbaser   r   r	   r   r"   r   r   ú<module>r=      sD   ðÝ å &ß CÑ Cñ Ù¨4ÈÔNðkóôI1 ó I1óñI1r   