



'''simple docstring'''






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


lowerCAmelCase:					List[str]						       =						logging.get_logger(__name__)

lowerCAmelCase:					Optional[int]						       =						{
    '''funnel-transformer/small''': '''https://huggingface.co/funnel-transformer/small/resolve/main/config.json''',
    '''funnel-transformer/small-base''': '''https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json''',
    '''funnel-transformer/medium''': '''https://huggingface.co/funnel-transformer/medium/resolve/main/config.json''',
    '''funnel-transformer/medium-base''': '''https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json''',
    '''funnel-transformer/intermediate''': (
        '''https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json'''
    ),
    '''funnel-transformer/intermediate-base''': (
        '''https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json'''
    ),
    '''funnel-transformer/large''': '''https://huggingface.co/funnel-transformer/large/resolve/main/config.json''',
    '''funnel-transformer/large-base''': '''https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json''',
    '''funnel-transformer/xlarge''': '''https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json''',
    '''funnel-transformer/xlarge-base''': '''https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json''',
}

class 							a__(					__lowerCamelCase	):
    lowercase__ =    "funnel"
    lowercase__ =    {
        "hidden_size": "d_model",
        "num_attention_heads": "n_head",
    }







    def __init__(      self :  int						,			__snake_case :  Any=3_05_22						,			__snake_case :  List[Any]=[4, 4, 4]						,			__snake_case :  str=None						,			__snake_case :  Optional[int]=2						,			__snake_case :  Tuple=7_68						,			__snake_case :  Dict=12						,			__snake_case :  Optional[int]=64						,			__snake_case :  Dict=30_72						,			__snake_case :  Optional[int]="gelu_new"						,			__snake_case :  Any=0.1						,			__snake_case :  int=0.1						,			__snake_case :  Union[str, Any]=0.0						,			__snake_case :  Optional[Any]=0.1						,			__snake_case :  Tuple=None						,			__snake_case :  Optional[int]=1e-9						,			__snake_case :  Any="mean"						,			__snake_case :  List[str]="relative_shift"						,			__snake_case :  List[Any]=True						,			__snake_case :  List[str]=True						,			__snake_case :  List[str]=True						,			**__snake_case :  Optional[int]						,			):
      a						:					Optional[Any]        =     vocab_size
      a						:					Optional[Any]        =     block_sizes
      a						:					List[str]        =     [1] * len(__A	) if block_repeats is None else block_repeats
      assert len(__A	) == len(
          self.block_repeats	), "`block_sizes` and `block_repeats` should have the same length."
      a						:					Optional[int]        =     num_decoder_layers
      a						:					List[str]        =     d_model
      a						:					int        =     n_head
      a						:					List[Any]        =     d_head
      a						:					Optional[Any]        =     d_inner
      a						:					Dict        =     hidden_act
      a						:					List[Any]        =     hidden_dropout
      a						:					str        =     attention_dropout
      a						:					Tuple        =     activation_dropout
      a						:					Dict        =     initializer_range
      a						:					Optional[int]        =     initializer_std
      a						:					Dict        =     layer_norm_eps
      assert pooling_type in [
          "mean",
          "max",
      ], F"""Got {pooling_type} for `pooling_type` but only \'mean\' and \'max\' are supported."""
      a						:					int        =     pooling_type
      assert attention_type in [
          "relative_shift",
          "factorized",
      ], F"""Got {attention_type} for `attention_type` but only \'relative_shift\' and \'factorized\' are supported."""
      a						:					List[str]        =     attention_type
      a						:					int        =     separate_cls
      a						:					Dict        =     truncate_seq
      a						:					str        =     pool_q_only

      super().__init__(**__A	)







    @property
    def 			lowercase_       (      self :  int	):
      return sum(self.block_sizes	)







    @num_hidden_layers.setter
    def 			lowercase_       (      self :  List[Any]						,			__snake_case :  List[Any]	):
      raise NotImplementedError(
          'This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`.'	)







    @property
    def 			lowercase_       (      self :  Optional[Any]	):
      return len(self.block_sizes	)







    @num_blocks.setter
    def 			lowercase_       (      self :  Any						,			__snake_case :  int	):
      raise NotImplementedError('This model does not support the setting of `num_blocks`. Please set `block_sizes`.'	)






'''simple docstring'''
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script dumps information about the environment

import os
import platform
import sys


a__							:							Tuple ='''3'''

print('''Python version:''', sys.version)

print('''OS platform:''', platform.platform())
print('''OS architecture:''', platform.machine())

try:
    import torch

    print('''Torch version:''', torch.__version__)
    print('''Cuda available:''', torch.cuda.is_available())
    print('''Cuda version:''', torch.version.cuda)
    print('''CuDNN version:''', torch.backends.cudnn.version())
    print('''Number of GPUs available:''', torch.cuda.device_count())
except ImportError:
    print('''Torch version:''', None)

try:
    import transformers

    print('''transformers version:''', transformers.__version__)
except ImportError:
    print('''transformers version:''', None)
