from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
		import accelerate





def 				UpperCAmelCase						(    lowercase							):







				"""simple docstring"""



				if not is_accelerate_available():
								return method
				__lowercase 			=							version.parse(accelerate.__version__							).base_version
				if version.parse(lowercase							) < version.parse('''0.17.0'''							):
								return method

				def wrapper(self							,			*lowercase							,			**lowercase							):
								if hasattr(self							,			'''_hf_hook'''							) and hasattr(self._hf_hook							,			'''pre_forward'''							):
												self._hf_hook.pre_forward(self							)
								return method(self							,			*lowercase							,			**lowercase							)

				return wrapper
from ..utils import DummyObject, requires_backends




class    _UpperCamelCase      (						metaclass=_UpperCAmelCase ):


			"""simple docstring"""






			__a  : Dict			 =						['''keras_nlp''']





			def __init__(   self      ,   *lowerCAmelCase__      ,   **lowerCAmelCase__						)     ->					Tuple:

							'''simple docstring'''


							requires_backends(self      ,   ['''keras_nlp''']						)