
    gcv                        d Z ddlZddlZddlZddlZddlmZ ddlmZm	Z	m
Z
mZmZmZ ddlZddlmZ ddlmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% er e!            rddl&Z& e$j'        e(          Z)ed         Z* G d	 d
e          Z+ G d de          Z, ee,j-                  e,_-        e,j-        j         .e,j-        j         .                    ddd          e,j-        _         dS dS )zH
Feature extraction saving/loading class for common feature extractors.
    N)UserDict)TYPE_CHECKINGAnyDictOptionalTupleUnion   )custom_object_save)FEATURE_EXTRACTOR_NAMEPushToHubMixin
TensorTypeadd_model_info_to_auto_map"add_model_info_to_custom_pipelinescached_file	copy_funcdownload_urlis_flax_availableis_jax_tensoris_numpy_arrayis_offline_modeis_remote_urlis_tf_availableis_torch_availableis_torch_deviceis_torch_dtypeloggingrequires_backendsSequenceFeatureExtractorc                        e Zd ZdZddeeeef                  dedee	f         f fdZ
dedee         fdZdefd	Zd
 Zd Zd Zd Zd Zddeeee	f                  fdZddeeee	f                  fdZddZ xZS )BatchFeatureaU  
    Holds the output of the [`~SequenceFeatureExtractor.pad`] and feature extractor specific `__call__` methods.

    This class is derived from a python dictionary and can be used as a dictionary.

    Args:
        data (`dict`, *optional*):
            Dictionary of lists/arrays/tensors returned by the __call__/pad methods ('input_values', 'attention_mask',
            etc.).
        tensor_type (`Union[None, str, TensorType]`, *optional*):
            You can give a tensor_type here to convert the lists of integers in PyTorch/TensorFlow/Numpy Tensors at
            initialization.
    Ndatatensor_typec                 v    t                                          |           |                     |           d S )N)r#   )super__init__convert_to_tensors)selfr"   r#   	__class__s      a/var/www/html/ai-engine/env/lib/python3.11/site-packages/transformers/feature_extraction_utils.pyr&   zBatchFeature.__init__M   s8    K88888    itemreturnc                 d    t          |t                    r| j        |         S t          d          )z
        If the key is a string, returns the value of the dict associated to `key` ('input_values', 'attention_mask',
        etc.).
        zRIndexing with integers is not available when using Python based feature extractors)
isinstancestrr"   KeyErrorr(   r,   s     r*   __getitem__zBatchFeature.__getitem__Q   s2    
 dC   	q9T?"opppr+   c                 H    	 | j         |         S # t          $ r t          w xY wN)r"   r1   AttributeErrorr2   s     r*   __getattr__zBatchFeature.__getattr__[   s4    	!9T?" 	! 	! 	!  	!s    !c                     d| j         iS Nr"   r"   r(   s    r*   __getstate__zBatchFeature.__getstate__a   s    	""r+   c                 ,    d|v r|d         | _         d S d S r9   r:   )r(   states     r*   __setstate__zBatchFeature.__setstate__d   s!    U??fDIII ?r+   c                 4    | j                                         S r5   )r"   keysr;   s    r*   rA   zBatchFeature.keysi   s    y~~r+   c                 4    | j                                         S r5   )r"   valuesr;   s    r*   rC   zBatchFeature.valuesm   s    y!!!r+   c                 4    | j                                         S r5   )r"   itemsr;   s    r*   rE   zBatchFeature.itemsq   s    y   r+   c                    |dS t          |t                    st          |          }|t          j        k    r0t                      st	          d          dd l}|j        |j        }n|t          j        k    r.t                      st	          d          dd l
fdj        }nO|t          j        k    r2t                      st	          d          dd lm} |j        t           }ndfd	t"          }|fS )	NNNzSUnable to convert output to TensorFlow tensors format, TensorFlow is not installed.r   zMUnable to convert output to PyTorch tensors format, PyTorch is not installed.c                 *   t          | t          t          f          rt          |           dk    rt          | d         t          j                  rt	          j        |           } nut          | d         t          t          f          rSt          | d                   dk    r:t          | d         d         t          j                  rt	          j        |           } t          | t          j                  r j        |           S  j        |           S )Nr   )	r/   listtuplelennpndarrayarray
from_numpytensor)valuetorchs    r*   	as_tensorz5BatchFeature._get_is_as_tensor_fns.<locals>.as_tensor   s    edE]33 0E

