§
    ‚ŠtjN  ã                   óˆ   — 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dS )é    )Ú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).
    FTNc                 ó^   — |€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          úg/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/pipelines/feature_extraction.pyÚ_sanitize_parametersz.FeatureExtractionPipeline._sanitize_parameters-   sk   € ØÐ"Ø ˆOàÐ!Ø˜Ð.Ð.Ý Ørñô ð ð -7ˆO˜LÑ)à+ÐàÐØÐ%Ø3AÐÐ/Ñ0à  "Ð&8Ð8Ð8ó    Úreturnc                 ó&   —  | j         |fddi|¤Ž}|S )Nr   Úpt)Ú	tokenizer)r   Úinputsr   Úmodel_inputss       r   Ú
preprocessz$FeatureExtractionPipeline.preprocess@   s&   € Ø%�t”~ fÐUÐU¸TÐUÀ_ÐUÐUˆØÐr   c                 ó    —  | j         di |¤Ž}|S )N© )Úmodel)r   r   Úmodel_outputss      r   Ú_forwardz"FeatureExtractionPipeline._forwardD   s   € Ø"˜œ
Ð2Ð2 \Ð2Ð2ˆØÐr   c                 óJ   — |r|d         S |d                               ¦   «         S )Nr   )Útolist)r   r$   r   s      r   Úpostprocessz%FeatureExtractionPipeline.postprocessH   s,   € àð 	$Ø  Ô#Ð#Ø˜QÔ×&Ò&Ñ(Ô(Ð(r   Úargsr   c                 ó6   •—  t          ¦   «         j        |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!   ø€ ð  �u‰wŒwÔ Ð0¨Ð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      sà   ø€ € € € € ðð ð0 €OØ!ÐØ#ÐØ€Oð9ð 9ð 9ð 9ð&°t¸CÀÐ<NÔ7Oð ð ð ð ðð ð ð)ð )ð )ð )ð
1˜c D¨¤I™oð 
1¸ð 
1ÀÀtÈCÄyÁð 
1ð 
1ð 
1ð 
1ð 
1ð 
1ð 
1ð 
1ð 
1ð 
1r   r   N)	Útypingr   Úutilsr   Úbaser   r   r	   r   r"   r   r   ú<module>r=      sº   ðØ Ð Ð Ð Ð Ð à &Ð &Ð &Ð &Ð &Ð &Ø CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ Cð ÐØÐ¨4ÈÐNÑNÔNðkñô ðI1ð I1ð I1ð I1ð I1 ñ I1ô I1ñô ðI1ð I1ð I1r   