






from ...configuration_utils import PretrainedConfig
from ...utils import logging


__UpperCAmelCase								=						logging.get_logger(__name__)

__UpperCAmelCase								=						{
    'google/vivit-b-16x2-kinetics400': (
        'https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json'
    ),
    # See all Vivit models at https://huggingface.co/models?filter=vivit
}



class   lowerCamelCase      (_snake_case			):







		'''simple docstring'''



		_snake_case    :    Tuple       						=  '''vivit'''



		def __init__(							self				,		_UpperCamelCase=2_2_4				,		_UpperCamelCase=3_2				,		_UpperCamelCase=[2, 1_6, 1_6]				,		_UpperCamelCase=3				,		_UpperCamelCase=7_6_8				,		_UpperCamelCase=1_2				,		_UpperCamelCase=1_2				,		_UpperCamelCase=3_0_7_2				,		_UpperCamelCase="gelu_fast"				,		_UpperCamelCase=0.0				,		_UpperCamelCase=0.0				,		_UpperCamelCase=0.02				,		_UpperCamelCase=1E-06				,		_UpperCamelCase=True				,		**_UpperCamelCase				,		)	->							int:
							UpperCAmelCase_    :      Optional[Any]            =						hidden_size
							UpperCAmelCase_    :      Any            =						num_hidden_layers
							UpperCAmelCase_    :      Dict            =						num_attention_heads
							UpperCAmelCase_    :      Any            =						intermediate_size
							UpperCAmelCase_    :      Optional[int]            =						hidden_act
							UpperCAmelCase_    :      List[Any]            =						hidden_dropout_prob
							UpperCAmelCase_    :      List[Any]            =						attention_probs_dropout_prob
							UpperCAmelCase_    :      List[Any]            =						initializer_range
							UpperCAmelCase_    :      List[str]            =						layer_norm_eps

							UpperCAmelCase_    :      List[Any]            =						image_size
							UpperCAmelCase_    :      Dict            =						num_frames
							UpperCAmelCase_    :      int            =						tubelet_size
							UpperCAmelCase_    :      List[str]            =						num_channels
							UpperCAmelCase_    :      str            =						qkv_bias

							super().__init__(**_UpperCamelCase   )














import importlib
import shutil
import threading
import warnings
from typing import List

import fsspec
import fsspec.asyn

from . import compression
from .hffilesystem import HfFileSystem


__UpperCAmelCase								=						importlib.util.find_spec('s3fs') is not None

if _has_safs:
		from .safilesystem import SaFileSystem  # noqa: F401

__UpperCAmelCase								=						[
    compression.BzaFileSystem,
    compression.GzipFileSystem,
    compression.LzaFileSystem,
    compression.XzFileSystem,
    compression.ZstdFileSystem,
]

# Register custom filesystems
for fs_class in COMPRESSION_FILESYSTEMS + [HfFileSystem]:
		if fs_class.protocol in fsspec.registry and fsspec.registry[fs_class.protocol] is not fs_class:
				warnings.warn(F'A filesystem protocol was already set for {fs_class.protocol} and will be overwritten.')
		fsspec.register_implementation(fs_class.protocol, fs_class, clobber=True)




def      lowercase__      (     __snake_case    :							str  ):


					'''simple docstring'''


					if "://" in dataset_path:
										UpperCAmelCase_    :      int            =						dataset_path.split('://'  )[1]
					return dataset_path




def      lowercase__      (     __snake_case    :							fsspec.AbstractFileSystem  ):


					'''simple docstring'''


					if fs is not None and fs.protocol != "file":
										return True
					else:
										return False




def      lowercase__      (     __snake_case    :							fsspec.AbstractFileSystem     ,       __snake_case    :							str     ,       __snake_case    :							str  ):


					'''simple docstring'''


					UpperCAmelCase_    :      List[str]            =						not is_remote_filesystem(__snake_case  )
					if is_local:
										# LocalFileSystem.mv does copy + rm, it is more efficient to simply move a local directory
										shutil.move(fs._strip_protocol(__snake_case  )     ,       fs._strip_protocol(__snake_case  )  )
					else:
										fs.mv(__snake_case     ,       __snake_case     ,       recursive=__snake_case  )






def      lowercase__      (     ):


					'''simple docstring'''


					if hasattr(fsspec.asyn     ,       'reset_lock'  ):
										# for future fsspec>2022.05.0
										fsspec.asyn.reset_lock()
					else:
										UpperCAmelCase_    :      Optional[Any]            =						None
										UpperCAmelCase_    :      Union[str, Any]            =						None
										UpperCAmelCase_    :      int            =						threading.Lock()