Q!%(BJ77 0 ""58dE];;0aMMA--&uQx{BJ?? . !#eRZ00 /+5+E222'5<...r+   zEUnable to convert output to JAX tensors format, JAX is not installed.c                 V   t          | t          t          f          rwt          | d         t          t          t          j        f          rJd | D             }t          t          |                    dk    r| d | D             t                    } t          j        | |          S )Nr   c                 ,    g | ]}t          |          S  )rK   .0vals     r*   
<listcomp>zIBatchFeature._get_is_as_tensor_fns.<locals>.as_tensor.<locals>.<listcomp>   s    !<!<!<s#c((!<!<!<r+   r
   c                 6    g | ]}t          j        |          S rV   )rL   asarrayrW   s     r*   rZ   zIBatchFeature._get_is_as_tensor_fns.<locals>.as_tensor.<locals>.<listcomp>   s     *L*L*Ls2:c??*L*L*Lr+   )dtype)	r/   rI   rJ   rL   rM   rK   setobjectr\   )rQ   r]   
value_lensrS   s      r*   rS   z5BatchFeature._get_is_as_tensor_fns.<locals>.as_tensor   s    edE]33 \
58dTY[][eMf8g8g \!<!<e!<!<!<J3z??++a//EM )	*L*Le*L*L*LTZ [ [ [z%u5555r+   r5   )r/   r   
TENSORFLOWr   ImportError
tensorflowconstant	is_tensorPYTORCHr   rR   JAXr   	jax.numpynumpyrN   r   r   )r(   r#   tfre   jnprS   rR   s        @@r*   _get_is_as_tensor_fnsz"BatchFeature._get_is_as_tensor_fnst   sU   : +z22 	2$[11K *///"$$ !i   $###IIIJ...%'' s!"qrrrLLL/ / / / / IIJN**$&& k!"ijjj######	I%II6 6 6 6 6 6 'I)##r+   c                     || S |                      |          \  }}|                                 D ]J\  }}	  ||          s ||          }|| |<   "#  |dk    rt          d          t          d          xY w| S )a5  
        Convert the inner content to tensors.

        Args:
            tensor_type (`str` or [`~utils.TensorType`], *optional*):
                The type of tensors to use. If `str`, should be one of the values of the enum [`~utils.TensorType`]. If
                `None`, no modification is done.
        Noverflowing_valueszKUnable to create tensor returning overflowing values of different lengths. zUnable to create tensor, you should probably activate padding with 'padding=True' to have batched tensors with the same length.)rl   rE   
ValueError)r(   r#   re   rS   keyrQ   rP   s          r*   r'   zBatchFeature.convert_to_tensors   s     K#99+FF	9 **,, 	 	JC y'' '&Yu--F &DI...$%rsss X  
 s   A&A9c                    t          | dg           ddl}i }|                    d          }|t          |          dk    rt|d         }t	          |          rn\t          |t                    s$t          |          st          |t                    r|}n t          dt          |           d          | 
                                D ]q\  }}t          ||j                  r! |j        |          r |j        |i |||<   ;t          ||j                  r||                    |          ||<   l|||<   r|| _        | S )a  
        Send all values to device by calling `v.to(*args, **kwargs)` (PyTorch only). This should support casting in
        different `dtypes` and sending the `BatchFeature` to a different `device`.

        Args:
            args (`Tuple`):
                Will be passed to the `to(...)` function of the tensors.
            kwargs (`Dict`, *optional*):
                Will be passed to the `to(...)` function of the tensors.

        Returns:
            [`BatchFeature`]: The same instance after modification.
        rR   r   Ndevicez*Attempting to cast a BatchFeature to type z. This is not supported.)rr   )r   rR   getrK   r   r/   r0   r   intro   rE   Tensoris_floating_pointtor"   )	r(   argskwargsrR   new_datarr   argkvs	            r*   rw   zBatchFeature.to   sn    	$	***H%%>c$ii!mmq'Cc"" rC%% r)=)= rCQTAUAU r !!pcRUhh!p!p!pqqqJJLL 	  	 DAq!U\**  /Fu/Fq/I/I  "adD3F33Au|,,  1Cdd&d11	r+   rG   r5   )r-   r!   )__name__
