




from ..utils import DummyObject, requires_backends





class 	lowerCamelCase_							(				metaclass=_UpperCAmelCase ):


 '''simple docstring'''







 lowercase_       =   ['flax', 'transformers']



 def __init__(							self  :		Union[str, Any]    ,    *_lowerCAmelCase  :		Optional[Any]    ,    **_lowerCAmelCase  :		Tuple						):
       requires_backends(self    ,    ['flax', 'transformers']						)



 @classmethod
 def 				lowerCAmelCase_  (							cls  :		List[str]    ,    *_lowerCAmelCase  :		List[str]    ,    **_lowerCAmelCase  :		str						):
       requires_backends(cls    ,    ['flax', 'transformers']						)




 @classmethod
 def 				lowerCAmelCase_  (							cls  :		Optional[Any]    ,    *_lowerCAmelCase  :		Any    ,    **_lowerCAmelCase  :		Any						):
       requires_backends(cls    ,    ['flax', 'transformers']						)





class 	lowerCamelCase_							(				metaclass=_UpperCAmelCase ):


 '''simple docstring'''







 lowercase_       =   ['flax', 'transformers']



 def __init__(							self  :		Any    ,    *_lowerCAmelCase  :		List[Any]    ,    **_lowerCAmelCase  :		Tuple						):
       requires_backends(self    ,    ['flax', 'transformers']						)



 @classmethod
 def 				lowerCAmelCase_  (							cls  :		Any    ,    *_lowerCAmelCase  :		Tuple    ,    **_lowerCAmelCase  :		Dict						):
       requires_backends(cls    ,    ['flax', 'transformers']						)




 @classmethod
 def 				lowerCAmelCase_  (							cls  :		Dict    ,    *_lowerCAmelCase  :		Optional[int]    ,    **_lowerCAmelCase  :		int						):
       requires_backends(cls    ,    ['flax', 'transformers']						)





class 	lowerCamelCase_							(				metaclass=_UpperCAmelCase ):


 '''simple docstring'''







 lowercase_       =   ['flax', 'transformers']



 def __init__(							self  :		int    ,    *_lowerCAmelCase  :		Dict    ,    **_lowerCAmelCase  :		Any						):
       requires_backends(self    ,    ['flax', 'transformers']						)



 @classmethod
 def 				lowerCAmelCase_  (							cls  :		Union[str, Any]    ,    *_lowerCAmelCase  :		int    ,    **_lowerCAmelCase  :		Optional[Any]						):
       requires_backends(cls    ,    ['flax', 'transformers']						)




 @classmethod
 def 				lowerCAmelCase_  (							cls  :		Dict    ,    *_lowerCAmelCase  :		Any    ,    **_lowerCAmelCase  :		Tuple						):
       requires_backends(cls    ,    ['flax', 'transformers']						)





class 	lowerCamelCase_							(				metaclass=_UpperCAmelCase ):


 '''simple docstring'''







 lowercase_       =   ['flax', 'transformers']



 def __init__(							self  :		List[str]    ,    *_lowerCAmelCase  :		Union[str, Any]    ,    **_lowerCAmelCase  :		Dict						):
       requires_backends(self    ,    ['flax', 'transformers']						)



 @classmethod
 def 				lowerCAmelCase_  (							cls  :		Tuple    ,    *_lowerCAmelCase  :		Optional[Any]    ,    **_lowerCAmelCase  :		int						):
       requires_backends(cls    ,    ['flax', 'transformers']						)




 @classmethod
 def 				lowerCAmelCase_  (							cls  :		Tuple    ,    *_lowerCAmelCase  :		Optional[int]    ,    **_lowerCAmelCase  :		Optional[Any]						):
       requires_backends(cls    ,    ['flax', 'transformers']						)





from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
   import accelerate

def  UpperCAmelCase_							(				__UpperCAmelCase						:     Optional[int]							) ->			int:
      if not is_accelerate_available():
            return method
      SCREAMING_SNAKE_CASE_     						=      version.parse(accelerate.__version__							).base_version
      if version.parse(__UpperCAmelCase							) < version.parse('0.17.0'							):
            return method

      def wrapper(self						:     Optional[int]      ,      *__UpperCAmelCase						:     Optional[Any]      ,      **__UpperCAmelCase						:     Optional[Any]							):
            if hasattr(self      ,      '_hf_hook'							) and hasattr(self._hf_hook      ,      'pre_forward'							):
                  self._hf_hook.pre_forward(self							)
            return method(self      ,      *__UpperCAmelCase      ,      **__UpperCAmelCase							)

      return wrapper