a
    d                     @   s.  d dl mZ ddlmZ ddlmZmZmZmZ ddl	m
Z
mZmZmZmZ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#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z, ddl-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJ dd	lKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbmcZcmdZdmeZemfZfmgZgmhZhmiZimjZjmkZkmlZlmmZmmnZnmoZompZpmqZqmrZrmsZsmtZtmuZumvZvmwZwmxZxmyZymzZzm{Z{m|Z|m}Z}m~Z~mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ d
ZdZdZdZdZdZdZdZdZdZdZdZdZeZdZdZdZeZg dg dggd Zg dg dg dgZg dg d g d!gZd"d# Zd$S )%    )version   )__version__   )IMAGENET_DEFAULT_MEANIMAGENET_DEFAULT_STDIMAGENET_STANDARD_MEANIMAGENET_STANDARD_STD)add_code_sample_docstringsadd_end_docstringsadd_start_docstrings%add_start_docstrings_to_model_forward	copy_funcreplace_return_docstrings)ContextManagersExplicitEnumModelOutputPaddingStrategy
TensorTypeadd_model_info_to_auto_mapcached_propertycan_return_lossexpand_dimsfind_labelsflatten_dictinfer_frameworkis_jax_tensoris_numpy_array	is_tensoris_tf_symbolic_tensoris_tf_tensoris_torch_deviceis_torch_dtypeis_torch_tensorreshapesqueeze	strtobooltensor_sizeto_numpy	to_py_obj	transposeworking_or_temp_dir)CLOUDFRONT_DISTRIB_PREFIXDISABLE_TELEMETRYHF_MODULES_CACHEHUGGINGFACE_CO_PREFIXHUGGINGFACE_CO_RESOLVE_ENDPOINTPYTORCH_PRETRAINED_BERT_CACHEPYTORCH_TRANSFORMERS_CACHES3_BUCKET_PREFIXTRANSFORMERS_CACHE TRANSFORMERS_DYNAMIC_MODULE_NAMEEntryNotFoundErrorPushToHubMixinRepositoryNotFoundErrorRevisionNotFoundErrorcached_filedefault_cache_pathdefine_sagemaker_informationdownload_urlextract_commit_hashget_cached_modelsget_file_from_repoget_full_repo_namehas_filehttp_user_agentis_offline_modeis_remote_url
move_cachesend_example_telemetrytry_to_load_from_cache)SENV_VARS_TRUE_AND_AUTO_VALUESENV_VARS_TRUE_VALUESTORCH_FX_REQUIRED_VERSIONUSE_JAXUSE_TF	USE_TORCHDummyObjectOptionalDependencyNotAvailable_LazyModuleccl_versiondirect_transformers_importget_torch_versionis_accelerate_availableis_apex_availableis_bitsandbytes_availableis_bs4_availableis_coloredlogs_availableis_cython_availableis_datasets_availableis_decord_availableis_detectron2_availableis_faiss_availableis_flax_availableis_ftfy_availableis_in_notebookis_ipex_availableis_jieba_availableis_jumanpp_availableis_kenlm_availableis_keras_nlp_availableis_librosa_availableis_natten_availableis_ninja_availableis_onnx_availableis_openai_availableis_optimum_availableis_pandas_availableis_peft_availableis_phonemizer_availableis_protobuf_availableis_psutil_availableis_py3nvml_availableis_pyctcdecode_availableis_pytesseract_available!is_pytorch_quantization_availableis_rjieba_availableis_sacremoses_availableis_safetensors_availableis_sagemaker_dp_enabledis_sagemaker_mp_enabledis_scipy_availableis_sentencepiece_availableis_sklearn_availableis_soundfile_availbleis_spacy_availableis_speech_availableis_sudachi_available#is_tensorflow_probability_availableis_tensorflow_text_availableis_tf2onnx_availableis_tf_availableis_timm_availableis_tokenizers_availableis_torch_availableis_torch_bf16_availableis_torch_bf16_cpu_availableis_torch_bf16_gpu_availableis_torch_compile_availableis_torch_cuda_availableis_torch_fx_availableis_torch_fx_proxyis_torch_neuroncore_availableis_torch_tensorrt_fx_availableis_torch_tf32_availableis_torch_tpu_availableis_torchaudio_availableis_torchdistx_availableis_torchdynamo_availableis_torchvision_availableis_training_run_on_sagemakeris_vision_availablerequires_backendstorch_only_methodzpytorch_model.binzpytorch_model.bin.index.jsonzadapter_model.binzadapter_model.safetensorsztf_model.h5ztf_model.h5.index.jsonz
model.ckptzflax_model.msgpackzflax_model.msgpack.index.jsonzmodel.safetensorszmodel.safetensors.index.jsonzconfig.jsonzpreprocessor_config.jsonzgeneration_config.jsonzmodelcard.jsonu   ▁)r   r   r   r   )r   r   r   r   )      r   r   r   )r   r      r   r   )r   r   r         )r   r   r   r   r   )r   r   r   r   r   )r   r   r   r   r   c                 C   sN   t tt | k rJd| v r"d}nd|  d}|dt d7 }t|d d S )NdevzThis example requires a source install from HuggingFace Transformers (see `https://huggingface.co/transformers/installation.html#installing-from-source`),z+This example requires a minimum version of ,z but the version found is z.
zCheck out https://huggingface.co/transformers/examples.html for the examples corresponding to other versions of HuggingFace Transformers.)r   parser   ImportError)min_versionerror_message r   d/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/transformers/utils/__init__.pycheck_min_version   s    r   N)	packagingr    r   	constantsr   r   r   r	   docr
   r   r   r   r   r   Zgenericr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   Zhubr,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   Zimport_utilsrI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ZWEIGHTS_NAMEZWEIGHTS_INDEX_NAMEZADAPTER_WEIGHTS_NAMEZADAPTER_SAFE_WEIGHTS_NAMEZTF2_WEIGHTS_NAMEZTF2_WEIGHTS_INDEX_NAMEZTF_WEIGHTS_NAMEZFLAX_WEIGHTS_NAMEZFLAX_WEIGHTS_INDEX_NAMEZSAFE_WEIGHTS_NAMEZSAFE_WEIGHTS_INDEX_NAMEZCONFIG_NAMEZFEATURE_EXTRACTOR_NAMEZIMAGE_PROCESSOR_NAMEZGENERATION_CONFIG_NAMEZMODEL_CARD_NAMEZSENTENCEPIECE_UNDERLINEZSPIECE_UNDERLINEZMULTIPLE_CHOICE_DUMMY_INPUTSZDUMMY_INPUTSZ
DUMMY_MASKr   r   r   r   r   <module>   s@    x| UW