__module____qualname____doc__r   r   r0   r   r	   r   r&   r3   r7   r<   r?   rA   rC   rE   rl   r'   rw   __classcell__)r)   s   @r*   r!   r!   >   sy        9 9Xd38n5 95QUWZ\fQfKg 9 9 9 9 9 9q qc
 q q q q! ! ! ! !# # #& & &
     " " "! ! !9$ 9$%Z:P1Q 9$ 9$ 9$ 9$v huS*_7M.N    >* * * * * * * *r+   r!   c                   ,   e Zd ZdZdZd ZdefdZe	 	 	 	 	 dde	ee
j        f         d	ee	ee
j        f                  d
ededee	eef                  defd            Zd de	ee
j        f         defdZede	ee
j        f         deeeef         eeef         f         fd            Zedeeef         defd            Zdeeef         fdZede	ee
j        f         defd            ZdefdZde	ee
j        f         fdZd Zed!d            ZdS )"FeatureExtractionMixinz
    This is a feature extraction mixin used to provide saving/loading functionality for sequential and image feature
    extractors.
    Nc           
         |                     dd          | _        |                                D ]N\  }}	 t          | ||           # t          $ r*}t
                              d| d| d|             |d}~ww xY wdS )z'Set elements of `kwargs` as attributes.processor_classNz
Can't set z with value z for )pop_processor_classrE   setattrr6   loggererror)r(   ry   rp   rQ   errs        r*   r&   zFeatureExtractionMixin.__init__  s     !'

+<d C C ,,.. 	 	JCc5))))!   M#MM5MMtMMNNN		 	s   A
A<%A77A<r   c                     || _         dS )z%Sets processor class as an attribute.N)r   )r(   r   s     r*   _set_processor_classz+FeatureExtractionMixin._set_processor_class  s     /r+   Fmainpretrained_model_name_or_path	cache_dirforce_downloadlocal_files_onlytokenrevisionc                     ||d<   ||d<   ||d<   ||d<   |                     dd          }|-t          j        dt                     |t	          d          |}|||d	<    | j        |fi |\  }	} | j        |	fi |S )
a  
        Instantiate a type of [`~feature_extraction_utils.FeatureExtractionMixin`] from a feature extractor, *e.g.* a
        derived class of [`SequenceFeatureExtractor`].

        Args:
            pretrained_model_name_or_path (`str` or `os.PathLike`):
                This can be either:

                - a string, the *model id* of a pretrained feature_extractor hosted inside a model repo on
                  huggingface.co.
                - a path to a *directory* containing a feature extractor file saved using the
                  [`~feature_extraction_utils.FeatureExtractionMixin.save_pretrained`] method, e.g.,
                  `./my_model_directory/`.
                - a path or url to a saved feature extractor JSON *file*, e.g.,
                  `./my_model_directory/preprocessor_config.json`.
            cache_dir (`str` or `os.PathLike`, *optional*):
                Path to a directory in which a downloaded pretrained model feature extractor should be cached if the
                standard cache should not be used.
            force_download (`bool`, *optional*, defaults to `False`):
                Whether or not to force to (re-)download the feature extractor files and override the cached versions
                if they exist.
            resume_download:
                Deprecated and ignored. All downloads are now resumed by default when possible.
                Will be removed in v5 of Transformers.
            proxies (`Dict[str, str]`, *optional*):
                A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
                'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
            token (`str` or `bool`, *optional*):
                The token to use as HTTP bearer authorization for remote files. If `True`, or not specified, will use
                the token generated when running `huggingface-cli login` (stored in `~/.huggingface`).
            revision (`str`, *optional*, defaults to `"main"`):
                The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
                git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any
                identifier allowed by git.


                <Tip>

                To test a pull request you made on the Hub, you can pass `revision="refs/pr/<pr_number>"`.

                </Tip>

            return_unused_kwargs (`bool`, *optional*, defaults to `False`):
                If `False`, then this function returns just the final feature extractor object. If `True`, then this
                functions returns a `Tuple(feature_extractor, unused_kwargs)` where *unused_kwargs* is a dictionary
                consisting of the key/value pairs whose keys are not feature extractor attributes: i.e., the part of
                `kwargs` which has not been used to update `feature_extractor` and is otherwise ignored.
            kwargs (`Dict[str, Any]`, *optional*):
                The values in kwargs of any keys which are feature extractor attributes will be used to override the
                loaded values. Behavior concerning key/value pairs whose keys are *not* feature extractor attributes is
                controlled by the `return_unused_kwargs` keyword parameter.

        Returns:
            A feature extractor of type [`~feature_extraction_utils.FeatureExtractionMixin`].

        Examples:

        ```python
        # We can't instantiate directly the base class *FeatureExtractionMixin* nor *SequenceFeatureExtractor* so let's show the examples on a
        # derived class: *Wav2Vec2FeatureExtractor*
        feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(
            "facebook/wav2vec2-base-960h"
        )  # Download feature_extraction_config from huggingface.co and cache.
        feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(
            "./test/saved_model/"
        )  # E.g. feature_extractor (or model) was saved using *save_pretrained('./test/saved_model/')*
        feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("./test/saved_model/preprocessor_config.json")
        feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(
            "facebook/wav2vec2-base-960h", return_attention_mask=False, foo=False
        )
        assert feature_extractor.return_attention_mask is False
        feature_extractor, unused_kwargs = Wav2Vec2FeatureExtractor.from_pretrained(
            "facebook/wav2vec2-base-960h", return_attention_mask=False, foo=False, return_unused_kwargs=True
        )
        assert feature_extractor.return_attention_mask is False
        assert unused_kwargs == {"foo": False}
        ```r   r   r   r   use_auth_tokenNrThe `use_auth_token` argument is deprecated and will be removed in v5 of Transformers. Please use `token` instead.V`token` and `use_auth_token` are both specified. Please set only the argument `token`.r   )r   warningswarnFutureWarningro   get_feature_extractor_dict	from_dict)
