CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
modelcard.cpython-310.pyc264 linesDownload Raw Back to __pycache__
1o

2.�Yi��@sNdZddlZddlZddlZddlZddlmZddlmZddl	m3Z4mZmZddl
Z
ddlZddlmZddlmZddlmZd	d5lmZd	dlmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&d	dl'm(Z(d	d
l)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1eeeeee e!e"e$e%eie�e#�e&ed�Z2e1�3e4�Z5Gdd�d�Z6dZ7dZ8idd�dd�dd�dd�dd�dd�dd �d!d"�d#d$�d%d&�d'd(�d)d*�d+d,�d-d.�d/d0�d1d2�Z9gd3�Z:d4d5�Z;d6d7�Z<d8d9�Z=d:d;�Z>d<d=�Z?d>d?�Z@eGd@dA�dA��ZAdBdC�ZBdDdE�ZCdFdG�ZDdTdIdJ�ZEdKdL�ZFdMdN�ZGdOdP�ZHgdQ�ZIdRdS�ZJdS)Uz'Configuration base class and utilities.�N)�	dataclass)�Path)�Any�Optional�Union)�6model_info)�OfflineModeIsEnabled)�HFValidationError�)�__version__)�,MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES�!MODEL_FOR_CAUSAL_LM_MAPPING_NAMES�MODEL_FOR_CTC_MAPPING_NAMES�,MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES�*MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES�*MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING_NAMES�!MODEL_FOR_MASKED_LM_MAPPING_NAMES�(MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES�*MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES�,MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES�/MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES�(MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES�0MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING_NAMES�,MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES�6MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING_NAMES)�ParallelMode)�MODEL_CARD_NAME�cached_file�is_datasets_available�is_offline_mode�is_tf_available�is_tokenizers_available�is_torch_available�logging)�text-generation�image-classification�image-segmentation�	fill-mask�object-detection�question-answering�text2text-generation�text-classification�table-question-answering�token-classification�audio-classification�automatic-speech-recognitionzzero-shot-image-classificationzimage-text-to-textc@sleZdZdZdd�Zdd�Zedd��Zedd	��Zed7d��Z	dd
�Z8dd�Zdd�Zdd�Z
dd�ZdS)�	ModelCarda9    Structured Model Card class. Store model card as well as methods for loading/downloading/saving model cards.10 11    Please read the following paper for details and explanation on the sections: "Model Cards for Model Reporting" by12    Margaret Mitchell, Simone Wu, Andrew Zaldivar, Parker Barnes, Lucy Vasserman, Ben Hutchinson, Elena Spitzer,13    Inioluwa Deborah Raji and Timnit Gebru for the proposal behind model cards. Link: https://huggingface.co/papers/1810.0399314 15    Note: A model card can be loaded and saved to disk.16    cKs�t�dt�|�di�|_|�di�|_|�di�|_|�di�|_|�di�|_|�di�|_	|�di�|_17|�d	i�|_|�d18i�|_|�
�D](\}}zt|||�WqItyq}zt�d|�d|�d
|���|�d}~wwdS)NzTThe class `ModelCard` is deprecated and will be removed in version 5 of Transformers�
model_details�intended_use�factors�metrics�evaluation_data�
training_data�quantitative_analyses�ethical_considerations�caveats_and_recommendationsz19Can't set z with value z for )�warnings�warn�
FutureWarning�popr1r2r3r4r5r6r7r8r9�items�setattr�AttributeError�logger�error)�self�kwargs�key�value�err�rH��E:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\transformers/modelcard.py�__init__\s*����zModelCard.__init__cCs>tj�|�rtj�|t�}n|}|�|�t�d|���dS)zKSave a model card object to the directory or file `save_directory_or_file`.zModel card saved in N)�os�path�isdir�joinr�to_json_filerA�info)rCZsave_directory_or_fileZoutput_model_card_filerHrHrI�save_pretrainedss2021zModelCard.save_pretrainedc	KsB|�dd�}|�dd�}|�dd�}|�dd�}ddi}|dur$||d	<tj�|�}tj�|�r5|}	d22}n6z&t|t|||d�}	|rJt�d|	���nt�dt�d
|	���|�	|	�}23Wnt24tjfyj|�}25Ynwg}|�
�D]\}}
t|26|�r�t|27||
�|�|�qq|D]}|�|d�q�t�d|28���|r�|29|fS|30S)a�	31        Instantiate a [`ModelCard`] from a pre-trained model model card.32 33        Parameters:34            pretrained_model_name_or_path: either:35 36                - a string, the *model id* of a pretrained model card hosted inside a model repo on huggingface.co.37                - a path to a *directory* containing a model card file saved using the [`~ModelCard.save_pretrained`]38                  method, e.g.: `./my_model_directory/`.39                - a path or url to a saved model card JSON *file*, e.g.: `./my_model_directory/modelcard.json`.40 41            cache_dir: (*optional*) string:42                Path to a directory in which a downloaded pre-trained model card should be cached if the standard cache43                should not be used.44 45            kwargs: (*optional*) dict: key/value pairs with which to update the ModelCard object after loading.46 47                - The values in kwargs of any keys which are model card attributes will be used to override the loaded48                  values.49                - Behavior concerning key/value pairs whose keys are *not* model card attributes is controlled by the50                  *return_unused_kwargs* keyword parameter.51 52            proxies: (*optional*) dict, default None:53                A dictionary of proxy servers to use by protocol or endpoint, e.g.: {'http': 'foo.bar:3128',54                'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.55 56            return_unused_kwargs: (*optional*) bool:57 58                - If False, then this function returns just the final model card object.59                - If True, then this functions returns a tuple *(model card, unused_kwargs)* where *unused_kwargs* is a60                  dictionary consisting of the key/value pairs whose keys are not model card attributes: ie the part of61                  kwargs which has not been used to update *ModelCard* and is otherwise ignored.62 63        Examples:64 65        ```python66        # Download model card from huggingface.co and cache.67        modelcard = ModelCard.from_pretrained("google-bert/bert-base-uncased")68        # Model card was saved using *save_pretrained('./test/saved_model/')*69        modelcard = ModelCard.from_pretrained("./test/saved_model/")70        modelcard = ModelCard.from_pretrained("./test/saved_model/modelcard.json")71        modelcard = ModelCard.from_pretrained("google-bert/bert-base-uncased", output_attentions=True, foo=False)72        ```�	cache_dirN�proxies�return_unused_kwargsFZ_from_pipeline�	file_type�73model_cardZusing_pipelineT)�filenamerRrS�74user_agentzloading model card file z from cache at zModel card: )r=rKrLrM�isfilerrrArP�from_json_file�OSError�json�JSONDecodeErrorr>�hasattrr?�append)�clsZpretrained_model_name_or_pathrDrRrSrTZ
from_pipelinerX�is_localZresolved_model_card_fileZ	modelcard�	to_removerErFrHrHrI�from_pretrained~sL-�75�7677�zModelCard.from_pretrainedcCs|di|��S)z@Constructs a `ModelCard` from a Python dictionary of parameters.NrHrH)r`Zjson_objectrHrHrI�	from_dict�szModelCard.from_dictcCsLt|dd��}|��}Wd�n1swYt�|�}|di|��S)z8Constructs a `ModelCard` from a json file of parameters.�utf-8��encodingNrH)�open�readr\�loads)r`Z	json_file�reader�text�dict_objrHrHrIrZ�s7879�80zModelCard.from_json_filecCs|j|jkS�N)�__dict__)rC�otherrHrHrI�__eq__��zModelCard.__eq__cCst|���Srn)�str�to_json_string�rCrHrHrI�__repr__�rrzModelCard.__repr__cCst�|j�}|S)z0Serializes this instance to a Python dictionary.)�copy�deepcopyro)rC�outputrHrHrI�to_dict�szModelCard.to_dictcCstj|��ddd�dS)z*Serializes this instance to a JSON string.�T)�indent�	sort_keys�81)r\�dumpsrzrurHrHrIrt�szModelCard.to_json_stringcCsBt|ddd��}|�|���Wd�dS1swYdS)z"Save this instance to a json file.�wrerfN)rh�writert)rCZjson_file_path�writerrHrHrIrO�s"�zModelCard.to_json_fileN)�__name__�82__module__�__qualname__�__doc__rJrQ�classmethodrcrdrZrqrvrzrtrOrHrHrHrIr0Qs8384]8586r0z�87<!-- This model card has been generated automatically according to the information the Trainer had access to. You88should probably proofread and complete it, then remove this comment. -->89z�90<!-- This model card has been generated automatically according to the information Keras had access to. You should91probably proofread and complete it, then remove this comment. -->92r'zMasked Language Modelingr%zImage Classificationr&zImage Segmentationzmultiple-choicezMultiple Choicer(zObject Detectionr)zQuestion AnsweringZ
summarizationZ
Summarizationr,zTable Question Answeringr+zText Classificationr$zCausal Language Modelingr*z&Sequence-to-sequence Language Modelingr-zToken Classification�translationZTranslationzzero-shot-classificationzZero Shot Classificationr/zAutomatic Speech Recognitionr.zAudio Classification)ZaccuracyZbleu�f1Zmatthews_correlationZpearsonr�	precisionZrecall�rougeZ	sacrebleuZ	spearmanrZwercCs |durgSt|t�r|gS|Srn)�93isinstancers)�objrHrHrI�_listify,s9495r�cCsF|dur|St|t�r|g}dd�|D�}t|�dkr|S|||<|S)NcSsg|]}|dur|�qSrnrH��.0�vrHrHrI�96<listcomp>:sz*_insert_values_as_list.<locals>.<listcomp>r)r�rs�len)�metadata�name�valuesrHrHrI�_insert_values_as_list5s97r�cCs\|duriSi}|D]!}|���dd�tvr!|||���dd�<q98|��dkr+||d<q99|S)N� �_Zrouge1r�)�lower�replace�METRIC_TAGS)�eval_results�resultrErHrHrI�#infer_metric_tags_from_eval_resultsAs�r�cCs|dur|S|||<|SrnrH)r�r�rFrHrHrI�
_insert_valueMsr�cCs(t�sdSddlm}m}t|||f�S)NFr)�Dataset�IterableDataset)r�datasetsr�r�r�)�datasetr�r�rHrHrI�
is_hf_datasetTsr�cCs<g}|��D]}t|ttf�r|t|�7}q|�|�q|Srn)r�r��tuple�listr_)�mappingr�r�rHrHrI�_get_mapping_values]sr�c@s�eZdZUeed<dZeeeeefed<dZ	eeed<dZ100eeeeefed<dZeeed<dZeeeeefed<dZ
eeeeefed<dZeeeeefed	<dZeeeeefed101<dZeeeefed<dZeeeefed<dZeeeed
<dZeeeefed<dZeeed<dd�Zdd�Zdd�Zdd�Ze										ddd��Ze									ddd��ZdS)�TrainingSummary�102model_nameN�language�license�tags�finetuned_from�tasksr��dataset_tags�dataset_args�dataset_metadatar��103eval_lines�hyperparameters�trainer�sourcecCs�|jdurAt�sC|jdurEt|j�dkrGzt|j�}|jD]}|�d�r+|dd�|_qWdStjj	tjj104ttfy@YdSwdSdSdSdS)Nrzlicense:�)
r�rr�r�rr��105startswith�requests�106exceptions�	HTTPError�ConnectionErrorr	r)rCrP�tagrHrHrI�
__post_init__xs.107�108109110111��112���zTrainingSummary.__post_init__cs�d|ji}t|j�}t|j�}t|j�}t|j�}t|�t|�kr.|dgt|�t|�}tt||���tt||��}tt||��}dd�t|j	�D�}	g|d<t|	�dkr`t��dkr`|gSt|	�dkrjddi}	t��dkrtddi��fdd�|	D�}113|114D]s\}}i}
|dur�|	||d�|
d	<|dur�|�115|i�}�||d�|�|
d116<||dur�|||
d117d<t|�dkr�g|
d<|��D]\}}|
d�|||j
|d
��q�d	|
vr�d118|
vr�d|
vr�|d�|
�qt�d|
���q|gS)Nr�cSsi|]}|tvr|t|�qSrH)�TASK_TAG_TO_NAME_MAPPING)r��taskrHrHrI�119<dictcomp>�sz6TrainingSummary.create_model_index.<locals>.<dictcomp>�resultsrcsg|]}�D]}||f�qqSrHrH)r��task_tag�ds_tag�Zdataset_mappingrHrIr��sz6TrainingSummary.create_model_index.<locals>.<listcomp>)r��typer�r��argsr4)r�r�rFzLDropping the following result as it does not have all the necessary fields:120)r�r�r�r�r�r�r��dict�zipr��getr>r_r�rArP)rC�metric_mappingZmodel_indexZ
dataset_namesr�r�r�Zdataset_arg_mappingZdataset_metadata_mappingZtask_mappingZall_possibilitiesr�r�r�r�Z121metric_tagZmetric_namerHr�rI�create_model_index�s^122123124125126�����	z"TrainingSummary.create_model_indexcCs�t|j�}i}t|dd�}t|d|j�}t|d|j�}|jdur4t|jt�r4t	|j�dkr4t|d|j�}t|d|j127�}t|d|j�}t|d	t|�
���}|�|�|d128<|S)NZlibrary_nameZtransformersr�r�rZ129base_modelr�r�r4zmodel-index)r�r�r�r�r�r�r�r�rsr�r�r�r��keysr�)rCr�r�rHrHrI�create_metadata�s130$zTrainingSummary.create_metadatacCs�d}tj|��dd�}t|�dkrd|�d�}|jdkr!|t7}n|t7}|d|j�d�7}|jdur8|d	7}n
|d131|j�d|j�d�7}|j	dusWt132|j	t�r\t|j	�dkr\|d
7}nEt133|j	t�rl|d|j	�d�7}n5t134|j	t
tf�r�t|j	�dkr�|d|j	d�d�7}n|d�dd�|j	dd�D��d|j	d�d�7}|jdur�|d7}|d�dd�|j��D��7}|d7}|d7}|d7}|d7}|d7}|d7}|jdur�|d7}|d�d d�|j��D��7}|d7}n|d!7}|jdu�r|d"7}|t|j�7}|d7}|d#7}|d$t�d�7}|jdk�r+t��r+ddl}|d%|j�d�7}n|jd&k�rBt��rBddl}|d'|j�d�7}t��rSddl}|d(|j�d�7}t��rdddl}|d)|j�d�7}|S)*N�F)r}rz---135r�z136# z137 138z'This model was trained from scratch on z'This model is a fine-tuned version of [z](https://huggingface.co/z) on zan unknown dataset.�the z	 dataset.r139z, cSsg|]}d|���qS)r�rH)r�ZdsrHrHrIr��sz1TrainingSummary.to_model_card.<locals>.<listcomp>�����z	 and the z140 datasets.z:141It achieves the following results on the evaluation set:142r~cSs$g|]\}}d|�dt|����qS�z- z: ��_maybe_round�r�r�rFrHrHrIr�s$z/143## Model description144 145More information needed146z9147## Intended uses & limitations148 149More information needed150z:151## Training and evaluation data152 153More information needed154z155## Training procedure156z157### Training hyperparameters158z:159The following hyperparameters were used during training:160cSs g|]\}}d|�d|���qSr�rHr�rHrHrIr�� z161More information needed162z163### Training results164 165z166### Framework versions167 168z- Transformers z169- Pytorch �kerasz
- TensorFlow z- Datasets z
- Tokenizers )�yaml�dumpr�r�r��AUTOGENERATED_TRAINER_COMMENT�AUTOGENERATED_KERAS_COMMENTr�r�r�r�r�rsr�rNr�r>r�r��make_markdown_tablerr"�torchr Z170tensorflowrr�r!�171tokenizers)rCrVr�r��tfr�r�rHrHrI�
to_model_card�sv172173174175���$176.�177178179zTrainingSummary.to_model_cardcCs�|jdur|jn|j}t|�r?|dus|dus|	dur?|j}
|
dvr?|	dur0|jt|j�d�g}	|dur7|
g}|dur?|jg}|180durI|durI|}181|durbt|jj	d�rbt182j�|jj	j
�sb|jj	j
}|dur||jjj}t��D]\}}|t|�vr{|}qo|dur�t|jj�j}t|�dkr�|}|dur�dg}nt|t�r�|dkr�|dg}n	d|vr�|�d�t|jj�\}}}t|�}||||||||183|||	|||d�
S)N��csvr\ZpandasZparquetrl)�config�split�
_name_or_pathrZgenerated_from_trainer)
r�r�r�r�r�r�r�r�r�r�r�r�r�)Zeval_datasetZ
train_datasetr��builder_name�config_namersr�r^�modelr�rKrLrMr��	__class__r��TASK_MAPPINGr>r�rr��184output_dirr�r�r�r_�parse_log_history�state�log_history�$extract_hyperparameters_from_trainer)r`r�r�r�r�r�r�r�r�r�r�r�Zone_dataset�default_tag�model_class_namer�r�r�r�r�r�rHrHrI�from_trainer,sf ��185186�187188�zTrainingSummary.from_trainercCsF|189dur&t|190�r&|	dus|dur&|191j}|dvr&|	dur|g}	|dur&|192jg}|193dur0|	dur0|	}194|durFt|jd�rFtj�|jj�sF|jj}|dur_|j	j195}
t��D]\}}|
t
|�vr^|}qR|durgdg}nt|t�ru|dkru|dg}n	d|vr~|�d�|dur�t|�\}}}ng}i}t|�}||||||||	|196||||dd�
S)Nr�r�Zgenerated_from_keras_callbackr�)
r�r�r�r�r�r�r�r�r�r�r�r�r�)r�r�r�r^r�rKrLrMr�r�r�r�r>r�r�rsr_�parse_keras_history�"extract_hyperparameters_from_keras)r`r�r�Z
keras_historyr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rHrHrI�197from_keraszs`198���199200�zTrainingSummary.from_keras)201NNNNNNNNNN)	NNNNNNNNN)r�r�r�rs�__annotations__r�rrr�r�r�r�r�r�r�r�r�r�rr��floatr�r�r�r�r�r�r�r�r�r�rHrHrHrIr�gsT202?P�M�r�c	s�t�d�rt�d�sdgifS�j�jd<�j�n�fdd��dD��g}tt�d��D]F��fdd����D�}i}|��D]-\}}|�d�rSd	|d203d�}n|dkr[d|}|�d�}d
�dd�|D��}|||<qA|�	|�q.|d}�||fS)z�204    Parse the `logs` of either a `keras.History` object returned by `model.fit()` or an accumulated logs `dict`205    passed to the `PushToHubCallback`. Returns lines and logs compatible with those returned by `parse_log_history`.206    �history�epochNcs i|]���fdd��D��qS)csg|]}|��qSrHrH)r�Zsingle_dict��log_keyrHrIr���z2parse_keras_history.<locals>.<dictcomp>.<listcomp>rH)r�)�logsr�rIr��r�z'parse_keras_history.<locals>.<dictcomp>rcsi|]	\}}||��qSrHrH)r�r�Zlog_value_list)�irHrIr���Zval_Zvalidation_�Ztrain_r�r�cS�g|]}|���qSrH��207capitalize�r��partrHrHrIr��r�z'parse_keras_history.<locals>.<listcomp>r�)208r^r�r��ranger�r>r�r�rNr_)	r��linesZ209epoch_dictr��kr��splitsr�r�rH)r�r�rIr��s*210211212213214215216r�cCsNd}|t|�krd||vr|d7}|t|�krd||vs|t|�krM|d8}|dkr@d||vr@|d8}|dkr@d||vs2|dkrKdd||fSdS||}g}d}t|�D]x}d||vrg||d}d||vr�||��}|�d	d�}|�d217d�}|�dd�}	|�dd�}|�d
d�}|�dd�}|�dd�}|||	d�}218|��D]$\}}|dkr�||219d<q�|�d�}
d�dd�|
dd�D��}||220|<q�|�|221�qYt|�d}|dkr�d||vr�|d8}|dkr�d||vs�|dk�r"i}||��D]\}}|�d�}|dv�rd�dd�|�d�D��}|||<q�|||fS||dfS)zd222    Parse the `log_history` of a Trainer to get the intermediate and final evaluation results.223    rZ
train_runtimer224Z	eval_lossN)NNNzNo logZlossZ225total_flosr��stepZeval_runtimeZeval_samples_per_secondZeval_steps_per_secondZeval_jit_compilation_time)z
Training LossZEpochZStepzValidation Lossr�r�cSrrHrrrHrHrIr�r�z%parse_log_history.<locals>.<listcomp>Zeval_)ZruntimeZsamples_per_secondZsteps_per_secondr�rcSrrHrrrHrHrIr�r�)	r�rrwr=r>r�rNr_�removeprefix)r��idxZ	train_logrZ
training_lossr�r4r�r�rr�r	r�r226r�r�rErFZcamel_cased_keyrHrHrIr��sd��227228229230��231232233�234235r�cCsPddlm}i}t|d�r|jdur|j��|d<nd|d<|j��j|d<|S)Nr236)r��	optimizerZtraining_precision)Zmodeling_tf_utilsr�r^rZ237get_configZmixed_precisionZ
global_policyr�)r�r�r�rHrHrIr�&sr�rcCsRt|t�r%tt|��d��dkr%tt|��d�d�|kr%|d|�d��St|�S)N�.r238�f)r�r�r�rsr�)r�ZdecimalsrHrHrIr�3s:r�cCs"dd�t||�D�}d�|�dS)NcSs.g|]\}}d|��d|t|�d�qS)z| r�r239)r�)r�r�r�rHrHrIr�:s.z'_regular_table_line.<locals>.<listcomp>r��|240)r�rN)r��241col_widthsZvalues_with_spacerHrHrI�_regular_table_line9srcCsdd�|D�}d�|�dS)NcSsg|]242}dd|d�qS)z|:�-�:rH)r�r�rHrHrIr�?sz&_second_table_line.<locals>.<listcomp>r�r)rN)rr�rHrHrI�_second_table_line>srcCs�|dus243t|�dkrdSdd�|dD�}|D]}|��D]\}}||tt|��kr3tt|��||<qqtt|d���t|����}|tt|����7}|D]}|tdd�|��D�t|����7}qP|S)zC244    Create a nice Markdown table from the results in `lines`.245    Nrr�cSsi|]	}|tt|���qSrH)r�rs)r�rErHrHrIr�Irz'make_markdown_table.<locals>.<dictcomp>cSsg|]}t|��qSrHr�r�rHrHrIr�Rr�z'make_markdown_table.<locals>.<listcomp>)r�r>r�rr�r�r�r)rr�linerErF�tablerHrHrIr�Cs��&r�)Z
learning_rate�train_batch_size�eval_batch_size�seedc246s��fdd�tD�}�jjtjtjfvr#�jjtjkrdn�jjj|d<�jjdkr/�jj|d<�jj	dkr;�jj	|d<�jj247�jj�jj	}||dkrQ||d	<�jj�jj}||d248krc||d<�jjr��jj}�jj
rs�jj
nd}d
|��vr�d|�d�jj�d�jj�d�jj�d|��249|d<n250d|�d|��|d<�jjj|d<�jjdkr��jj|d<�jjdkr��jj|d<�jjdkrˈjj|d<n�jj|d<�jjr�jr�d�jj��|d<nd|d<�jjdkr�jj|d<|S) Ncsi|]	}|t�j|��qSrH)�getattrr�)r�r	�r�rHrIr�_rz8extract_hyperparameters_from_trainer.<locals>.<dictcomp>z	multi-GPUZdistributed_typer251Znum_devices�gradient_accumulation_stepsr�total_train_batch_sizer�total_eval_batch_sizez!No additional optimizer argumentsZadamzUse z
 with betas=(�,z) and epsilon=z and optimizer_args=rz and the args are:252�lr_scheduler_typegZlr_scheduler_warmup_ratioZlr_scheduler_warmup_stepsr�Ztraining_stepsZ253num_epochszApex, opt level Zmixed_precision_trainingz254Native AMP�label_smoothing_factor)�_TRAINING_ARGS_KEYSr�Z
parallel_moderZNOT_PARALLELZNOT_DISTRIBUTEDZDISTRIBUTEDrFZ255world_sizerrrZoptimZ256optim_argsr�Z257adam_beta1Z258adam_beta2Zadam_epsilonr"Zwarmup_ratioZwarmup_stepsZ	max_stepsZnum_train_epochsZfp16Zuse_apexZfp16_opt_levelr#)r�r�rr Zoptimizer_nameZoptimizer_argsrHrrIr�^sR�����r�)r)Kr�rwr\rKr:�dataclassesr�pathlibr�typingrrrr�r�Zhuggingface_hubrZhuggingface_hub.errorsrZhuggingface_hub.utilsr	r�rZmodels.auto.modeling_autorr
rrrrrrrrrrrrrZ
training_argsr�utilsrrrrr r!r"r#r�Z259get_loggerr�rAr0r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r$r�rHrHrHrI�<module>s�
D(
260�261.��������	�262���
����		263`#=264

Aluode/PerceptionLabPortable · CoolFace