





'''simple docstring'''

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


lowercase_					= logging.get_logger(__name__)

lowercase_					= {
    """microsoft/trocr-base-handwritten""": (
        """https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json"""
    ),
    # See all TrOCR models at https://huggingface.co/models?filter=trocr
}


class 					a_     (				snake_case_       ):

    '''simple docstring'''
    UpperCamelCase     = '''trocr'''
    UpperCamelCase     = ['''past_key_values''']
    UpperCamelCase     = {
        '''num_attention_heads''': '''decoder_attention_heads''',
        '''hidden_size''': '''d_model''',
        '''num_hidden_layers''': '''decoder_layers''',
    }


    def __init__(		self ,		A=5_0265 ,		A=1024 ,		A=12 ,		A=16 ,		A=4096 ,		A="gelu" ,		A=512 ,		A=0.1 ,		A=0.0 ,		A=0.0 ,		A=2 ,		A=0.02 ,		A=0.0 ,		A=True ,		A=False ,		A=True ,		A=True ,		A=1 ,		A=0 ,		A=2 ,		**A ,		)		->   str:
        _SCREAMING_SNAKE_CASE									=			vocab_size
        _SCREAMING_SNAKE_CASE									=			d_model
        _SCREAMING_SNAKE_CASE									=			decoder_layers
        _SCREAMING_SNAKE_CASE									=			decoder_attention_heads
        _SCREAMING_SNAKE_CASE									=			decoder_ffn_dim
        _SCREAMING_SNAKE_CASE									=			activation_function
        _SCREAMING_SNAKE_CASE									=			max_position_embeddings
        _SCREAMING_SNAKE_CASE									=			dropout
        _SCREAMING_SNAKE_CASE									=			attention_dropout
        _SCREAMING_SNAKE_CASE									=			activation_dropout
        _SCREAMING_SNAKE_CASE									=			init_std
        _SCREAMING_SNAKE_CASE									=			decoder_layerdrop
        _SCREAMING_SNAKE_CASE									=			use_cache
        _SCREAMING_SNAKE_CASE									=			scale_embedding
        _SCREAMING_SNAKE_CASE									=			use_learned_position_embeddings
        _SCREAMING_SNAKE_CASE									=			layernorm_embedding

        super().__init__(
            pad_token_id=A ,		bos_token_id=A ,		eos_token_id=A ,		decoder_start_token_id=A ,		**A ,		)










'''simple docstring'''

from collections.abc import Sequence





def lowerCamelCase						(     __lowerCamelCase :    Sequence[float]					,       __lowerCamelCase :    bool = False    )						->float:
    if not arr:
        return 0

    _SCREAMING_SNAKE_CASE									=			0 if allow_empty_subarrays else float("""-inf"""    )
    _SCREAMING_SNAKE_CASE									=			0.0
    for num in arr:
        _SCREAMING_SNAKE_CASE									=			max(0 if allow_empty_subarrays else num					,       curr_sum + num    )
        _SCREAMING_SNAKE_CASE									=			max(__lowerCamelCase					,       __lowerCamelCase    )

    return max_sum


if __name__ == "__main__":
      from doctest import testmod

      testmod()

      lowercase_					= [-2, 1, -3, 4, -1, 2, 1, -5, 4]
      print(f"""{max_subarray_sum(nums) = }""")