clsr   r   r   r   r   r   ry   r   feature_extractor_dicts
             r*   from_pretrainedz&FeatureExtractionMixin.from_pretrained  s    p ({#1 %5!"%z$4d;;%M E     l   #E#F7O)G)GHe)p)pio)p)p&s}3>>v>>>r+   save_directorypush_to_hubc           	         |                     dd          }|Dt          j        dt                     |                    dd          t          d          ||d<   t          j                            |          rt          d| d          t          j
        |d	           |rw|                     d
d          }|                     d|                    t          j        j                  d                   } | j        |fi |}|                     |          }| j        t!          | ||            t          j                            |t$                    }|                     |           t(                              d|            |r-|                     |||||                    d                     |gS )az  
        Save a feature_extractor object to the directory `save_directory`, so that it can be re-loaded using the
        [`~feature_extraction_utils.FeatureExtractionMixin.from_pretrained`] class method.

        Args:
            save_directory (`str` or `os.PathLike`):
                Directory where the feature extractor JSON file will be saved (will be created if it does not exist).
            push_to_hub (`bool`, *optional*, defaults to `False`):
                Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
                repository you want to push to with `repo_id` (will default to the name of `save_directory` in your
                namespace).
            kwargs (`Dict[str, Any]`, *optional*):
                Additional key word arguments passed along to the [`~utils.PushToHubMixin.push_to_hub`] method.
        r   Nr   r   r   zProvided path (z#) should be a directory, not a fileT)exist_okcommit_messagerepo_id)configzFeature extractor saved in )r   r   )r   r   r   r   rs   ro   ospathisfileAssertionErrormakedirssplitsep_create_repo_get_files_timestamps_auto_classr   joinr   to_json_filer   info_upload_modified_files)	r(   r   r   ry   r   r   r   files_timestampsoutput_feature_extractor_files	            r*   save_pretrainedz&FeatureExtractionMixin.save_pretrained  s     $4d;;%M E   zz'4((4 l   -F7O7>>.)) 	h !f>!f!f!fggg
NT2222 	J#ZZ(8$??NjjN,@,@,M,Mb,QRRG'd'::6::G#99.II 't^DAAAA )+^E[(\(\%7888Q2OQQRRR 	'' -jj)) (    ...r+   r-   c                    |                     dd          }|                     dd          }|                     dd          }|                     dd          }|                     dd          }|                     dd          }|                     d	d          }	|                     d
d          }
|                     dd          }|	-t          j        dt                     |t	          d          |	}|                     dd          }|                     dd          }d|d}|||d<   t                      r|
st                              d           d}
t          |          }t          j
                            |          }t          j
                            |          r%t          j
                            |t                    }t          j
                            |          r|}d}nzt          |          r|}t!          |          }nYt          }	 t#          |||||||
||||          }n6# t$          $ r  t&          $ r t%          d| d| dt           d          w xY w	 t)          |dd          5 }|                                }ddd           n# 1 swxY w Y   t-          j        |          }n&# t,          j        $ r t%          d| d          w xY w|rt                              d|            n t                              d| d |            |s:d!|v rt3          |d!         |          |d!<   d"|v rt5          |d"         |          |d"<   ||fS )#a6  
        From a `pretrained_model_name_or_path`, resolve to a dictionary of parameters, to be used for instantiating a
        feature extractor of type [`~feature_extraction_utils.FeatureExtractionMixin`] using `from_dict`.

        Parameters:
            pretrained_model_name_or_path (`str` or `os.PathLike`):
                The identifier of the pre-trained checkpoint from which we want the dictionary of parameters.

        Returns:
            `Tuple[Dict, Dict]`: The dictionary(ies) that will be used to instantiate the feature extractor object.
        r   Nr   Fresume_downloadproxies	subfolderr   r   r   r   r   r   _from_pipeline
_from_autofeature extractor)	file_typefrom_auto_classusing_pipelinez+Offline mode: forcing local_files_only=TrueT)	r   r   r   r   r   r   r   
user_agentr   z"Can't load feature extractor for 'z'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'z2' is the correct path to a directory containing a z filerutf-8encodingz"It looks like the config file at 'z' is not a valid JSON file.zloading configuration file z from cache at auto_mapcustom_pipelines)r   r   r   r   ro   r   r   r   r0   r   r   isdirr   r   r   r   r   r   EnvironmentError	ExceptionopenreadjsonloadsJSONDecodeErrorr   r   )r   r   ry   r   r   r   r   r   r   r   r   r   from_pipeliner   r   is_localfeature_extractor_fileresolved_feature_extractor_filereadertextr   s                        r*   r   z1FeatureExtractionMixin.get_feature_extractor_dict  si    JJ{D11	$4e<< **%6==**Y--JJ{D11	

7D))$4d;;!::&8%@@::j$//%M E     l   #E

#3T:: **\599#6?[[
$+8J'( 	$%5 	$KKEFFF#(+,I(J(J%7==!>??7==677 	i%'W\\2OQg%h%h"7>>788 "	.K+HH899 	%B".:;X.Y.Y++%;"2=1*'#1#$3%5')%3 3 3// $       &M9V M M9VM M 0FM M M  		5sWMMM %QW{{}}% % % % % % % % % % % % % % %%)Z%5%5""# 	 	 	"q5Tqqq  	
  	KKW6UWWXXXXKKv.DvvUtvv    	3335O*:68U6 6&z2 "%;;;=_*+=>@]> >&'9: &v--s<   H4 43I'+J> =JJ> J""J> %J"&J> >#K!r   c                 2   |                     dd          }g }|                                D ]#\  }}||v r|||<   |                    |           $|D ]}|                     |d            | di |}t                              d|            |r||fS |S )a	  
        Instantiates a type of [`~feature_extraction_utils.FeatureExtractionMixin`] from a Python dictionary of
        parameters.

        Args:
            feature_extractor_dict (`Dict[str, Any]`):
                Dictionary that will be used to instantiate the feature extractor object. Such a dictionary can be
                retrieved from a pretrained checkpoint by leveraging the
                [`~feature_extraction_utils.FeatureExtractionMixin.to_dict`] method.
            kwargs (`Dict[str, Any]`):
                Additional parameters from which to initialize the feature extractor object.

        Returns:
            [`~feature_extraction_utils.FeatureExtractionMixin`]: The feature extractor object instantiated from those
            parameters.
        return_unused_kwargsFNzFeature extractor rV   )r   rE   appendr   r   )r   r   ry   r   	to_removerp   rQ   feature_extractors           r*   r   z FeatureExtractionMixin.from_dict5  s    $  &zz*@%HH 	 ,,.. 	& 	&JC,,,.3&s+  %%% 	" 	"CJJsD!!!!C99"899<):<<=== 	%$f,,$$r+   c                 r    t          j        | j                  }| j        j        |d<   d|v r|d= d|v r|d= |S )z
        Serializes this instance to a Python dictionary. Returns:
            `Dict[str, Any]`: Dictionary of all the attributes that make up this configuration instance.
        feature_extractor_typemel_filterswindow)copydeepcopy__dict__r)   r~   )r(   outputs     r*   to_dictzFeatureExtractionMixin.to_dictZ  sP    
 t}--+/>+B'(F""}%vx r+   	json_filec                     t          |dd          5 }|                                }ddd           n# 1 swxY w Y   t          j        |          } | di |S )a  
        Instantiates a feature extractor of type [`~feature_extraction_utils.FeatureExtractionMixin`] from the path to
        a JSON file of parameters.

        Args:
            json_file (`str` or `os.PathLike`):
                Path to the JSON file containing the parameters.

        Returns:
            A feature extractor of type [`~feature_extraction_utils.FeatureExtractionMixin`]: The feature_extractor
            object instantiated from that JSON file.
        r   r   r   NrV   )r   r   r   r   )r   r   r   r   r   s        r*   from_json_filez%FeatureExtractionMixin.from_json_fileg  s     )S7333 	!v;;==D	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!!%D!1!1s,,+,,,s   488c                 .   |                                  }|                                D ]6\  }}t          |t          j                  r|                                ||<   7|                    dd          }|||d<   t          j        |dd          dz   S )z
        Serializes this instance to a JSON string.

        Returns:
            `str`: String containing all the attributes that make up this feature_extractor instance in JSON format.
        r   Nr      T)indent	sort_keys
)	r   rE   r/   rL   rM   tolistr   r   dumps)r(   
dictionaryrp   rQ   r   s        r*   to_json_stringz%FeatureExtractionMixin.to_json_stringz  s     \\^^
$**,, 	1 	1JC%,, 1"',,..
3 &>>*<dCC',<J()z*Q$???$FFr+   json_file_pathc                     t          |dd          5 }|                    |                                            ddd           dS # 1 swxY w Y   dS )z
        Save this instance to a JSON file.

        Args:
            json_file_path (`str` or `os.PathLike`):
                Path to the JSON file in which this feature_extractor instance's parameters will be saved.
        wr   r   N)r   writer   )r(   r   writers      r*   r   z#FeatureExtractionMixin.to_json_file  s     .#888 	0FLL,,..///	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0s   (AAAc                 H    | j         j         d|                                  S )N )r)   r~   r   r;   s    r*   __repr__zFeatureExtractionMixin.__repr__  s'    .)CCD,?,?,A,ACCCr+   AutoFeatureExtractorc                     t          |t                    s|j        }ddlmc m} t          ||          st          | d          || _        dS )a  
        Register this class with a given auto class. This should only be used for custom feature extractors as the ones
        in the library are already mapped with `AutoFeatureExtractor`.

        <Tip warning={true}>

        This API is experimental and may have some slight breaking changes in the next releases.

        </Tip>

        Args:
            auto_class (`str` or `type`, *optional*, defaults to `"AutoFeatureExtractor"`):
                The auto class to register this new feature extractor with.
        r   Nz is not a valid auto class.)	r/   r0   r~   transformers.models.automodelsautohasattrro   r   )r   
auto_classauto_modules      r*   register_for_auto_classz.FeatureExtractionMixin.register_for_auto_class  sn      *c** 	-#,J666666666{J// 	I
GGGHHH$r+   )NFFNr   )F)r   )r~   r   r   r   r   r&   r0   r   classmethodr	   r   PathLiker   boolr   r   r   r   r   r   PreTrainedFeatureExtractorr   r   r   r   r   r   r  rV   r+   r*   r   r      s        
 K
 
 
0C 0 0 0 0  8<$!&,0m? m?',S"+-='>m? E#r{"234m? 	m?
 m? c4i()m? m? m? m? [m?^;/ ;/eC4D.E ;/TX ;/ ;/ ;/ ;/z r.,1#r{2B,Cr.	tCH~tCH~-	.r. r. r. [r.h "%tCH~ "%Lf "% "% "% ["%Hc3h     -uS"+-='> -C] - - - [-$G G G G G*	05bk1A+B 	0 	0 	0 	0D D D % % % [% % %r+   r   r   r   zfeature extractor file)r_   object_classobject_files)/r   r   r   r   r   collectionsr   typingr   r   r   r   r   r	   ri   rL   dynamic_module_utilsr   utilsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rR   
get_loggerr~   r   r  r!   r   r   formatrV   r+   r*   <module>r     su      				              C C C C C C C C C C C C C C C C     4 4 4 4 4 4                                         .    
	H	%	%"#=> z z z z z8 z z zzz% z% z% z% z%^ z% z% z%z &/Y/E/Q%R%R  "%-91G1S1[1b1b"1GVn 2c 2 2&... :9r+   